Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
684f8725
Commit
684f8725
authored
Jan 17, 2011
by
con
Browse files
Remove unused internal "CommandLocation".
parent
b94d100e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/actionmanager/actioncontainer.cpp
View file @
684f8725
...
...
@@ -205,7 +205,7 @@ void ActionContainerPrivate::addAction(Command *action, const QString &group)
if
(
!
m_groups
.
contains
(
grpid
)
&&
!
am
->
defaultGroups
().
contains
(
grpid
))
qWarning
()
<<
"*** addAction(): Unknown group: "
<<
group
;
int
pos
=
((
grpid
<<
16
)
|
0xFFFF
);
addAction
(
action
,
pos
,
true
);
addAction
Internal
(
action
,
pos
);
}
void
ActionContainerPrivate
::
addMenu
(
ActionContainer
*
menu
,
const
QString
&
group
)
...
...
@@ -222,7 +222,7 @@ void ActionContainerPrivate::addMenu(ActionContainer *menu, const QString &group
if
(
!
m_groups
.
contains
(
grpid
)
&&
!
am
->
defaultGroups
().
contains
(
grpid
))
qWarning
()
<<
"*** addMenu(): Unknown group: "
<<
group
;
int
pos
=
((
grpid
<<
16
)
|
0xFFFF
);
addMenu
(
menu
,
pos
,
true
);
addMenu
Internal
(
menu
,
pos
);
}
int
ActionContainerPrivate
::
id
()
const
...
...
@@ -245,22 +245,13 @@ bool ActionContainerPrivate::canAddAction(Command *action) const
return
(
action
->
action
()
!=
0
);
}
void
ActionContainerPrivate
::
addAction
(
Command
*
action
,
int
pos
,
bool
setpos
)
void
ActionContainerPrivate
::
addAction
Internal
(
Command
*
action
,
int
pos
)
{
Action
*
a
=
static_cast
<
Action
*>
(
action
);
int
prevKey
=
0
;
QAction
*
ba
=
beforeAction
(
pos
,
&
prevKey
);
if
(
setpos
)
{
pos
=
calcPosition
(
pos
,
prevKey
);
CommandLocation
loc
;
loc
.
m_container
=
m_id
;
loc
.
m_position
=
pos
;
QList
<
CommandLocation
>
locs
=
a
->
locations
();
locs
.
append
(
loc
);
a
->
setLocations
(
locs
);
}
pos
=
calcPosition
(
pos
,
prevKey
);
m_commands
.
append
(
action
);
m_posmap
.
insert
(
pos
,
action
->
id
());
...
...
@@ -269,20 +260,13 @@ void ActionContainerPrivate::addAction(Command *action, int pos, bool setpos)
scheduleUpdate
();
}
void
ActionContainerPrivate
::
addMenu
(
ActionContainer
*
menu
,
int
pos
,
bool
setpos
)
void
ActionContainerPrivate
::
addMenu
Internal
(
ActionContainer
*
menu
,
int
pos
)
{
MenuActionContainer
*
mc
=
static_cast
<
MenuActionContainer
*>
(
menu
);
int
prevKey
=
0
;
QAction
*
ba
=
beforeAction
(
pos
,
&
prevKey
);
if
(
setpos
)
{
pos
=
calcPosition
(
pos
,
prevKey
);
CommandLocation
loc
;
loc
.
m_container
=
m_id
;
loc
.
m_position
=
pos
;
mc
->
setLocation
(
loc
);
}
pos
=
calcPosition
(
pos
,
prevKey
);
m_subContainers
.
append
(
menu
);
m_posmap
.
insert
(
pos
,
menu
->
id
());
...
...
@@ -386,16 +370,6 @@ void MenuActionContainer::insertMenu(QAction *before, QMenu *menu)
m_menu
->
insertMenu
(
before
,
menu
);
}
void
MenuActionContainer
::
setLocation
(
const
CommandLocation
&
location
)
{
m_location
=
location
;
}
CommandLocation
MenuActionContainer
::
location
()
const
{
return
m_location
;
}
bool
MenuActionContainer
::
updateInternal
()
{
if
(
onAllDisabledBehavior
()
==
Show
)
...
...
src/plugins/coreplugin/actionmanager/actioncontainer_p.h
View file @
684f8725
...
...
@@ -76,8 +76,8 @@ protected:
bool
canAddMenu
(
ActionContainer
*
menu
)
const
;
virtual
bool
canBeAddedToMenu
()
const
=
0
;
void
addAction
(
Command
*
action
,
int
pos
,
bool
setpos
);
void
addMenu
(
ActionContainer
*
menu
,
int
pos
,
bool
setpos
);
void
addAction
Internal
(
Command
*
action
,
int
pos
);
void
addMenu
Internal
(
ActionContainer
*
menu
,
int
pos
);
private
slots
:
void
scheduleUpdate
();
...
...
@@ -104,9 +104,6 @@ public:
void
setMenu
(
QMenu
*
menu
);
QMenu
*
menu
()
const
;
void
setLocation
(
const
CommandLocation
&
location
);
CommandLocation
location
()
const
;
void
insertAction
(
QAction
*
before
,
QAction
*
action
);
void
insertMenu
(
QAction
*
before
,
QMenu
*
menu
);
...
...
@@ -116,7 +113,6 @@ protected:
private:
QMenu
*
m_menu
;
CommandLocation
m_location
;
};
class
MenuBarActionContainer
:
public
ActionContainerPrivate
...
...
src/plugins/coreplugin/actionmanager/command.cpp
View file @
684f8725
...
...
@@ -403,16 +403,6 @@ QAction *Action::action() const
return
m_action
;
}
void
Action
::
setLocations
(
const
QList
<
CommandLocation
>
&
locations
)
{
m_locations
=
locations
;
}
QList
<
CommandLocation
>
Action
::
locations
()
const
{
return
m_locations
;
}
void
Action
::
setKeySequence
(
const
QKeySequence
&
key
)
{
CommandPrivate
::
setKeySequence
(
key
);
...
...
src/plugins/coreplugin/actionmanager/command_p.h
View file @
684f8725
...
...
@@ -45,12 +45,6 @@
#include
<QtCore/QMap>
#include
<QtGui/QKeySequence>
struct
CommandLocation
{
int
m_container
;
int
m_position
;
};
namespace
Core
{
namespace
Internal
{
...
...
@@ -135,9 +129,6 @@ public:
QAction
*
action
()
const
;
void
setLocations
(
const
QList
<
CommandLocation
>
&
locations
);
QList
<
CommandLocation
>
locations
()
const
;
void
setCurrentContext
(
const
Context
&
context
);
bool
isActive
()
const
;
void
addOverrideAction
(
QAction
*
action
,
const
Context
&
context
,
bool
scriptable
);
...
...
@@ -157,7 +148,6 @@ private:
void
setActive
(
bool
state
);
Utils
::
ProxyAction
*
m_action
;
QList
<
CommandLocation
>
m_locations
;
QString
m_toolTip
;
QMap
<
int
,
QPointer
<
QAction
>
>
m_contextActionMap
;
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment