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
83edceaf
Commit
83edceaf
authored
Jun 21, 2010
by
kh1
Browse files
Fix missing update notification if a device config get's added/removed.
Task-number: QTCREATORBUG-1686 Reviewed-by: ck
parent
38b2ffce
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
View file @
83edceaf
...
...
@@ -321,7 +321,7 @@ void MaemoRunConfiguration::updateDeviceConfigurations()
}
else
{
m_devConfig
=
configManager
.
find
(
m_devConfig
.
internalId
);
}
emit
deviceConfigurationsUpdated
();
emit
deviceConfigurationsUpdated
(
target
()
);
}
}
// namespace Internal
...
...
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.h
View file @
83edceaf
...
...
@@ -93,7 +93,7 @@ public:
virtual
QVariantMap
toMap
()
const
;
signals:
void
deviceConfigurationsUpdated
();
void
deviceConfigurationsUpdated
(
ProjectExplorer
::
Target
*
target
);
void
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
target
);
void
targetInformationChanged
()
const
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp
View file @
83edceaf
...
...
@@ -89,7 +89,7 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
mainLayout
->
addRow
(
tr
(
"Arguments:"
),
m_argsLineEdit
);
resetDeviceConfigurations
();
connect
(
m_runConfiguration
,
SIGNAL
(
deviceConfigurationsUpdated
()),
connect
(
m_runConfiguration
,
SIGNAL
(
deviceConfigurationsUpdated
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
resetDeviceConfigurations
()));
connect
(
m_configNameLineEdit
,
SIGNAL
(
textEdited
(
QString
)),
this
,
...
...
src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.cpp
View file @
83edceaf
...
...
@@ -199,7 +199,7 @@ void QemuRuntimeManager::projectRemoved(ProjectExplorer::Project *project)
void
QemuRuntimeManager
::
projectChanged
(
ProjectExplorer
::
Project
*
project
)
{
if
(
project
)
to
o
gleStarterButton
(
project
->
activeTarget
());
to
g
gleStarterButton
(
project
->
activeTarget
());
}
bool
targetIsMaemo
(
const
QString
&
id
)
...
...
@@ -231,13 +231,8 @@ void QemuRuntimeManager::targetAdded(ProjectExplorer::Target *target)
// handle the qt version changes the build configuration uses
connect
(
target
,
SIGNAL
(
environmentChanged
()),
this
,
SLOT
(
environmentChanged
()));
foreach
(
RunConfiguration
*
runConfig
,
target
->
runConfigurations
())
{
MaemoRunConfiguration
*
mrc
=
qobject_cast
<
MaemoRunConfiguration
*>
(
runConfig
);
if
(
mrc
)
{
// handle device configuration change too
connect
(
mrc
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
}
}
foreach
(
RunConfiguration
*
rc
,
target
->
runConfigurations
())
toggleDeviceConnections
(
qobject_cast
<
MaemoRunConfiguration
*>
(
rc
),
true
);
m_qemuAction
->
setVisible
(
!
m_runtimes
.
isEmpty
()
&&
sessionHasMaemoTarget
());
}
...
...
@@ -262,44 +257,29 @@ void QemuRuntimeManager::targetRemoved(ProjectExplorer::Target *target)
disconnect
(
target
,
SIGNAL
(
environmentChanged
()),
this
,
SLOT
(
environmentChanged
()));
foreach
(
RunConfiguration
*
runConfig
,
target
->
runConfigurations
())
{
MaemoRunConfiguration
*
mrc
=
qobject_cast
<
MaemoRunConfiguration
*>
(
runConfig
);
if
(
mrc
)
{
disconnect
(
mrc
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
}
}
foreach
(
RunConfiguration
*
rc
,
target
->
runConfigurations
())
toggleDeviceConnections
(
qobject_cast
<
MaemoRunConfiguration
*>
(
rc
),
false
);
m_qemuAction
->
setVisible
(
!
m_runtimes
.
isEmpty
()
&&
sessionHasMaemoTarget
());
}
void
QemuRuntimeManager
::
targetChanged
(
ProjectExplorer
::
Target
*
target
)
{
if
(
target
)
to
o
gleStarterButton
(
target
);
to
g
gleStarterButton
(
target
);
}
void
QemuRuntimeManager
::
runConfigurationAdded
(
ProjectExplorer
::
RunConfiguration
*
rc
)
{
if
(
!
rc
||
!
targetIsMaemo
(
rc
->
target
()
->
id
()))
return
;
MaemoRunConfiguration
*
mrc
=
qobject_cast
<
MaemoRunConfiguration
*>
(
rc
);
if
(
mrc
)
{
// handle device configuration change too
connect
(
mrc
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
}
toggleDeviceConnections
(
qobject_cast
<
MaemoRunConfiguration
*>
(
rc
),
true
);
}
void
QemuRuntimeManager
::
runConfigurationRemoved
(
ProjectExplorer
::
RunConfiguration
*
rc
)
{
if
(
!
rc
||
rc
->
target
()
->
id
()
!=
QLatin1String
(
Constants
::
MAEMO_DEVICE_TARGET_ID
))
return
;
MaemoRunConfiguration
*
mrc
=
qobject_cast
<
MaemoRunConfiguration
*>
(
rc
);
if
(
mrc
)
{
disconnect
(
mrc
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
}
toggleDeviceConnections
(
qobject_cast
<
MaemoRunConfiguration
*>
(
rc
),
false
);
}
void
QemuRuntimeManager
::
runConfigurationChanged
(
ProjectExplorer
::
RunConfiguration
*
rc
)
...
...
@@ -327,7 +307,7 @@ void QemuRuntimeManager::buildConfigurationRemoved(ProjectExplorer::BuildConfigu
void
QemuRuntimeManager
::
buildConfigurationChanged
(
ProjectExplorer
::
BuildConfiguration
*
bc
)
{
if
(
bc
)
to
o
gleStarterButton
(
bc
->
target
());
to
g
gleStarterButton
(
bc
->
target
());
}
void
QemuRuntimeManager
::
environmentChanged
()
...
...
@@ -335,7 +315,7 @@ void QemuRuntimeManager::environmentChanged()
// likely to happen when the qt version changes the build config is using
if
(
ProjectExplorerPlugin
*
explorer
=
ProjectExplorerPlugin
::
instance
())
{
if
(
Project
*
project
=
explorer
->
session
()
->
startupProject
())
to
o
gleStarterButton
(
project
->
activeTarget
());
to
g
gleStarterButton
(
project
->
activeTarget
());
}
}
...
...
@@ -492,7 +472,7 @@ void QemuRuntimeManager::updateStarterIcon(bool running)
state
));
}
void
QemuRuntimeManager
::
to
o
gleStarterButton
(
Target
*
target
)
void
QemuRuntimeManager
::
to
g
gleStarterButton
(
Target
*
target
)
{
if
(
m_needsSetup
)
setupRuntimes
();
...
...
@@ -619,3 +599,22 @@ QString QemuRuntimeManager::runtimeForQtVersion(const QString &qmakeCommand) con
}
return
QString
();
}
void
QemuRuntimeManager
::
toggleDeviceConnections
(
MaemoRunConfiguration
*
mrc
,
bool
_connect
)
{
if
(
!
mrc
)
return
;
if
(
_connect
)
{
// handle device configuration changes
connect
(
mrc
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
connect
(
mrc
,
SIGNAL
(
deviceConfigurationsUpdated
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
}
else
{
disconnect
(
mrc
,
SIGNAL
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
disconnect
(
mrc
,
SIGNAL
(
deviceConfigurationsUpdated
(
ProjectExplorer
::
Target
*
)),
this
,
SLOT
(
deviceConfigurationChanged
(
ProjectExplorer
::
Target
*
)));
}
}
src/plugins/qt4projectmanager/qt-maemo/qemuruntimemanager.h
View file @
83edceaf
...
...
@@ -51,6 +51,7 @@ namespace ProjectExplorer {
namespace
Qt4ProjectManager
{
class
QtVersion
;
namespace
Internal
{
class
MaemoRunConfiguration
;
struct
Runtime
{
...
...
@@ -115,7 +116,7 @@ private:
bool
sessionHasMaemoTarget
()
const
;
void
updateStarterIcon
(
bool
running
);
void
to
o
gleStarterButton
(
ProjectExplorer
::
Target
*
target
);
void
to
g
gleStarterButton
(
ProjectExplorer
::
Target
*
target
);
bool
targetUsesRuntimeConfig
(
ProjectExplorer
::
Target
*
target
);
QString
maddeRoot
(
const
QString
&
qmake
)
const
;
...
...
@@ -124,6 +125,8 @@ private:
bool
fillRuntimeInformation
(
Runtime
*
runtime
)
const
;
QString
runtimeForQtVersion
(
const
QString
&
qmakeCommand
)
const
;
void
toggleDeviceConnections
(
MaemoRunConfiguration
*
mrc
,
bool
connect
);
private:
QAction
*
m_qemuAction
;
QProcess
*
m_qemuProcess
;
...
...
Write
Preview
Markdown
is supported
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