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
e79f6031
Commit
e79f6031
authored
Jan 11, 2011
by
Christian Kandeler
Browse files
Maemo: Prepare for possibility of our deploy step disappearing.
Could happen e.g. when RDA is used.
parent
d8d038da
Changes
8
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemodeployables.cpp
View file @
e79f6031
...
...
@@ -55,8 +55,8 @@
namespace
Qt4ProjectManager
{
namespace
Internal
{
MaemoDeployables
::
MaemoDeployables
(
const
ProjectExplorer
::
BuildStep
*
buildStep
)
:
m_
buildStep
(
buildStep
),
m_updateTimer
(
new
QTimer
(
this
))
MaemoDeployables
::
MaemoDeployables
(
const
Qt4Target
*
target
)
:
m_
target
(
target
),
m_updateTimer
(
new
QTimer
(
this
))
{
QTimer
::
singleShot
(
0
,
this
,
SLOT
(
init
()));
m_updateTimer
->
setInterval
(
1500
);
...
...
@@ -67,7 +67,7 @@ MaemoDeployables::~MaemoDeployables() {}
void
MaemoDeployables
::
init
()
{
Qt4Project
*
pro
=
qt4BuildConfiguration
()
->
qt4T
arget
()
->
qt4Project
();
Qt4Project
*
const
pro
=
m_t
arget
->
qt4Project
();
connect
(
pro
,
SIGNAL
(
proFileUpdated
(
Qt4ProjectManager
::
Internal
::
Qt4ProFileNode
*
,
bool
)),
m_updateTimer
,
SLOT
(
start
()));
...
...
@@ -78,16 +78,14 @@ void MaemoDeployables::init()
void
MaemoDeployables
::
createModels
()
{
if
(
!
qt4BuildConfiguration
()
||
!
qt4BuildConfiguration
()
->
qt4Target
()
||
qt4BuildConfiguration
()
->
qt4Target
()
->
project
()
->
activeTarget
()
->
id
()
!=
QLatin1String
(
Qt4ProjectManager
::
Constants
::
MAEMO_DEVICE_TARGET_ID
))
if
(
m_target
->
project
()
->
activeTarget
()
!=
m_target
)
return
;
const
Qt4ProFileNode
*
const
rootNode
=
qt4BuildConfiguration
()
->
qt4T
arget
()
->
qt4Project
()
->
rootProjectNode
();
=
m_t
arget
->
qt4Project
()
->
rootProjectNode
();
if
(
!
rootNode
)
// Happens on project creation by wizard.
return
;
m_updateTimer
->
stop
();
disconnect
(
qt4BuildConfiguration
()
->
qt4T
arget
()
->
qt4Project
(),
disconnect
(
m_t
arget
->
qt4Project
(),
SIGNAL
(
proFileUpdated
(
Qt4ProjectManager
::
Internal
::
Qt4ProFileNode
*
,
bool
)),
m_updateTimer
,
SLOT
(
start
()));
beginResetModel
();
...
...
@@ -119,7 +117,7 @@ void MaemoDeployables::createModels()
}
endResetModel
();
connect
(
qt4BuildConfiguration
()
->
qt4T
arget
()
->
qt4Project
(),
connect
(
m_t
arget
->
qt4Project
(),
SIGNAL
(
proFileUpdated
(
Qt4ProjectManager
::
Internal
::
Qt4ProFileNode
*
,
bool
)),
m_updateTimer
,
SLOT
(
start
()));
}
...
...
@@ -201,13 +199,6 @@ QString MaemoDeployables::remoteExecutableFilePath(const QString &localExecutabl
return
QString
();
}
const
Qt4BuildConfiguration
*
MaemoDeployables
::
qt4BuildConfiguration
()
const
{
const
Qt4BuildConfiguration
*
const
bc
=
qobject_cast
<
Qt4BuildConfiguration
*>
(
m_buildStep
->
target
()
->
activeBuildConfiguration
());
return
bc
;
}
int
MaemoDeployables
::
rowCount
(
const
QModelIndex
&
parent
)
const
{
return
parent
.
isValid
()
?
0
:
modelCount
();
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeployables.h
View file @
e79f6031
...
...
@@ -51,10 +51,9 @@
QT_FORWARD_DECLARE_CLASS
(
QTimer
)
namespace
ProjectExplorer
{
class
BuildStep
;
}
namespace
Qt4ProjectManager
{
class
Qt4BuildConfiguration
;
class
Qt4Target
;
namespace
Internal
{
class
Qt4ProFileNode
;
...
...
@@ -63,7 +62,7 @@ class MaemoDeployables : public QAbstractListModel
{
Q_OBJECT
public:
MaemoDeployables
(
const
ProjectExplorer
::
BuildStep
*
buildStep
);
MaemoDeployables
(
const
Qt4Target
*
target
);
~
MaemoDeployables
();
void
setUnmodified
();
bool
isModified
()
const
;
...
...
@@ -72,7 +71,6 @@ public:
QString
remoteExecutableFilePath
(
const
QString
&
localExecutableFilePath
)
const
;
int
modelCount
()
const
{
return
m_listModels
.
count
();
}
MaemoDeployableListModel
*
modelAt
(
int
i
)
const
{
return
m_listModels
.
at
(
i
);
}
const
ProjectExplorer
::
BuildStep
*
buildStep
()
const
{
return
m_buildStep
;
}
private:
typedef
QHash
<
QString
,
MaemoDeployableListModel
::
ProFileUpdateSetting
>
UpdateSettingsMap
;
...
...
@@ -83,11 +81,10 @@ private:
Q_SLOT
void
createModels
();
Q_SLOT
void
init
();
void
createModels
(
const
Qt4ProFileNode
*
proFileNode
);
const
Qt4BuildConfiguration
*
qt4BuildConfiguration
()
const
;
QList
<
MaemoDeployableListModel
*>
m_listModels
;
UpdateSettingsMap
m_updateSettings
;
const
ProjectExplorer
::
BuildStep
*
const
m_
buildStep
;
const
Qt4Target
*
const
m_
target
;
QTimer
*
const
m_updateTimer
;
};
...
...
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
View file @
e79f6031
...
...
@@ -52,6 +52,7 @@
#include
<projectexplorer/target.h>
#include
<qt4projectmanager/qt4buildconfiguration.h>
#include
<qt4projectmanager/qt4target.h>
#include
<QtCore/QCoreApplication>
#include
<QtCore/QDir>
...
...
@@ -96,7 +97,9 @@ void MaemoDeployStep::ctor()
const
QList
<
DeployConfiguration
*>
&
deployConfigs
=
target
()
->
deployConfigurations
();
if
(
deployConfigs
.
isEmpty
())
{
m_deployables
=
QSharedPointer
<
MaemoDeployables
>
(
new
MaemoDeployables
(
this
));
const
Qt4Target
*
const
qt4Target
=
qobject_cast
<
Qt4Target
*>
(
target
());
Q_ASSERT
(
qt4Target
);
m_deployables
=
QSharedPointer
<
MaemoDeployables
>
(
new
MaemoDeployables
(
qt4Target
));
}
else
{
const
MaemoDeployStep
*
const
other
=
MaemoGlobal
::
buildStep
<
MaemoDeployStep
>
(
deployConfigs
.
first
());
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoglobal.h
View file @
e79f6031
...
...
@@ -97,6 +97,8 @@ public:
template
<
class
T
>
static
T
*
buildStep
(
const
ProjectExplorer
::
DeployConfiguration
*
dc
)
{
if
(
!
dc
)
return
0
;
ProjectExplorer
::
BuildStepList
*
bsl
=
dc
->
stepList
();
if
(
!
bsl
)
return
0
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
View file @
e79f6031
...
...
@@ -213,7 +213,8 @@ QString MaemoRunConfiguration::defaultDisplayName()
MaemoDeviceConfig
MaemoRunConfiguration
::
deviceConfig
()
const
{
return
deployStep
()
->
deviceConfigModel
()
->
current
();
const
MaemoDeployStep
*
const
step
=
deployStep
();
return
step
?
step
->
deviceConfigModel
()
->
current
()
:
MaemoDeviceConfig
();
}
const
MaemoToolChain
*
MaemoRunConfiguration
::
toolchain
()
const
...
...
@@ -232,11 +233,7 @@ const QString MaemoRunConfiguration::gdbCmd() const
MaemoDeployStep
*
MaemoRunConfiguration
::
deployStep
()
const
{
MaemoDeployStep
*
const
step
=
MaemoGlobal
::
buildStep
<
MaemoDeployStep
>
(
target
()
->
activeDeployConfiguration
());
Q_ASSERT_X
(
step
,
Q_FUNC_INFO
,
"Impossible: Maemo build configuration without deploy step."
);
return
step
;
return
MaemoGlobal
::
buildStep
<
MaemoDeployStep
>
(
target
()
->
activeDeployConfiguration
());
}
const
QString
MaemoRunConfiguration
::
sysRoot
()
const
...
...
@@ -302,8 +299,10 @@ QString MaemoRunConfiguration::localExecutableFilePath() const
QString
MaemoRunConfiguration
::
remoteExecutableFilePath
()
const
{
return
deployStep
()
->
deployables
()
->
remoteExecutableFilePath
(
localExecutableFilePath
());
const
MaemoDeployStep
*
const
step
=
deployStep
();
return
step
?
step
->
deployables
()
->
remoteExecutableFilePath
(
localExecutableFilePath
())
:
QString
();
}
MaemoPortList
MaemoRunConfiguration
::
freePorts
()
const
...
...
@@ -381,6 +380,7 @@ void MaemoRunConfiguration::handleDeployConfigChanged()
}
}
updateDeviceConfigurations
();
updateFactoryState
();
}
QString
MaemoRunConfiguration
::
baseEnvironmentText
()
const
...
...
src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.cpp
View file @
e79f6031
...
...
@@ -79,7 +79,8 @@ MaemoRunConfigurationWidget::MaemoRunConfigurationWidget(
:
QWidget
(
parent
),
m_runConfiguration
(
runConfiguration
),
m_ignoreChange
(
false
),
m_deviceEnvReader
(
new
MaemoDeviceEnvReader
(
this
,
runConfiguration
))
m_deviceEnvReader
(
new
MaemoDeviceEnvReader
(
this
,
runConfiguration
)),
m_deployablesConnected
(
false
)
{
m_lastActiveBuildConfig
=
m_runConfiguration
->
activeQt4BuildConfiguration
();
QVBoxLayout
*
mainLayout
=
new
QVBoxLayout
;
...
...
@@ -172,9 +173,10 @@ void MaemoRunConfigurationWidget::addGenericWidgets(QVBoxLayout *mainLayout)
SLOT
(
handleDebuggingTypeChanged
()));
connect
(
m_runConfiguration
,
SIGNAL
(
targetInformationChanged
()),
this
,
SLOT
(
updateTargetInformation
()));
connect
(
m_runConfiguration
->
deployStep
()
->
deployables
().
data
(),
SIGNAL
(
modelReset
()),
this
,
SLOT
(
handleDeploySpecsChanged
()));
handleDeploySpecsChanged
();
connect
(
m_runConfiguration
->
target
(),
SIGNAL
(
activeDeployConfigurationChanged
(
ProjectExplorer
::
DeployConfiguration
*
)),
SLOT
(
handleActiveDeployConfigurationChanged
()));
handleActiveDeployConfigurationChanged
();
}
void
MaemoRunConfigurationWidget
::
addDebuggingWidgets
(
QVBoxLayout
*
mainLayout
)
...
...
@@ -302,6 +304,24 @@ void MaemoRunConfigurationWidget::updateTargetInformation()
->
setText
(
QDir
::
toNativeSeparators
(
m_runConfiguration
->
localExecutableFilePath
()));
}
void
MaemoRunConfigurationWidget
::
handleActiveDeployConfigurationChanged
()
{
if
(
m_deployablesConnected
)
return
;
MaemoDeployStep
*
const
deployStep
=
m_runConfiguration
->
deployStep
();
if
(
!
deployStep
)
return
;
connect
(
deployStep
->
deployables
().
data
(),
SIGNAL
(
modelReset
()),
SLOT
(
handleDeploySpecsChanged
()));
handleDeploySpecsChanged
();
m_deployablesConnected
=
true
;
disconnect
(
m_runConfiguration
->
target
(),
SIGNAL
(
activeDeployConfigurationChanged
(
ProjectExplorer
::
DeployConfiguration
*
)),
this
,
SLOT
(
handleActiveDeployConfigurationChanged
()));
}
void
MaemoRunConfigurationWidget
::
handleDeploySpecsChanged
()
{
m_remoteExecutableLabel
->
setText
(
m_runConfiguration
->
remoteExecutableFilePath
());
...
...
src/plugins/qt4projectmanager/qt-maemo/maemorunconfigurationwidget.h
View file @
e79f6031
...
...
@@ -98,6 +98,7 @@ private slots:
void
handleDeploySpecsChanged
();
void
handleBuildConfigChanged
();
void
handleToolchainChanged
();
void
handleActiveDeployConfigurationChanged
();
private:
void
addGenericWidgets
(
QVBoxLayout
*
mainLayout
);
...
...
@@ -127,6 +128,7 @@ private:
MaemoDeviceEnvReader
*
m_deviceEnvReader
;
ProjectExplorer
::
EnvironmentWidget
*
m_environmentWidget
;
Qt4BuildConfiguration
*
m_lastActiveBuildConfig
;
bool
m_deployablesConnected
;
};
}
// namespace Internal
...
...
src/plugins/qt4projectmanager/qt-maemo/maemorunfactories.cpp
View file @
e79f6031
...
...
@@ -163,7 +163,8 @@ bool MaemoRunControlFactory::canRun(RunConfiguration *runConfiguration,
{
const
MaemoRunConfiguration
*
const
maemoRunConfig
=
qobject_cast
<
MaemoRunConfiguration
*>
(
runConfiguration
);
if
(
!
maemoRunConfig
||
!
maemoRunConfig
->
deviceConfig
().
isValid
()
if
(
!
maemoRunConfig
||
!
maemoRunConfig
->
deviceConfig
().
isValid
()
||
!
maemoRunConfig
->
toolchain
()
||
maemoRunConfig
->
remoteExecutableFilePath
().
isEmpty
())
return
false
;
...
...
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