Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qt-creator
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Tobias Hunger
qt-creator
Commits
77b59b02
Commit
77b59b02
authored
15 years ago
by
ck
Browse files
Options
Downloads
Patches
Plain Diff
Maemo: Implement sftp file transfer (untested).
parent
19f1df4f
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
+25
-6
25 additions, 6 deletions
...plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h
+5
-1
5 additions, 1 deletion
src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h
with
30 additions
and
7 deletions
src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.cpp
+
25
−
6
View file @
77b59b02
...
...
@@ -47,8 +47,10 @@
#include
"/opt/ne7ssh/include/ne7ssh.h"
#include
<QtCore/QMutex>
#include
<QtCore/QMutexLocker>
#include
<QtCore/QStringBuilder>
#include
<QtCore/QStringList>
#include
<cstdio>
namespace
Qt4ProjectManager
{
namespace
Internal
{
...
...
@@ -134,9 +136,12 @@ MaemoInteractiveSshConnection::Ptr MaemoInteractiveSshConnection::create(const M
}
MaemoSftpConnection
::
MaemoSftpConnection
(
const
MaemoDeviceConfig
&
devConf
)
:
MaemoSshConnection
(
devConf
,
false
)
:
MaemoSshConnection
(
devConf
,
false
),
sftp
(
new
Ne7SftpSubsystem
)
{
// TODO: Initialize sftp subsystem
if
(
!
ssh
.
initSftp
(
*
sftp
,
channel
())
||
!
sftp
->
setTimeout
(
devConf
.
timeout
))
throw
MaemoSshException
(
tr
(
"Error setting up SFTP subsystem: %1"
)
.
arg
(
lastError
()));
}
MaemoSftpConnection
::~
MaemoSftpConnection
()
...
...
@@ -147,7 +152,22 @@ MaemoSftpConnection::~MaemoSftpConnection()
void
MaemoSftpConnection
::
transferFiles
(
const
QStringList
&
filePaths
,
const
QStringList
&
targetDirs
)
{
Q_ASSERT
(
filePaths
.
count
()
==
targetDirs
.
count
());
for
(
int
i
=
0
;
i
<
filePaths
.
count
();
++
i
)
{
const
QString
&
curFile
=
filePaths
.
at
(
i
);
QSharedPointer
<
FILE
>
filePtr
(
fopen
(
curFile
.
toLatin1
().
data
(),
"rb"
),
&
std
::
fclose
);
if
(
filePtr
.
isNull
())
throw
MaemoSshException
(
tr
(
"Could not open file '%1'"
).
arg
(
curFile
));
const
QString
&
targetFile
=
targetDirs
.
at
(
i
)
%
QLatin1String
(
"/"
)
%
curFile
;
if
(
!
sftp
->
put
(
filePtr
.
data
(),
targetFile
.
toLatin1
().
data
()))
{
const
QString
&
error
=
tr
(
"Could not copy local file '%1' "
"to remote file '%2': %3"
).
arg
(
curFile
,
targetFile
)
.
arg
(
lastError
());
throw
MaemoSshException
(
error
);
}
}
}
MaemoSftpConnection
::
Ptr
MaemoSftpConnection
::
create
(
const
MaemoDeviceConfig
&
devConf
)
...
...
@@ -155,7 +175,6 @@ MaemoSftpConnection::Ptr MaemoSftpConnection::create(const MaemoDeviceConfig &de
return
Ptr
(
new
MaemoSftpConnection
(
devConf
));
}
}
// namespace Internal
}
// namespace Qt4ProjectManager
...
...
This diff is collapsed.
Click to expand it.
src/plugins/qt4projectmanager/qt-maemo/maemosshconnection.h
+
5
−
1
View file @
77b59b02
...
...
@@ -45,15 +45,17 @@
// #define USE_SSH_LIB
#ifdef USE_SSH_LIB
#include
<QtCore/Q
CoreApplication
>
#include
<QtCore/Q
Object
>
#include
<QtCore/QScopedPointer>
#include
<QtCore/QSharedPointer>
#include
<QtCore/QString>
QT_BEGIN_NAMESPACE
class
QStringList
;
QT_END_NAMESPACE
class
ne7ssh
;
class
Ne7SftpSubsystem
;
namespace
Qt4ProjectManager
{
namespace
Internal
{
...
...
@@ -124,6 +126,8 @@ signals:
private:
MaemoSftpConnection
(
const
MaemoDeviceConfig
&
devConf
);
QScopedPointer
<
Ne7SftpSubsystem
>
sftp
;
};
}
// namespace Internal
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment