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
Marco Bubke
flatpak-qt-creator
Commits
745345e3
Commit
745345e3
authored
May 25, 2010
by
kh1
Browse files
There is no dependency, so make the runtime manager an real singelton.
Reviewed-by: ck
parent
070f4df4
Changes
6
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemomanager.cpp
View file @
745345e3
...
...
@@ -44,6 +44,9 @@
#include
<QtCore/QFile>
#include
<QtCore/QTextStream>
using
namespace
ExtensionSystem
;
using
namespace
ProjectExplorer
;
namespace
Qt4ProjectManager
{
namespace
Internal
{
...
...
@@ -59,10 +62,10 @@ MaemoManager::MaemoManager()
Q_ASSERT
(
!
m_instance
);
m_instance
=
this
;
QemuRuntimeManager
::
instance
(
this
);
MaemoDeviceConfigurations
::
instance
(
this
);
ExtensionSystem
::
PluginManager
*
pluginManager
=
ExtensionSystem
::
PluginManager
::
instance
();
PluginManager
*
pluginManager
=
PluginManager
::
instance
();
pluginManager
->
addObject
(
m_runControlFactory
);
pluginManager
->
addObject
(
m_runConfigurationFactory
);
pluginManager
->
addObject
(
m_packageCreationFactory
);
...
...
@@ -71,8 +74,7 @@ MaemoManager::MaemoManager()
MaemoManager
::~
MaemoManager
()
{
ExtensionSystem
::
PluginManager
*
pluginManager
=
ExtensionSystem
::
PluginManager
::
instance
();
PluginManager
*
pluginManager
=
PluginManager
::
instance
();
pluginManager
->
removeObject
(
m_runControlFactory
);
pluginManager
->
removeObject
(
m_runConfigurationFactory
);
pluginManager
->
removeObject
(
m_packageCreationFactory
);
...
...
@@ -87,13 +89,7 @@ MaemoManager &MaemoManager::instance()
return
*
m_instance
;
}
void
MaemoManager
::
init
()
{
m_qemuRuntimeManager
=
new
QemuRuntimeManager
(
this
);
}
bool
MaemoManager
::
isValidMaemoQtVersion
(
const
Qt4ProjectManager
::
QtVersion
*
version
)
const
bool
MaemoManager
::
isValidMaemoQtVersion
(
const
QtVersion
*
version
)
const
{
QString
path
=
QDir
::
cleanPath
(
version
->
qmakeCommand
());
path
=
path
.
remove
(
QLatin1String
(
"/bin/qmake"
EXEC_SUFFIX
));
...
...
@@ -116,8 +112,7 @@ MaemoManager::isValidMaemoQtVersion(const Qt4ProjectManager::QtVersion *version)
return
false
;
}
ProjectExplorer
::
ToolChain
*
MaemoManager
::
maemoToolChain
(
const
QtVersion
*
version
)
const
ToolChain
*
MaemoManager
::
maemoToolChain
(
const
QtVersion
*
version
)
const
{
QString
targetRoot
=
QDir
::
cleanPath
(
version
->
qmakeCommand
());
targetRoot
.
remove
(
QLatin1String
(
"/bin/qmake"
EXEC_SUFFIX
));
...
...
src/plugins/qt4projectmanager/qt-maemo/maemomanager.h
View file @
745345e3
...
...
@@ -56,8 +56,6 @@ public:
~
MaemoManager
();
static
MaemoManager
&
instance
();
void
init
();
bool
isValidMaemoQtVersion
(
const
Qt4ProjectManager
::
QtVersion
*
version
)
const
;
ToolChain
*
maemoToolChain
(
const
Qt4ProjectManager
::
QtVersion
*
version
)
const
;
...
...
src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp
View file @
745345e3
...
...
@@ -69,9 +69,6 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
,
m_needsSetup
(
true
)
,
m_userTerminated
(
false
)
{
Q_ASSERT
(
!
m_instance
);
m_instance
=
this
;
m_qemuStarterIcon
.
addFile
(
":/qt-maemo/images/qemu-run.png"
,
iconSize
);
m_qemuStarterIcon
.
addFile
(
":/qt-maemo/images/qemu-stop.png"
,
iconSize
,
QIcon
::
Normal
,
QIcon
::
On
);
...
...
@@ -117,11 +114,13 @@ QemuRuntimeManager::QemuRuntimeManager(QObject *parent)
QemuRuntimeManager
::~
QemuRuntimeManager
()
{
terminateRuntime
();
m_instance
=
0
;
}
QemuRuntimeManager
&
QemuRuntimeManager
::
instance
()
QemuRuntimeManager
&
QemuRuntimeManager
::
instance
(
QObject
*
parent
)
{
Q_ASSERT
(
m_instance
);
if
(
m_instance
==
0
)
m_instance
=
new
QemuRuntimeManager
(
parent
);
return
*
m_instance
;
}
...
...
src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.h
View file @
745345e3
...
...
@@ -71,10 +71,7 @@ class QemuRuntimeManager : public QObject
Q_OBJECT
public:
QemuRuntimeManager
(
QObject
*
parent
=
0
);
~
QemuRuntimeManager
();
static
QemuRuntimeManager
&
instance
();
static
QemuRuntimeManager
&
instance
(
QObject
*
parent
=
0
);
bool
runtimeForQtVersion
(
int
uniqueId
,
Runtime
*
rt
)
const
;
...
...
@@ -111,6 +108,9 @@ private slots:
void
qemuStatusChanged
(
QemuStatus
status
,
const
QString
&
error
);
private:
QemuRuntimeManager
(
QObject
*
parent
);
~
QemuRuntimeManager
();
void
setupRuntimes
();
bool
sessionHasMaemoTarget
()
const
;
...
...
src/plugins/qt4projectmanager/qt4projectmanagerplugin.cpp
View file @
745345e3
...
...
@@ -153,7 +153,7 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
addAutoReleasedObject
(
new
LinguistExternalEditor
);
addAutoReleasedObject
(
new
S60Manager
);
addAutoReleasedObject
(
m_maemoManager
=
new
MaemoManager
);
addAutoReleasedObject
(
new
MaemoManager
);
new
ProFileCacheManager
(
this
);
...
...
@@ -228,7 +228,6 @@ bool Qt4ProjectManagerPlugin::initialize(const QStringList &arguments, QString *
void
Qt4ProjectManagerPlugin
::
extensionsInitialized
()
{
m_qt4ProjectManager
->
init
();
m_maemoManager
->
init
();
// depends on the Qt4ProjectManager
}
void
Qt4ProjectManagerPlugin
::
updateContextMenu
(
Project
*
project
,
...
...
src/plugins/qt4projectmanager/qt4projectmanagerplugin.h
View file @
745345e3
...
...
@@ -56,7 +56,6 @@ class QMakeStepFactory;
class
MakeStepFactory
;
class
EmbeddedPropertiesPage
;
class
GettingStartedWelcomePage
;
class
MaemoManager
;
class
Qt4ProjectManagerPlugin
:
public
ExtensionSystem
::
IPlugin
{
...
...
@@ -86,7 +85,6 @@ private:
ProjectExplorer
::
ProjectExplorerPlugin
*
m_projectExplorer
;
ProFileEditorFactory
*
m_proFileEditorFactory
;
Qt4Manager
*
m_qt4ProjectManager
;
MaemoManager
*
m_maemoManager
;
int
m_projectContext
;
...
...
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