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
F
flatpak-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
Marco Bubke
flatpak-qt-creator
Commits
1ff13868
Commit
1ff13868
authored
Aug 11, 2010
by
ck
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Maemo: Add deployment via remote mount.
Only tested on Linux, #ifdef'ed for now.
parent
104f8495
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
371 additions
and
29 deletions
+371
-29
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
+300
-8
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h
+40
-2
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
...plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
+16
-11
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
+11
-5
src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp
src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp
+4
-3
No files found.
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.cpp
View file @
1ff13868
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qt-maemo/maemodeploystep.h
View file @
1ff13868
...
...
@@ -42,18 +42,28 @@
#include <QtCore/QPair>
#include <QtCore/QSharedPointer>
// #define DEPLOY_VIA_MOUNT
QT_BEGIN_NAMESPACE
class
QEventLoop
;
#ifdef DEPLOY_VIA_MOUNT
class
QTimer
;
#endif
QT_END_NAMESPACE
namespace
Core
{
#ifndef DEPLOY_VIA_MOUNT
class
SftpChannel
;
#endif
class
SshConnection
;
class
SshRemoteProcess
;
}
namespace
Qt4ProjectManager
{
namespace
Internal
{
#ifdef DEPLOY_VIA_MOUNT
class
MaemoRemoteMounter
;
#endif
class
MaemoDeployables
;
class
MaemoDeviceConfigListModel
;
class
MaemoPackageCreationStep
;
...
...
@@ -81,10 +91,19 @@ private slots:
void
stop
();
void
handleConnected
();
void
handleConnectionFailure
();
#ifdef DEPLOY_VIA_MOUNT
void
handleMounted
();
void
handleUnmounted
();
void
handleMountError
(
const
QString
&
errorMsg
);
void
handleProgressReport
(
const
QString
&
progressMsg
);
void
handleCopyProcessFinished
(
int
exitStatus
);
void
handleCleanupTimeout
();
#else
void
handleSftpChannelInitialized
();
void
handleSftpChannelInitializationFailed
(
const
QString
&
error
);
void
handleSftpJobFinished
(
Core
::
SftpJobId
job
,
const
QString
&
error
);
void
handleLinkProcessFinished
(
int
exitStatus
);
#endif
void
handleInstallationFinished
(
int
exitStatus
);
void
handleInstallerOutput
(
const
QByteArray
&
output
);
void
handleInstallerErrorOutput
(
const
QByteArray
&
output
);
...
...
@@ -105,20 +124,39 @@ private:
void
addDeployTimesToMap
(
QVariantMap
&
map
)
const
;
void
getDeployTimesFromMap
(
const
QVariantMap
&
map
);
const
MaemoPackageCreationStep
*
packagingStep
()
const
;
#ifdef DEPLOY_VIA_MOUNT
QString
deployMountPoint
()
const
;
void
deployNextFile
();
#else
bool
deploy
(
const
MaemoDeployable
&
deployable
);
#endif
#ifndef DEPLOY_VIA_MOUNT
QString
uploadDir
()
const
;
#endif
static
const
QLatin1String
Id
;
MaemoDeployables
*
const
m_deployables
;
QSharedPointer
<
Core
::
SshConnection
>
m_connection
;
#ifdef DEPLOY_VIA_MOUNT
typedef
QPair
<
MaemoDeployable
,
QSharedPointer
<
Core
::
SshRemoteProcess
>
>
DeployAction
;
QScopedPointer
<
DeployAction
>
m_currentDeployAction
;
QList
<
MaemoDeployable
>
m_filesToCopy
;
MaemoRemoteMounter
*
m_mounter
;
QTimer
*
m_cleanupTimer
;
bool
m_canStart
;
#else
QSharedPointer
<
Core
::
SftpChannel
>
m_uploader
;
QSharedPointer
<
Core
::
SshRemoteProcess
>
m_installer
;
typedef
QPair
<
MaemoDeployable
,
QString
>
DeployInfo
;
QMap
<
Core
::
SftpJobId
,
DeployInfo
>
m_uploadsInProgress
;
QMap
<
QSharedPointer
<
Core
::
SshRemoteProcess
>
,
MaemoDeployable
>
m_linksInProgress
;
bool
m_needsInstall
;
#endif
QSharedPointer
<
Core
::
SshRemoteProcess
>
m_installer
;
bool
m_stopped
;
bool
m_needsInstall
;
bool
m_connecting
;
typedef
QPair
<
MaemoDeployable
,
QString
>
DeployablePerHost
;
QHash
<
DeployablePerHost
,
QDateTime
>
m_lastDeployed
;
MaemoDeviceConfigListModel
*
m_deviceConfigModel
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.cpp
View file @
1ff13868
...
...
@@ -57,15 +57,15 @@ void MaemoRemoteMounter::setConnection(const Core::SshConnection::Ptr &connectio
m_connection
=
connection
;
}
void
MaemoRemoteMounter
::
addMountSpecification
(
const
MaemoMountSpecification
&
mountSpec
)
void
MaemoRemoteMounter
::
addMountSpecification
(
const
MaemoMountSpecification
&
mountSpec
,
bool
mountAsRoot
)
{
if
(
mountSpec
.
isValid
())
m_mountSpecs
<<
mountSpec
;
m_mountSpecs
<<
MountInfo
(
mountSpec
,
mountAsRoot
)
;
}
void
MaemoRemoteMounter
::
mount
(
const
MaemoDeviceConfig
&
devConfig
)
void
MaemoRemoteMounter
::
mount
()
{
m_devConfig
=
devConfig
;
m_stop
=
false
;
Q_ASSERT
(
m_utfsServers
.
isEmpty
());
...
...
@@ -87,7 +87,7 @@ void MaemoRemoteMounter::unmount()
for
(
int
i
=
0
;
i
<
m_mountSpecs
.
count
();
++
i
)
{
remoteCall
+=
QString
::
fromLocal8Bit
(
"%1 umount %2;"
)
.
arg
(
MaemoGlobal
::
remoteSudo
(),
m_mountSpecs
.
at
(
i
).
remoteMountPoint
);
m_mountSpecs
.
at
(
i
).
mountSpec
.
remoteMountPoint
);
}
emit
reportProgress
(
tr
(
"Unmounting remote mount points..."
));
...
...
@@ -127,6 +127,7 @@ void MaemoRemoteMounter::handleUnmountProcessFinished(int exitStatus)
utfsServer
->
kill
();
}
m_mountSpecs
.
clear
();
m_utfsServers
.
clear
();
if
(
errorMsg
.
isEmpty
())
{
emit
reportProgress
(
tr
(
"Finished unmounting."
));
...
...
@@ -222,15 +223,17 @@ void MaemoRemoteMounter::startUtfsClients()
const
QLatin1String
andOp
(
" && "
);
QString
remoteCall
=
chmodFuse
+
andOp
+
chmodUtfsClient
;
for
(
int
i
=
0
;
i
<
m_mountSpecs
.
count
();
++
i
)
{
const
MaemoMountSpecification
&
mountSpec
=
m_mountSpecs
.
at
(
i
);
const
MaemoMountSpecification
&
mountSpec
=
m_mountSpecs
.
at
(
i
)
.
mountSpec
;
const
QString
mkdir
=
QString
::
fromLocal8Bit
(
"%1 mkdir -p %2"
)
.
arg
(
MaemoGlobal
::
remoteSudo
(),
mountSpec
.
remoteMountPoint
);
const
QString
chmod
=
QString
::
fromLocal8Bit
(
"%1 chmod a+r+w+x %2"
)
.
arg
(
MaemoGlobal
::
remoteSudo
(),
mountSpec
.
remoteMountPoint
);
const
QString
utfsClient
QString
utfsClient
=
QString
::
fromLocal8Bit
(
"%1 -l %2 -r %2 -b %2 %4"
)
.
arg
(
utfsClientOnDevice
()).
arg
(
mountSpec
.
remotePort
)
.
arg
(
mountSpec
.
remoteMountPoint
);
if
(
m_mountSpecs
.
at
(
i
).
mountAsRoot
)
utfsClient
.
prepend
(
MaemoGlobal
::
remoteSudo
()
+
QLatin1Char
(
' '
));
remoteCall
+=
andOp
+
mkdir
+
andOp
+
chmod
+
andOp
+
utfsClient
;
}
...
...
@@ -287,14 +290,15 @@ void MaemoRemoteMounter::startUtfsServers()
{
emit
reportProgress
(
tr
(
"Starting UTFS servers..."
));
for
(
int
i
=
0
;
i
<
m_mountSpecs
.
count
();
++
i
)
{
const
MaemoMountSpecification
&
mountSpec
=
m_mountSpecs
.
at
(
i
);
const
MaemoMountSpecification
&
mountSpec
=
m_mountSpecs
.
at
(
i
)
.
mountSpec
;
const
ProcPtr
utfsServerProc
(
new
QProcess
);
const
QString
port
=
QString
::
number
(
mountSpec
.
remotePort
);
const
QString
localSecretOpt
=
QLatin1String
(
"-l"
);
const
QString
remoteSecretOpt
=
QLatin1String
(
"-r"
);
const
QStringList
utfsServerArgs
=
QStringList
()
<<
localSecretOpt
<<
port
<<
remoteSecretOpt
<<
port
<<
QLatin1String
(
"-c"
)
<<
(
m_devConfig
.
server
.
host
+
QLatin1Char
(
':'
)
+
port
)
const
QStringList
utfsServerArgs
=
QStringList
()
<<
QLatin1String
(
"--detach"
)
<<
localSecretOpt
<<
port
<<
remoteSecretOpt
<<
port
<<
QLatin1String
(
"-c"
)
<<
(
m_connection
->
connectionParameters
().
host
+
QLatin1Char
(
':'
)
+
port
)
<<
mountSpec
.
localDir
;
utfsServerProc
->
start
(
utfsServer
(),
utfsServerArgs
);
if
(
!
utfsServerProc
->
waitForStarted
())
{
...
...
@@ -309,6 +313,7 @@ void MaemoRemoteMounter::startUtfsServers()
emit
error
(
errorMsg
);
return
;
}
utfsServerProc
->
waitForFinished
();
m_utfsServers
<<
utfsServerProc
;
}
...
...
src/plugins/qt4projectmanager/qt-maemo/maemoremotemounter.h
View file @
1ff13868
...
...
@@ -30,7 +30,6 @@
#ifndef MAEMOREMOTEMOUNTER_H
#define MAEMOREMOTEMOUNTER_H
#include "maemodeviceconfigurations.h"
#include "maemomountspecification.h"
#include <coreplugin/ssh/sftpdefs.h>
...
...
@@ -58,8 +57,9 @@ class MaemoRemoteMounter : public QObject
public:
MaemoRemoteMounter
(
QObject
*
parent
,
const
MaemoToolChain
*
toolchain
);
~
MaemoRemoteMounter
();
void
addMountSpecification
(
const
MaemoMountSpecification
&
mountSpec
);
void
mount
(
const
MaemoDeviceConfig
&
devConfig
);
void
addMountSpecification
(
const
MaemoMountSpecification
&
mountSpec
,
bool
mountAsRoot
);
void
mount
();
void
unmount
();
void
stop
();
...
...
@@ -90,10 +90,16 @@ private:
QString
utfsServer
()
const
;
const
MaemoToolChain
*
const
m_toolChain
;
MaemoDeviceConfig
m_devConfig
;
struct
MountInfo
{
MountInfo
(
const
MaemoMountSpecification
&
m
,
bool
root
)
:
mountSpec
(
m
),
mountAsRoot
(
root
)
{}
MaemoMountSpecification
mountSpec
;
bool
mountAsRoot
;
};
QSharedPointer
<
Core
::
SshConnection
>
m_connection
;
QList
<
M
aemoMountSpecification
>
m_mountSpecs
;
QList
<
M
ountInfo
>
m_mountSpecs
;
QSharedPointer
<
Core
::
SftpChannel
>
m_utfsClientUploader
;
QSharedPointer
<
Core
::
SshRemoteProcess
>
m_mountProcess
;
QSharedPointer
<
Core
::
SshRemoteProcess
>
m_unmountProcess
;
...
...
src/plugins/qt4projectmanager/qt-maemo/maemosshrunner.cpp
View file @
1ff13868
...
...
@@ -197,14 +197,15 @@ void MaemoSshRunner::handleUnmounted()
const
MaemoRemoteMountsModel
*
const
remoteMounts
=
m_runConfig
->
remoteMounts
();
for
(
int
i
=
0
;
i
<
remoteMounts
->
mountSpecificationCount
();
++
i
)
m_mounter
->
addMountSpecification
(
remoteMounts
->
mountSpecificationAt
(
i
));
m_mounter
->
addMountSpecification
(
remoteMounts
->
mountSpecificationAt
(
i
),
false
);
if
(
m_debugging
&&
m_runConfig
->
useRemoteGdb
())
{
m_mounter
->
addMountSpecification
(
MaemoMountSpecification
(
m_runConfig
->
localDirToMountForRemoteGdb
(),
MaemoGlobal
::
remoteProjectSourcesMountPoint
(),
m_devConfig
.
debuggingPort
));
m_devConfig
.
debuggingPort
)
,
false
);
}
m_mounter
->
mount
(
m_devConfig
);
m_mounter
->
mount
();
}
void
MaemoSshRunner
::
handleMounted
()
...
...
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