[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:28:13 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=86bfbf1

The following commit has been merged in the master branch:
commit 86bfbf1a4cfc18a2f9287964203955777174fc95
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Mon Jan 19 22:49:47 2015 -0800

    Trying to fix a crash when exiting KDE Connect.
---
 plugins/sftp/sftpplugin.cpp | 9 +++++----
 plugins/sftp/sftpplugin.h   | 3 ++-
 2 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp
index 53b818a..7ddce51 100644
--- a/plugins/sftp/sftpplugin.cpp
+++ b/plugins/sftp/sftpplugin.cpp
@@ -55,6 +55,7 @@ SftpPlugin::SftpPlugin(QObject *parent, const QVariantList &args)
     : KdeConnectPlugin(parent, args)
     , m_d(new Pimpl())
 { 
+    deviceId = device()->id();
     addToDolphin();
     kDebug(debugArea()) << "Created device:" << device()->name();
 }
@@ -69,14 +70,14 @@ SftpPlugin::~SftpPlugin()
 void SftpPlugin::addToDolphin()
 {
     removeFromDolphin();
-    KUrl kioUrl("kdeconnect://"+device()->id()+"/");
+    KUrl kioUrl("kdeconnect://"+deviceId+"/");
     m_d->placesModel.addPlace(device()->name(), kioUrl, "kdeconnect");
     kDebug(debugArea()) << "add to dolphin";
 }
 
 void SftpPlugin::removeFromDolphin()
 {
-    KUrl kioUrl("kdeconnect://"+device()->id()+"/");
+    KUrl kioUrl("kdeconnect://"+deviceId+"/");
     QModelIndex index = m_d->placesModel.closestItem(kioUrl);
     while (index.row() != -1) {
         m_d->placesModel.removePlace(index);
@@ -133,7 +134,7 @@ bool SftpPlugin::startBrowsing()
 {
     if (mountAndWait()) {
         //return new KRun(KUrl::fromLocalFile(mountPoint()), 0);
-        return new KRun(KUrl::fromPathOrUrl("kdeconnect://"+device()->id()), 0);
+        return new KRun(KUrl::fromPathOrUrl("kdeconnect://"+deviceId), 0);
     }
     return false;
 }
@@ -166,7 +167,7 @@ bool SftpPlugin::receivePackage(const NetworkPackage& np)
 QString SftpPlugin::mountPoint()
 {
     const QString mountDir = KStandardDirs::locateLocal("appdata", "", true, KComponentData("kdeconnect", "kdeconnect"));
-    return QDir(mountDir).absoluteFilePath(device()->id());
+    return QDir(mountDir).absoluteFilePath(deviceId);
 }
 
 void SftpPlugin::onMounted()
diff --git a/plugins/sftp/sftpplugin.h b/plugins/sftp/sftpplugin.h
index 8c77d62..afd651e 100644
--- a/plugins/sftp/sftpplugin.h
+++ b/plugins/sftp/sftpplugin.h
@@ -62,7 +62,7 @@ private Q_SLOTS:
     void onFailed(const QString& message);
     
 private:
-    QString dbusPath() const { return "/modules/kdeconnect/devices/" + device()->id() + "/sftp"; }
+    QString dbusPath() const { return "/modules/kdeconnect/devices/" + deviceId + "/sftp"; }
     void knotify(int type, const QString& text, const QPixmap& icon) const;
     void addToDolphin();
     void removeFromDolphin();
@@ -70,6 +70,7 @@ private:
 private:
     struct Pimpl;
     QScopedPointer<Pimpl> m_d;
+    QString deviceId; //Storing it to avoid accessing device() from the destructor which could cause a crash
 
     QVariantMap remoteDirectories; //Actually a QMap<String, String>, but QDBus preffers this
 };

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list