diff --git a/kded/plugins/sftp/mounter.cpp b/kded/plugins/sftp/mounter.cpp index 5a9705e19..dae3c577a 100644 --- a/kded/plugins/sftp/mounter.cpp +++ b/kded/plugins/sftp/mounter.cpp @@ -18,7 +18,6 @@ * along with this program. If not, see . */ - #include #include @@ -102,7 +101,7 @@ void Mounter::onPakcageReceived(const NetworkPackage& np) connect(m_proc.data(), SIGNAL(started()), SLOT(onStarted())); connect(m_proc.data(), SIGNAL(error(QProcess::ProcessError)), SLOT(onError(QProcess::ProcessError))); connect(m_proc.data(), SIGNAL(finished(int,QProcess::ExitStatus)), SLOT(onFinished(int,QProcess::ExitStatus))); - + const QString mpoint = m_sftp->mountPoint(); QDir().mkpath(mpoint); @@ -116,12 +115,16 @@ void Mounter::onPakcageReceived(const NetworkPackage& np) << "-p" << np.get("port") << "-d" << "-f" - << "-o IdentityFile=" + m_sftp->device()->privateKeyPath() - << "-o StrictHostKeyChecking=no" //Do not ask for confirmation because it is not a known host - << "-o UserKnownHostsFile=/dev/null"; //Prevent storing as a known host + << "-o" << "IdentityFile=" + m_sftp->device()->privateKeyPath() + << "-o" << "StrictHostKeyChecking=no" //Do not ask for confirmation because it is not a known host + << "-o" << "UserKnownHostsFile=/dev/null"; //Prevent storing as a known host m_proc->setProgram(program, arguments); + //To debug + //m_proc->setStandardOutputFile("/tmp/kdeconnect-sftp.out"); + //m_proc->setStandardErrorFile("/tmp/kdeconnect-sftp.err"); + cleanMountPoint(); kDebug(kdeconnect_kded()) << "Staring process: " << m_proc->program().join(" "); diff --git a/kded/plugins/sftp/sftpplugin.cpp b/kded/plugins/sftp/sftpplugin.cpp index d284114cb..32c616874 100644 --- a/kded/plugins/sftp/sftpplugin.cpp +++ b/kded/plugins/sftp/sftpplugin.cpp @@ -21,6 +21,7 @@ #include "sftpplugin.h" #include +#include #include #include @@ -29,8 +30,8 @@ #include #include #include +#include #include -#include #include "sftp_config.h" #include "mounter.h" @@ -156,7 +157,7 @@ QString SftpPlugin::mountPoint() { const QString defaultMountDir = KStandardDirs::locateLocal("appdata", "", true, componentData()); const QString mountDir = KConfig("kdeconnect/plugins/sftp").group("main").readEntry("mountpoint", defaultMountDir); - return mountDir + "/" + device()->id() + "/"; + return QDir(mountDir).absoluteFilePath(device()->id()); } void SftpPlugin::onMounted() diff --git a/kded/plugins/share/shareplugin.cpp b/kded/plugins/share/shareplugin.cpp index 5579a30ec..306a228ff 100644 --- a/kded/plugins/share/shareplugin.cpp +++ b/kded/plugins/share/shareplugin.cpp @@ -27,7 +27,6 @@ #include #include -#include #include #include #include