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
781bdd24
Commit
781bdd24
authored
Apr 13, 2010
by
ck
Browse files
Maemo: Don't run program if deployment has been canceled by user.
Reviewed-by: kh1
parent
e9be9a0d
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.cpp
View file @
781bdd24
...
...
@@ -68,11 +68,25 @@ AbstractMaemoRunControl::~AbstractMaemoRunControl()
{
}
void
AbstractMaemoRunControl
::
start
()
{
m_stoppedByUser
=
false
;
startInternal
();
}
void
AbstractMaemoRunControl
::
stop
()
{
m_stoppedByUser
=
true
;
stopInternal
();
}
void
AbstractMaemoRunControl
::
startDeployment
(
bool
forDebugging
)
{
QTC_ASSERT
(
runConfig
,
return
);
if
(
devConfig
.
isValid
())
{
if
(
m_stoppedByUser
)
{
handleDeploymentFinished
(
false
);
}
else
if
(
devConfig
.
isValid
())
{
m_deployables
.
clear
();
if
(
runConfig
->
currentlyNeedsDeployment
(
devConfig
.
host
))
{
m_deployables
.
append
(
Deployable
(
executableFileName
(),
...
...
@@ -184,14 +198,17 @@ void AbstractMaemoRunControl::kill(const QStringList &apps)
void
AbstractMaemoRunControl
::
deployProcessFinished
()
{
const
bool
success
=
!
m_sshDeployer
->
hasError
();
if
(
success
)
{
if
(
m_stoppedByUser
)
{
emit
addToOutputWindow
(
this
,
tr
(
"Deployment canceled by user."
));
m_progress
.
reportCanceled
();
}
else
if
(
success
)
{
emit
addToOutputWindow
(
this
,
tr
(
"Deployment finished."
));
}
else
{
handleError
(
tr
(
"Deployment failed: %1"
).
arg
(
m_sshDeployer
->
error
()));
m_progress
.
reportCanceled
();
}
m_progress
.
reportFinished
();
handleDeploymentFinished
(
success
);
handleDeploymentFinished
(
success
&&
!
m_stoppedByUser
);
}
const
QString
AbstractMaemoRunControl
::
executableOnHost
()
const
...
...
@@ -264,9 +281,8 @@ MaemoRunControl::~MaemoRunControl()
stop
();
}
void
MaemoRunControl
::
start
()
void
MaemoRunControl
::
start
Internal
()
{
m_stoppedByUser
=
false
;
startDeployment
(
false
);
}
...
...
@@ -310,12 +326,10 @@ void MaemoRunControl::executionFinished()
emit
finished
();
}
void
MaemoRunControl
::
stop
()
void
MaemoRunControl
::
stop
Internal
()
{
if
(
!
isRunning
())
return
;
m_stoppedByUser
=
true
;
if
(
isDeploying
())
{
stopDeployment
();
}
else
{
...
...
@@ -362,7 +376,7 @@ MaemoDebugRunControl::~MaemoDebugRunControl()
debuggingFinished
();
}
void
MaemoDebugRunControl
::
start
()
void
MaemoDebugRunControl
::
start
Internal
()
{
startDeployment
(
true
);
}
...
...
@@ -430,7 +444,7 @@ void MaemoDebugRunControl::startDebugging()
m_debuggerManager
->
startNewDebugger
(
m_startParams
);
}
void
MaemoDebugRunControl
::
stop
()
void
MaemoDebugRunControl
::
stop
Internal
()
{
if
(
!
isRunning
())
return
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoruncontrol.h
View file @
781bdd24
...
...
@@ -68,6 +68,8 @@ public:
protected:
virtual
bool
isRunning
()
const
;
virtual
void
start
();
virtual
void
stop
();
void
startDeployment
(
bool
forDebugging
);
void
deploy
();
...
...
@@ -90,8 +92,11 @@ private slots:
protected:
MaemoRunConfiguration
*
runConfig
;
// TODO this pointer can be invalid
const
MaemoDeviceConfig
devConfig
;
bool
m_stoppedByUser
;
private:
virtual
void
startInternal
()
=
0
;
virtual
void
stopInternal
()
=
0
;
virtual
void
handleDeploymentFinished
(
bool
success
)
=
0
;
virtual
void
handleExecutionAboutToStart
(
const
MaemoSshRunner
*
runner
)
=
0
;
void
kill
(
const
QStringList
&
apps
);
...
...
@@ -119,19 +124,17 @@ class MaemoRunControl : public AbstractMaemoRunControl
public:
explicit
MaemoRunControl
(
ProjectExplorer
::
RunConfiguration
*
runConfiguration
);
~
MaemoRunControl
();
void
start
();
void
stop
();
private
slots
:
void
executionFinished
();
void
handleRemoteOutput
(
const
QString
&
output
);
private:
virtual
void
startInternal
();
virtual
void
stopInternal
();
virtual
void
handleDeploymentFinished
(
bool
success
);
virtual
void
handleExecutionAboutToStart
(
const
MaemoSshRunner
*
runner
);
void
startExecution
();
bool
m_stoppedByUser
;
};
class
MaemoDebugRunControl
:
public
AbstractMaemoRunControl
...
...
@@ -140,16 +143,16 @@ class MaemoDebugRunControl : public AbstractMaemoRunControl
public:
explicit
MaemoDebugRunControl
(
ProjectExplorer
::
RunConfiguration
*
runConfiguration
);
~
MaemoDebugRunControl
();
void
start
();
void
stop
();
bool
isRunning
()
const
;
Q_SLOT
void
debuggingFinished
();
private
slots
:
void
gdbServerStarted
(
const
QString
&
output
);
void
debuggerOutput
(
const
QString
&
output
);
void
debuggingFinished
();
private:
virtual
void
startInternal
();
virtual
void
stopInternal
();
virtual
void
handleDeploymentFinished
(
bool
success
);
virtual
void
handleExecutionAboutToStart
(
const
MaemoSshRunner
*
runner
);
...
...
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