Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Q
qt-creator
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Tobias Hunger
qt-creator
Commits
2a9ca651
Commit
2a9ca651
authored
Dec 01, 2009
by
kh1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Workaround for windows deployment.
SCP chokes on full path names, thus set the wd to the delploy dir.
parent
56ded78d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
46 additions
and
26 deletions
+46
-26
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
...gins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
+46
-26
No files found.
src/plugins/qt4projectmanager/qt-maemo/maemorunconfiguration.cpp
View file @
2a9ca651
...
...
@@ -47,6 +47,8 @@
#include <projectexplorer/session.h>
#include <QtCore/QDebug>
#include <QtCore/QPair>
#include <QtCore/QProcess>
#include <QtCore/QSharedPointer>
...
...
@@ -104,6 +106,7 @@ public:
protected:
void
startDeployment
(
bool
forDebugging
);
void
deploy
();
void
stopDeployment
();
bool
isDeploying
()
const
;
const
QString
executableOnHost
()
const
;
...
...
@@ -123,14 +126,13 @@ private slots:
protected:
ErrorDumper
dumper
;
MaemoRunConfiguration
*
runConfig
;
// TODO this pointer can be invalid
const
MaemoDeviceConfigurations
::
DeviceConfig
devConfig
;
private:
QProcess
deployProcess
;
bool
deployingExecutable
;
bool
deployingDumperLib
;
protected:
const
MaemoDeviceConfigurations
::
DeviceConfig
devConfig
;
QList
<
QPair
<
QString
,
QString
>
>
deployables
;
};
class
MaemoRunControl
:
public
AbstractMaemoRunControl
...
...
@@ -405,7 +407,8 @@ const QString MaemoRunConfiguration::cmd(const QString &cmdName) const
const
MaemoToolChain
*
MaemoRunConfiguration
::
toolchain
()
const
{
Qt4BuildConfiguration
*
qt4bc
=
qobject_cast
<
Qt4BuildConfiguration
*>
(
project
()
->
activeBuildConfiguration
());
Qt4BuildConfiguration
*
qt4bc
=
qobject_cast
<
Qt4BuildConfiguration
*>
(
project
()
->
activeBuildConfiguration
());
QTC_ASSERT
(
qt4bc
,
return
0
);
MaemoToolChain
*
tc
=
dynamic_cast
<
MaemoToolChain
*>
(
qt4bc
->
toolChain
()
);
...
...
@@ -1033,30 +1036,42 @@ AbstractMaemoRunControl::AbstractMaemoRunControl(RunConfiguration *rc)
void
AbstractMaemoRunControl
::
startDeployment
(
bool
forDebugging
)
{
QTC_ASSERT
(
runConfig
,
return
);
if
(
!
devConfig
.
isValid
())
{
deploymentFinished
(
false
);
return
;
}
QStringList
deployables
;
if
(
runConfig
->
currentlyNeedsDeployment
())
{
deployingExecutable
=
true
;
deployables
<<
executableFileName
();
}
else
{
deployingExecutable
=
false
;
}
if
(
forDebugging
&&
runConfig
->
debuggingHelpersNeedDeployment
())
{
deployables
<<
runConfig
->
dumperLib
();
deployingDumperLib
=
true
;
if
(
devConfig
.
isValid
())
{
deployables
.
clear
();
if
(
runConfig
->
currentlyNeedsDeployment
())
{
deployingExecutable
=
true
;
deployables
.
append
(
qMakePair
(
executableFileName
(),
QFileInfo
(
executableOnHost
()).
canonicalPath
()));
}
else
{
deployingExecutable
=
false
;
}
if
(
forDebugging
&&
runConfig
->
debuggingHelpersNeedDeployment
())
{
deployingDumperLib
=
true
;
const
QFileInfo
&
info
(
runConfig
->
dumperLib
());
deployables
.
append
(
qMakePair
(
info
.
fileName
(),
info
.
canonicalPath
()));
}
else
{
deployingDumperLib
=
false
;
}
deploy
();
}
else
{
deploy
ingDumperLib
=
false
;
deploy
mentFinished
(
false
)
;
}
}
void
AbstractMaemoRunControl
::
deploy
()
{
if
(
!
deployables
.
isEmpty
())
{
emit
addToOutputWindow
(
this
,
tr
(
"Files to deploy: %1."
)
.
arg
(
deployables
.
join
(
" "
)));
QPair
<
QString
,
QString
>
pair
=
deployables
.
at
(
0
);
emit
addToOutputWindow
(
this
,
tr
(
"File to deploy: %1."
).
arg
(
pair
.
first
));
QStringList
cmdArgs
;
cmdArgs
<<
"-P"
<<
port
()
<<
options
()
<<
deployables
<<
(
devConfig
.
uname
+
"@"
+
devConfig
.
host
+
":"
+
remoteDir
());
deployProcess
.
setWorkingDirectory
(
QFileInfo
(
executableOnHost
()).
absolutePath
());
cmdArgs
<<
"-P"
<<
port
()
<<
options
()
<<
pair
.
first
<<
(
devConfig
.
uname
+
"@"
+
devConfig
.
host
+
":"
+
remoteDir
());
deployProcess
.
setWorkingDirectory
(
QFileInfo
(
pair
.
second
).
absolutePath
());
deployProcess
.
start
(
runConfig
->
scpCmd
(),
cmdArgs
);
if
(
!
deployProcess
.
waitForStarted
())
{
emit
error
(
this
,
tr
(
"Could not start scp. Deployment failed."
));
...
...
@@ -1089,11 +1104,15 @@ void AbstractMaemoRunControl::deployProcessFinished()
runConfig
->
wasDeployed
();
if
(
deployingDumperLib
)
runConfig
->
debuggingHelpersDeployed
();
deployables
.
removeFirst
();
}
else
{
emit
error
(
this
,
tr
(
"Deployment failed."
));
success
=
false
;
}
deploymentFinished
(
success
);
if
(
deployables
.
isEmpty
()
||
!
success
)
deploymentFinished
(
success
);
else
deploy
();
}
const
QString
AbstractMaemoRunControl
::
executableOnHost
()
const
...
...
@@ -1146,7 +1165,8 @@ const QString AbstractMaemoRunControl::targetCmdLinePrefix() const
bool
AbstractMaemoRunControl
::
setProcessEnvironment
(
QProcess
&
process
)
{
QTC_ASSERT
(
runConfig
,
return
false
);
Qt4BuildConfiguration
*
qt4bc
=
qobject_cast
<
Qt4BuildConfiguration
*>
(
runConfig
->
project
()
->
activeBuildConfiguration
());
Qt4BuildConfiguration
*
qt4bc
=
qobject_cast
<
Qt4BuildConfiguration
*>
(
runConfig
->
project
()
->
activeBuildConfiguration
());
QTC_ASSERT
(
qt4bc
,
return
false
);
Environment
env
=
Environment
::
systemEnvironment
();
qt4bc
->
toolChain
()
->
addToEnvironment
(
env
);
...
...
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