Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Marco Bubke
flatpak-qt-creator
Commits
28acadf8
Commit
28acadf8
authored
Jan 14, 2009
by
con
Browse files
Fixes: - ActionContainer --> ActionContainerPrivate
Details: - Preparation for IActionContainer --> ActionContainer
parent
df56b106
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/coreplugin/actionmanager/actioncontainer.cpp
View file @
28acadf8
...
...
@@ -31,7 +31,7 @@
**
***************************************************************************/
#include "actioncontainer.h"
#include "actioncontainer
_p
.h"
#include "actionmanager_p.h"
#include "command.h"
...
...
@@ -116,47 +116,47 @@ using namespace Core::Internal;
\fn virtual IActionContainer::~IActionContainer()
*/
// ---------- ActionContainer ------------
// ---------- ActionContainer
Private
------------
/*!
\class Core::Internal::ActionContainer
\class Core::Internal::ActionContainer
Private
\internal
*/
ActionContainer
::
ActionContainer
(
int
id
)
ActionContainer
Private
::
ActionContainer
Private
(
int
id
)
:
m_data
(
CS_None
),
m_id
(
id
)
{
}
void
ActionContainer
::
setEmptyAction
(
EmptyAction
ea
)
void
ActionContainer
Private
::
setEmptyAction
(
EmptyAction
ea
)
{
m_data
=
((
m_data
&
~
EA_Mask
)
|
ea
);
}
bool
ActionContainer
::
hasEmptyAction
(
EmptyAction
ea
)
const
bool
ActionContainer
Private
::
hasEmptyAction
(
EmptyAction
ea
)
const
{
return
(
m_data
&
EA_Mask
)
==
ea
;
}
void
ActionContainer
::
setState
(
ContainerState
state
)
void
ActionContainer
Private
::
setState
(
ContainerState
state
)
{
m_data
|=
state
;
}
bool
ActionContainer
::
hasState
(
ContainerState
state
)
const
bool
ActionContainer
Private
::
hasState
(
ContainerState
state
)
const
{
return
(
m_data
&
state
);
}
void
ActionContainer
::
appendGroup
(
const
QString
&
group
)
void
ActionContainer
Private
::
appendGroup
(
const
QString
&
group
)
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
gid
=
idmanager
->
uniqueIdentifier
(
group
);
m_groups
<<
gid
;
}
QAction
*
ActionContainer
::
insertLocation
(
const
QString
&
group
)
const
QAction
*
ActionContainer
Private
::
insertLocation
(
const
QString
&
group
)
const
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
grpid
=
idmanager
->
uniqueIdentifier
(
group
);
...
...
@@ -165,7 +165,7 @@ QAction *ActionContainer::insertLocation(const QString &group) const
return
beforeAction
(
pos
,
&
prevKey
);
}
void
ActionContainer
::
addAction
(
ICommand
*
action
,
const
QString
&
group
)
void
ActionContainer
Private
::
addAction
(
ICommand
*
action
,
const
QString
&
group
)
{
if
(
!
canAddAction
(
action
))
return
;
...
...
@@ -176,7 +176,7 @@ void ActionContainer::addAction(ICommand *action, const QString &group)
QList
<
CommandLocation
>
locs
=
a
->
locations
();
for
(
int
i
=
0
;
i
<
locs
.
size
();
++
i
)
{
if
(
IActionContainer
*
aci
=
am
->
actionContainer
(
locs
.
at
(
i
).
m_container
))
{
ActionContainer
*
ac
=
static_cast
<
ActionContainer
*>
(
aci
);
ActionContainer
Private
*
ac
=
static_cast
<
ActionContainer
Private
*>
(
aci
);
ac
->
addAction
(
action
,
locs
.
at
(
i
).
m_position
,
false
);
}
}
...
...
@@ -193,21 +193,21 @@ void ActionContainer::addAction(ICommand *action, const QString &group)
}
}
void
ActionContainer
::
addMenu
(
IActionContainer
*
menu
,
const
QString
&
group
)
void
ActionContainer
Private
::
addMenu
(
IActionContainer
*
menu
,
const
QString
&
group
)
{
ActionContainer
*
container
=
static_cast
<
ActionContainer
*>
(
menu
);
ActionContainer
Private
*
container
=
static_cast
<
ActionContainer
Private
*>
(
menu
);
if
(
!
container
->
canBeAddedToMenu
())
return
;
ActionManagerPrivate
*
am
=
ActionManagerPrivate
::
instance
();
MenuActionContainer
*
mc
=
static_cast
<
MenuActionContainer
*>
(
menu
);
if
(
mc
->
hasState
(
ActionContainer
::
CS_PreLocation
))
{
if
(
mc
->
hasState
(
ActionContainer
Private
::
CS_PreLocation
))
{
CommandLocation
loc
=
mc
->
location
();
if
(
IActionContainer
*
aci
=
am
->
actionContainer
(
loc
.
m_container
))
{
ActionContainer
*
ac
=
static_cast
<
ActionContainer
*>
(
aci
);
ActionContainer
Private
*
ac
=
static_cast
<
ActionContainer
Private
*>
(
aci
);
ac
->
addMenu
(
menu
,
loc
.
m_position
,
false
);
}
mc
->
setState
(
ActionContainer
::
CS_Initialized
);
mc
->
setState
(
ActionContainer
Private
::
CS_Initialized
);
}
else
{
UniqueIDManager
*
idmanager
=
CoreImpl
::
instance
()
->
uniqueIDManager
();
int
grpid
=
idmanager
->
uniqueIdentifier
(
Constants
::
G_DEFAULT_TWO
);
...
...
@@ -220,22 +220,22 @@ void ActionContainer::addMenu(IActionContainer *menu, const QString &group)
}
}
int
ActionContainer
::
id
()
const
int
ActionContainer
Private
::
id
()
const
{
return
m_id
;
}
QMenu
*
ActionContainer
::
menu
()
const
QMenu
*
ActionContainer
Private
::
menu
()
const
{
return
0
;
}
QMenuBar
*
ActionContainer
::
menuBar
()
const
QMenuBar
*
ActionContainer
Private
::
menuBar
()
const
{
return
0
;
}
bool
ActionContainer
::
canAddAction
(
ICommand
*
action
)
const
bool
ActionContainer
Private
::
canAddAction
(
ICommand
*
action
)
const
{
if
(
action
->
type
()
!=
ICommand
::
CT_OverridableAction
)
return
false
;
...
...
@@ -247,7 +247,7 @@ bool ActionContainer::canAddAction(ICommand *action) const
return
true
;
}
void
ActionContainer
::
addAction
(
ICommand
*
action
,
int
pos
,
bool
setpos
)
void
ActionContainer
Private
::
addAction
(
ICommand
*
action
,
int
pos
,
bool
setpos
)
{
Action
*
a
=
static_cast
<
Action
*>
(
action
);
...
...
@@ -269,7 +269,7 @@ void ActionContainer::addAction(ICommand *action, int pos, bool setpos)
insertAction
(
ba
,
a
->
action
());
}
void
ActionContainer
::
addMenu
(
IActionContainer
*
menu
,
int
pos
,
bool
setpos
)
void
ActionContainer
Private
::
addMenu
(
IActionContainer
*
menu
,
int
pos
,
bool
setpos
)
{
MenuActionContainer
*
mc
=
static_cast
<
MenuActionContainer
*>
(
menu
);
...
...
@@ -289,7 +289,7 @@ void ActionContainer::addMenu(IActionContainer *menu, int pos, bool setpos)
insertMenu
(
ba
,
mc
->
menu
());
}
QAction
*
ActionContainer
::
beforeAction
(
int
pos
,
int
*
prevKey
)
const
QAction
*
ActionContainer
Private
::
beforeAction
(
int
pos
,
int
*
prevKey
)
const
{
ActionManagerPrivate
*
am
=
ActionManagerPrivate
::
instance
();
...
...
@@ -319,7 +319,7 @@ QAction *ActionContainer::beforeAction(int pos, int *prevKey) const
return
0
;
}
int
ActionContainer
::
calcPosition
(
int
pos
,
int
prevKey
)
const
int
ActionContainer
Private
::
calcPosition
(
int
pos
,
int
prevKey
)
const
{
int
grp
=
(
pos
&
0xFFFF0000
);
if
(
prevKey
==
-
1
)
...
...
@@ -341,7 +341,7 @@ int ActionContainer::calcPosition(int pos, int prevKey) const
*/
MenuActionContainer
::
MenuActionContainer
(
int
id
)
:
ActionContainer
(
id
),
m_menu
(
0
)
:
ActionContainer
Private
(
id
),
m_menu
(
0
)
{
setEmptyAction
(
EA_Disable
);
}
...
...
@@ -417,7 +417,7 @@ bool MenuActionContainer::update()
bool
MenuActionContainer
::
canBeAddedToMenu
()
const
{
if
(
hasState
(
ActionContainer
::
CS_Initialized
))
if
(
hasState
(
ActionContainer
Private
::
CS_Initialized
))
return
false
;
return
true
;
...
...
@@ -432,7 +432,7 @@ bool MenuActionContainer::canBeAddedToMenu() const
*/
MenuBarActionContainer
::
MenuBarActionContainer
(
int
id
)
:
ActionContainer
(
id
),
m_menuBar
(
0
)
:
ActionContainer
Private
(
id
),
m_menuBar
(
0
)
{
setEmptyAction
(
EA_None
);
}
...
...
src/plugins/coreplugin/actionmanager/actioncontainer.h
→
src/plugins/coreplugin/actionmanager/actioncontainer
_p
.h
View file @
28acadf8
...
...
@@ -31,8 +31,8 @@
**
***************************************************************************/
#ifndef ACTIONCONTAINER_H
#define ACTIONCONTAINER_H
#ifndef ACTIONCONTAINER_
P_
H
#define ACTIONCONTAINER_
P_
H
#include "actionmanager_p.h"
...
...
@@ -42,7 +42,7 @@
namespace
Core
{
namespace
Internal
{
class
ActionContainer
:
public
Core
::
IActionContainer
class
ActionContainer
Private
:
public
Core
::
IActionContainer
{
public:
enum
ContainerState
{
...
...
@@ -52,8 +52,8 @@ public:
CS_UserDefined
=
0x040000
};
ActionContainer
(
int
id
);
virtual
~
ActionContainer
()
{}
ActionContainer
Private
(
int
id
);
virtual
~
ActionContainer
Private
()
{}
void
setEmptyAction
(
EmptyAction
ea
);
bool
hasEmptyAction
(
EmptyAction
ea
)
const
;
...
...
@@ -96,7 +96,7 @@ private:
QList
<
ICommand
*>
m_commands
;
};
class
MenuActionContainer
:
public
ActionContainer
class
MenuActionContainer
:
public
ActionContainer
Private
{
public:
MenuActionContainer
(
int
id
);
...
...
@@ -118,7 +118,7 @@ private:
CommandLocation
m_location
;
};
class
MenuBarActionContainer
:
public
ActionContainer
class
MenuBarActionContainer
:
public
ActionContainer
Private
{
public:
MenuBarActionContainer
(
int
id
);
...
...
@@ -139,4 +139,4 @@ private:
}
// namespace Internal
}
// namespace Core
#endif // ACTIONCONTAINER_H
#endif // ACTIONCONTAINER_
P_
H
src/plugins/coreplugin/actionmanager/actionmanager.cpp
View file @
28acadf8
...
...
@@ -33,7 +33,7 @@
#include "actionmanager_p.h"
#include "mainwindow.h"
#include "actioncontainer.h"
#include "actioncontainer
_p
.h"
#include "command.h"
#include "uniqueidmanager.h"
...
...
@@ -238,7 +238,7 @@ QList<Command *> ActionManagerPrivate::commands() const
return
m_idCmdMap
.
values
();
}
QList
<
ActionContainer
*>
ActionManagerPrivate
::
containers
()
const
QList
<
ActionContainer
Private
*>
ActionManagerPrivate
::
containers
()
const
{
return
m_idContainerMap
.
values
();
}
...
...
src/plugins/coreplugin/actionmanager/actionmanager_p.h
View file @
28acadf8
...
...
@@ -56,7 +56,7 @@ class UniqueIDManager;
namespace
Internal
{
class
ActionContainer
;
class
ActionContainer
Private
;
class
MainWindow
;
class
Command
;
...
...
@@ -75,7 +75,7 @@ public:
QList
<
int
>
defaultGroups
()
const
;
QList
<
Command
*>
commands
()
const
;
QList
<
ActionContainer
*>
containers
()
const
;
QList
<
ActionContainer
Private
*>
containers
()
const
;
bool
hasContext
(
int
context
)
const
;
...
...
@@ -107,7 +107,7 @@ private:
typedef
QHash
<
int
,
Command
*>
IdCmdMap
;
IdCmdMap
m_idCmdMap
;
typedef
QHash
<
int
,
ActionContainer
*>
IdContainerMap
;
typedef
QHash
<
int
,
ActionContainer
Private
*>
IdContainerMap
;
IdContainerMap
m_idContainerMap
;
// typedef QMap<int, int> GlobalGroupMap;
...
...
src/plugins/coreplugin/coreplugin.pro
View file @
28acadf8
...
...
@@ -103,7 +103,7 @@ HEADERS += mainwindow.h \
actionmanager
/
icommand
.
h
\
actionmanager
/
actionmanager_p
.
h
\
actionmanager
/
command
.
h
\
actionmanager
/
actioncontainer
.
h
\
actionmanager
/
actioncontainer
_p
.
h
\
actionmanager
/
commandsfile
.
h
\
dialogs
/
saveitemsdialog
.
h
\
dialogs
/
newdialog
.
h
\
...
...
src/plugins/coreplugin/mainwindow.cpp
View file @
28acadf8
...
...
@@ -32,7 +32,7 @@
***************************************************************************/
#include "mainwindow.h"
#include "actioncontainer.h"
#include "
i
actioncontainer.h"
#include "actionmanager_p.h"
#include "basemode.h"
#include "coreimpl.h"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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