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

Maximiliano Curia maxy at moszumanska.debian.org
Fri Oct 14 14:27:26 UTC 2016


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

The following commit has been merged in the master branch:
commit 8fafdad584d2b5cb266467748d25698c187179dd
Author: Samoilenko Yuri <kinnalru at gmail.com>
Date:   Thu Feb 27 23:29:34 2014 +0400

    some little crash fixes
---
 kded/kdeconnectd.cpp             | 13 +++++++++----
 kded/plugins/pluginloader.cpp    |  3 ++-
 kded/plugins/sftp/sftpplugin.cpp | 17 +++++++----------
 3 files changed, 18 insertions(+), 15 deletions(-)

diff --git a/kded/kdeconnectd.cpp b/kded/kdeconnectd.cpp
index bbe8708..71dd269 100644
--- a/kded/kdeconnectd.cpp
+++ b/kded/kdeconnectd.cpp
@@ -43,11 +43,11 @@ void sighandler(int signum)
     }
 }
 
-void initializeTermHandlers(QCoreApplication* app)
+void initializeTermHandlers(QCoreApplication* app, Daemon* daemon)
 {
     ::socketpair(AF_UNIX, SOCK_STREAM, 0, sigtermfd);
     QSocketNotifier* snTerm = new QSocketNotifier(sigtermfd[1], QSocketNotifier::Read, app);
-    QObject::connect(snTerm, SIGNAL(activated(int)), app, SLOT(quit()));    
+    QObject::connect(snTerm, SIGNAL(activated(int)), daemon, SLOT(deleteLater()));    
     
     action.sa_handler = sighandler;
     sigemptyset(&action.sa_mask);
@@ -73,8 +73,13 @@ int main(int argc, char* argv[])
     KApplication app(true); // WARNING GUI required for QClipboard access
     app.disableSessionManagement();
 
-    initializeTermHandlers(&app);
-    new Daemon(&app);
+
+    //Force daemon to destroy when KApplications in alive
+    //belongs to bug KApplications resoure freeing
+    Daemon* daemon = new Daemon(0);
+    QObject::connect(daemon, SIGNAL(destroyed(QObject*)), &app, SLOT(quit()));
+    initializeTermHandlers(&app, daemon);
+    
     return app.exec();
 }
 
diff --git a/kded/plugins/pluginloader.cpp b/kded/plugins/pluginloader.cpp
index 0207bcf..737edae 100644
--- a/kded/plugins/pluginloader.cpp
+++ b/kded/plugins/pluginloader.cpp
@@ -77,7 +77,8 @@ PluginData PluginLoader::instantiatePluginForDevice(const QString& name, Device*
 
     QVariant deviceVariant = QVariant::fromValue<Device*>(device);
 
-    ret.plugin = (KdeConnectPlugin*) factory->create<QObject>(device, QVariantList() << deviceVariant);
+    //FIXME any reason to use QObject in template param instead KdeConnectPlugin?
+    ret.plugin = factory->create<KdeConnectPlugin>(device, QVariantList() << deviceVariant);
     if (!ret.plugin) {
         kDebug(kdeconnect_kded()) << "Error loading plugin";
         return ret;
diff --git a/kded/plugins/sftp/sftpplugin.cpp b/kded/plugins/sftp/sftpplugin.cpp
index b0bb1a7..3166d61 100644
--- a/kded/plugins/sftp/sftpplugin.cpp
+++ b/kded/plugins/sftp/sftpplugin.cpp
@@ -44,13 +44,10 @@ static const QSet<QString> fields_c = QSet<QString>() << "ip" << "port" << "user
 
 struct SftpPlugin::Pimpl
 {
-    Pimpl()
-    {
-        //Add KIO entry to Dolphin's Places
-        placesModel = new KFilePlacesModel();
-    }
+    Pimpl() {}
   
-    KFilePlacesModel*  placesModel;
+    //Add KIO entry to Dolphin's Places
+    KFilePlacesModel  placesModel;
     QPointer<Mounter> mounter;
 };
 
@@ -74,17 +71,17 @@ void SftpPlugin::addToDolphin()
 {
     removeFromDolphin();
     KUrl kioUrl("kdeconnect://"+device()->id()+"/");
-    m_d->placesModel->addPlace(device()->name(), kioUrl, "kdeconnect");
+    m_d->placesModel.addPlace(device()->name(), kioUrl, "kdeconnect");
     kDebug(kdeconnect_kded()) << "add to dolphin";
 }
 
 void SftpPlugin::removeFromDolphin()
 {
     KUrl kioUrl("kdeconnect://"+device()->id()+"/");
-    QModelIndex index = m_d->placesModel->closestItem(kioUrl);
+    QModelIndex index = m_d->placesModel.closestItem(kioUrl);
     while (index.row() != -1) {
-        m_d->placesModel->removePlace(index);
-        index = m_d->placesModel->closestItem(kioUrl);
+        m_d->placesModel.removePlace(index);
+        index = m_d->placesModel.closestItem(kioUrl);
     }
 }
 

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list