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

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


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

The following commit has been merged in the master branch:
commit 001aee3e92340404597ec0abd43b7a283f0dc47f
Author: Albert Vaca <albertvaka at gmail.com>
Date:   Sun Mar 8 22:12:55 2015 -0700

    Removed timeout from the sftp plugin and also removed the plugin KCM
    
    Note: This commit requires KNotifications 5.9
---
 plugins/sftp/CMakeLists.txt                 |  18 ---
 plugins/sftp/kdeconnect_sftp_config.desktop |  30 -----
 plugins/sftp/mounter.cpp                    |  43 +------
 plugins/sftp/mounter.h                      |   6 +-
 plugins/sftp/sftp_config.cpp                |  94 ---------------
 plugins/sftp/sftp_config.h                  |  58 ---------
 plugins/sftp/sftp_config.ui                 | 181 ----------------------------
 plugins/sftp/sftpplugin.cpp                 |  34 +-----
 plugins/sftp/sftpplugin.h                   |   2 +-
 9 files changed, 11 insertions(+), 455 deletions(-)

diff --git a/plugins/sftp/CMakeLists.txt b/plugins/sftp/CMakeLists.txt
index 384d70f..1f5123c 100644
--- a/plugins/sftp/CMakeLists.txt
+++ b/plugins/sftp/CMakeLists.txt
@@ -28,21 +28,3 @@ generate_and_install_dbus_interface(
     org.kde.kdeconnect.device.sftp.xml
     OPTIONS -a
 )
-
-#######################################
-# Config
-
-set( kdeconnect_sftp_config_SRCS sftp_config.cpp )
-ki18n_wrap_ui( kdeconnect_sftp_config_SRCS sftp_config.ui )
-
-add_library(kdeconnect_sftp_config MODULE ${kdeconnect_sftp_config_SRCS} )
-target_link_libraries( kdeconnect_sftp_config
-    KF5::I18n
-    KF5::KIOWidgets
-    KF5::KCMUtils
-    KF5::IconThemes
-    qca-qt5
-)
-
-install(TARGETS kdeconnect_sftp_config DESTINATION ${PLUGIN_INSTALL_DIR} )
-install(FILES kdeconnect_sftp_config.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/plugins/sftp/kdeconnect_sftp_config.desktop b/plugins/sftp/kdeconnect_sftp_config.desktop
deleted file mode 100644
index 746593f..0000000
--- a/plugins/sftp/kdeconnect_sftp_config.desktop
+++ /dev/null
@@ -1,30 +0,0 @@
-[Desktop Entry]
-Type=Service
-X-KDE-ServiceTypes=KCModule
-
-X-KDE-Library=kdeconnect_sftp_config
-X-KDE-ParentComponents=kdeconnect_sftp
-
-Name=SFTP filebrowser plugin settings
-Name[bg]=Настройки на приставката за достъп до файловете чрез SFTP
-Name[bs]=SFTP pretraživač datoteka postavke dodatka
-Name[ca]=Ajustaments del connector Navegador de fitxers SFTP
-Name[cs]=Nastavení modulu pro prohlížení souborů přes SFTP
-Name[da]=Indstilling af filhåndteringens SFTP-plugin
-Name[de]=Modul-Einstellungen für SFTP-Dateibrowser
-Name[es]=Ajustes del complemento navegador de archivos SFTP
-Name[fi]=SFTP-tiedostoselainliitännäisen asetukset
-Name[fr]=Paramètres du module du navigateur de fichiers SFTP
-Name[hu]=SFTP fájlböngésző bővítmény beállításai
-Name[ko]=SFTP 파일 탐색기 플러그인 설정
-Name[nl]=Plug-in-instellingen van SFTP-bestandenbrowser
-Name[pl]=Ustawienia wtyczki przeglądarki plików SFTP
-Name[pt]=Configuração do 'plugin' de navegação de ficheiros por SFTP
-Name[pt_BR]=Configurações do plugin de navegação de arquivos por SFTP
-Name[sk]=Nastavenia pluginu prehliadača súborov SFTP
-Name[sv]=Inställningar av insticksprogram för SFTP-filbläddrare
-Name[tr]=SFTP dosya tarayıcı eklenti ayarları
-Name[uk]=Параметри додатка перегляду файлів за допомогою SFTP
-Name[x-test]=xxSFTP filebrowser plugin settingsxx
-
-Categories=Qt;KDE;X-KDE-settings-kdeconnect;
diff --git a/plugins/sftp/mounter.cpp b/plugins/sftp/mounter.cpp
index 70dcd19..02061fd 100644
--- a/plugins/sftp/mounter.cpp
+++ b/plugins/sftp/mounter.cpp
@@ -28,9 +28,7 @@
 #include "sftp_debug.h"
 #include <kdeconnectconfig.h>
 
-static const char* idleTimeout_c = "idleTimeout";
-
-Mounter::Mounter(SftpPlugin* sftp, int idleTimeout)
+Mounter::Mounter(SftpPlugin* sftp)
     : QObject(sftp)
     , m_sftp(sftp)
     , m_proc(0)
@@ -47,17 +45,9 @@ Mounter::Mounter(SftpPlugin* sftp, int idleTimeout)
     connect(this, SIGNAL(mounted()), &m_connectTimer, SLOT(stop()));
     connect(this, SIGNAL(failed(QString)), &m_connectTimer, SLOT(stop()));
 
-    if (idleTimeout)
-    {
-        connect(&m_idleTimer, SIGNAL(timeout()), this, SLOT(onIdleTimeout()));
-    }
-
     m_connectTimer.setInterval(10000);
     m_connectTimer.setSingleShot(true);
-    
-    m_idleTimer.setInterval(idleTimeout);
-    m_idleTimer.setSingleShot(false);
-    
+
     QTimer::singleShot(0, this, SLOT(start()));
     qCDebug(KDECONNECT_PLUGIN_SFTP) << "Created";
 }
@@ -160,11 +150,6 @@ void Mounter::onStarted()
     connect(m_proc.data(), SIGNAL(readyReadStandardOutput()), this, SLOT(readProcessOut()));
     
     m_lastActivity = QDateTime::currentDateTime();
-    
-    if (m_idleTimer.interval())
-    {
-        m_idleTimer.start();
-    }
 }
 
 void Mounter::onError(QProcess::ProcessError error)
@@ -182,15 +167,7 @@ void Mounter::onFinished(int exitCode, QProcess::ExitStatus exitStatus)
     if (exitStatus == QProcess::NormalExit)
     {
         qCDebug(KDECONNECT_PLUGIN_SFTP) << "Process finished (exit code: " << exitCode << ")";
-        
-        if (m_proc->property(idleTimeout_c).toBool())
-        {
-            Q_EMIT unmounted(true);
-        }
-        else
-        {
-            Q_EMIT unmounted(false);
-        }
+        Q_EMIT unmounted();
     }
     else
     {
@@ -209,17 +186,6 @@ void Mounter::onMountTimeout()
     Q_EMIT failed(i18n("Failed to mount filesystem: device not responding"));
 }
 
-void Mounter::onIdleTimeout()
-{
-    Q_ASSERT(m_proc.data());
-    
-    if (m_lastActivity.secsTo(QDateTime::currentDateTime()) >= m_idleTimer.interval() / 1000)
-    {
-        qCDebug(KDECONNECT_PLUGIN_SFTP) << "Timeout: there is no activity on moutned filesystem";
-        m_proc->setProperty(idleTimeout_c, true);
-        unmount();
-    }
-}
 
 void Mounter::readProcessOut()
 {
@@ -234,7 +200,6 @@ void Mounter::start()
     np.set("startBrowsing", true);
     np.set("start", true);
     np.set("id", m_id);
-    np.set("idleTimeout", m_idleTimer.interval());
     m_sftp->sendPackage(np);
     
     m_connectTimer.start();
@@ -253,8 +218,6 @@ void Mounter::cleanMountPoint()
 
 void Mounter::unmount()
 {
-    m_idleTimer.stop();
-    
     if (m_proc)
     {
         cleanMountPoint();
diff --git a/plugins/sftp/mounter.h b/plugins/sftp/mounter.h
index 91b6bad..eeea759 100644
--- a/plugins/sftp/mounter.h
+++ b/plugins/sftp/mounter.h
@@ -33,7 +33,7 @@ class Mounter
     Q_OBJECT
 public:
   
-    explicit Mounter(SftpPlugin *sftp, int idleTimeout);
+    explicit Mounter(SftpPlugin *sftp);
     virtual ~Mounter();
     
     bool wait();
@@ -41,7 +41,7 @@ public:
     
 Q_SIGNALS:
     void mounted();
-    void unmounted(bool idleTimeout);    
+    void unmounted();
     void failed(const QString& message);
    
 private Q_SLOTS:
@@ -50,7 +50,6 @@ private Q_SLOTS:
     void onError(QProcess::ProcessError error);
     void onFinished(int exitCode, QProcess::ExitStatus exitStatus);
     void onMountTimeout();
-    void onIdleTimeout();
     void readProcessOut();
     void start();
 
@@ -65,7 +64,6 @@ private:
     int m_id;
     const QString m_mpoint;
     QTimer m_connectTimer;
-    QTimer m_idleTimer;
     QDateTime m_lastActivity;
     MountLoop m_loop;
     bool m_started;
diff --git a/plugins/sftp/sftp_config.cpp b/plugins/sftp/sftp_config.cpp
deleted file mode 100644
index 31a0689..0000000
--- a/plugins/sftp/sftp_config.cpp
+++ /dev/null
@@ -1,94 +0,0 @@
-/**
- * Copyright 2014 Samoilenko Yuri<kinnalru at gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License or (at your option) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#include "sftp_config.h"
-
-#include <KConfigGroup>
-#include <KPluginFactory>
-#include <KSharedConfig>
-#include <QStandardPaths>
-#include <KAboutData>
-#include <KIconLoader>
-
-#include "sftpplugin.h"
-
-#include "ui_sftp_config.h"
-
-K_PLUGIN_FACTORY(SftpConfigFactory, registerPlugin<SftpConfig>();)
-
-SftpConfig::SftpConfig(QWidget *parent, const QVariantList& )
-    : KCModule(KAboutData::pluginData("kdeconnect_sftp_config"), parent)
-    , m_ui(new Ui::SftpConfigUi())
-    , m_cfg(SftpConfig::config())
-{
-    m_ui->setupUi(this);
-
-    m_ui->refresh->setIcon(KIconLoader::global()->loadIcon("view-refresh", KIconLoader::Dialog));
-    m_ui->pixmap->setPixmap(KIconLoader::global()->loadIcon("dialog-error", KIconLoader::Dialog));
-
-    connect(m_ui->refresh, SIGNAL(clicked(bool)), this, SLOT(checkSshfs()));
-
-    connect(m_ui->idle, SIGNAL(toggled(bool)), this, SLOT(changed()));
-    connect(m_ui->timeout, SIGNAL(valueChanged(int)), this, SLOT(changed()));
-}
-
-SftpConfig::~SftpConfig()
-{
-}
-
-void SftpConfig::checkSshfs()
-{
-    m_ui->error->setVisible(QStandardPaths::findExecutable(QStringLiteral("sshfs")).isEmpty());
-}
-
-void SftpConfig::defaults()
-{
-    KCModule::defaults();
-
-    checkSshfs();
-    m_ui->idle->setChecked(m_cfg->group("main").readEntry("idle", true));
-    m_ui->timeout->setValue(m_cfg->group("main").readEntry("idletimeout", 10));
-
-    Q_EMIT changed(true);
-}
-
-void SftpConfig::load()
-{
-    KCModule::load();
-
-    checkSshfs();
-    m_ui->idle->setChecked(m_cfg->group("main").readEntry("idle", true));
-    m_ui->timeout->setValue(m_cfg->group("main").readEntry("idletimeout", 10));
-
-Q_EMIT changed(false);
-}
-
-
-void SftpConfig::save()
-{
-    checkSshfs();
-    m_cfg->group("main").writeEntry("idle", m_ui->idle->isChecked());
-    m_cfg->group("main").writeEntry("idletimeout", m_ui->timeout->value());
-
-    KCModule::save();
-    Q_EMIT changed(false);
-}
-
-#include "sftp_config.moc"
diff --git a/plugins/sftp/sftp_config.h b/plugins/sftp/sftp_config.h
deleted file mode 100644
index 5ed9b26..0000000
--- a/plugins/sftp/sftp_config.h
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * Copyright 2014 Samoilenko Yuri <kinnalrua at gmail.com>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License or (at your option) version 3 or any later version
- * accepted by the membership of KDE e.V. (or its successor approved
- * by the membership of KDE e.V.), which shall act as a proxy
- * defined in Section 14 of version 3 of the license.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef SFTP_CONFIG_H
-#define SFTP_CONFIG_H
-
-#include <kcmodule.h>
-#include <ksharedconfig.h>
-
-namespace Ui {
-    class SftpConfigUi;
-}
-
-class SftpConfig
-    : public KCModule
-{
-    Q_OBJECT
-public:
-    SftpConfig(QWidget *parent, const QVariantList&);
-    virtual ~SftpConfig();
-
-    static inline KSharedConfigPtr config()
-    {
-        return KSharedConfig::openConfig("kdeconnect/plugins/sftp");
-    }
-    
-public Q_SLOTS:
-    virtual void save();
-    virtual void load();
-    virtual void defaults();
-
-private Q_SLOTS:
-    void checkSshfs();
-    
-private:
-    QScopedPointer<Ui::SftpConfigUi> m_ui;
-    KSharedConfigPtr m_cfg;
-
-};
-
-#endif
diff --git a/plugins/sftp/sftp_config.ui b/plugins/sftp/sftp_config.ui
deleted file mode 100644
index 30e1c79..0000000
--- a/plugins/sftp/sftp_config.ui
+++ /dev/null
@@ -1,181 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>SftpConfigUi</class>
- <widget class="QWidget" name="SftpConfigUi">
-  <property name="windowModality">
-   <enum>Qt::WindowModal</enum>
-  </property>
-  <property name="geometry">
-   <rect>
-    <x>0</x>
-    <y>0</y>
-    <width>505</width>
-    <height>127</height>
-   </rect>
-  </property>
-  <property name="windowTitle">
-   <string>Share plugin settings</string>
-  </property>
-  <layout class="QVBoxLayout" name="verticalLayout">
-   <item>
-    <widget class="QGroupBox" name="error">
-     <property name="title">
-      <string>Error</string>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_2">
-      <item>
-       <widget class="QLabel" name="pixmap">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Maximum">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string/>
-        </property>
-        <property name="scaledContents">
-         <bool>false</bool>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QLabel" name="label">
-        <property name="text">
-         <string>sshfs not found in PATH</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QPushButton" name="refresh">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string/>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <widget class="QFrame" name="frame">
-     <property name="frameShape">
-      <enum>QFrame::NoFrame</enum>
-     </property>
-     <property name="frameShadow">
-      <enum>QFrame::Raised</enum>
-     </property>
-     <layout class="QHBoxLayout" name="horizontalLayout_3">
-      <property name="leftMargin">
-       <number>16</number>
-      </property>
-      <property name="topMargin">
-       <number>0</number>
-      </property>
-      <item>
-       <widget class="QCheckBox" name="idle">
-        <property name="text">
-         <string>Disconnect when idle</string>
-        </property>
-        <property name="checked">
-         <bool>true</bool>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <spacer name="horizontalSpacer">
-        <property name="orientation">
-         <enum>Qt::Horizontal</enum>
-        </property>
-        <property name="sizeHint" stdset="0">
-         <size>
-          <width>53</width>
-          <height>20</height>
-         </size>
-        </property>
-       </spacer>
-      </item>
-      <item>
-       <widget class="QLabel" name="label_2">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Preferred">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="text">
-         <string>Timeout:</string>
-        </property>
-        <property name="alignment">
-         <set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
-        </property>
-       </widget>
-      </item>
-      <item>
-       <widget class="QSpinBox" name="timeout">
-        <property name="sizePolicy">
-         <sizepolicy hsizetype="Maximum" vsizetype="Fixed">
-          <horstretch>0</horstretch>
-          <verstretch>0</verstretch>
-         </sizepolicy>
-        </property>
-        <property name="suffix">
-         <string> min</string>
-        </property>
-        <property name="minimum">
-         <number>5</number>
-        </property>
-        <property name="maximum">
-         <number>99999999</number>
-        </property>
-        <property name="value">
-         <number>10</number>
-        </property>
-       </widget>
-      </item>
-     </layout>
-    </widget>
-   </item>
-   <item>
-    <spacer name="verticalSpacer">
-     <property name="orientation">
-      <enum>Qt::Vertical</enum>
-     </property>
-     <property name="sizeHint" stdset="0">
-      <size>
-       <width>291</width>
-       <height>26</height>
-      </size>
-     </property>
-    </spacer>
-   </item>
-  </layout>
- </widget>
- <resources/>
- <connections>
-  <connection>
-   <sender>idle</sender>
-   <signal>toggled(bool)</signal>
-   <receiver>frame</receiver>
-   <slot>setEnabled(bool)</slot>
-   <hints>
-    <hint type="sourcelabel">
-     <x>20</x>
-     <y>98</y>
-    </hint>
-    <hint type="destinationlabel">
-     <x>14</x>
-     <y>127</y>
-    </hint>
-   </hints>
-  </connection>
- </connections>
-</ui>
diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp
index e98b087..87e53dd 100644
--- a/plugins/sftp/sftpplugin.cpp
+++ b/plugins/sftp/sftpplugin.cpp
@@ -25,9 +25,6 @@
 #include <QDir>
 #include <QDebug>
 
-#include <KConfig>
-#include <KConfigGroup>
-#include <KIconLoader>
 #include <KLocalizedString>
 #include <KNotification>
 #include <KRun>
@@ -35,7 +32,6 @@
 #include <KFilePlacesModel>
 #include <KPluginFactory>
 
-#include "sftp_config.h"
 #include "mounter.h"
 
 K_PLUGIN_FACTORY( KdeConnectPluginFactory, registerPlugin< SftpPlugin >(); )
@@ -100,15 +96,9 @@ void SftpPlugin::mount()
         return;
     }
 
-    KConfigGroup cfg = SftpConfig::config()->group("main");
-    
-    const int idleTimeout = cfg.readEntry("idle", true)
-        ? cfg.readEntry("idletimeout", 60) * 60 * 1000
-        : 0;
-    
-    m_d->mounter = new Mounter(this, idleTimeout);
+    m_d->mounter = new Mounter(this);
     connect(m_d->mounter, SIGNAL(mounted()), this, SLOT(onMounted()));
-    connect(m_d->mounter, SIGNAL(unmounted(bool)), this, SLOT(onUnmounted(bool)));
+    connect(m_d->mounter, SIGNAL(unmounted()), this, SLOT(onUnmounted()));
     connect(m_d->mounter, SIGNAL(failed(QString)), this, SLOT(onFailed(QString)));
 }
 
@@ -179,13 +169,9 @@ void SftpPlugin::onMounted()
     Q_EMIT mounted();
 }
 
-void SftpPlugin::onUnmounted(bool idleTimeout)
+void SftpPlugin::onUnmounted()
 {
-    if (idleTimeout) {
-        qCDebug(KDECONNECT_PLUGIN_SFTP) << device()->name() << "Remote filesystem unmounted by idle timeout";
-    } else {
-        qCDebug(KDECONNECT_PLUGIN_SFTP) << device()->name() << "Remote filesystem unmounted";
-    }
+    qCDebug(KDECONNECT_PLUGIN_SFTP) << device()->name() << "Remote filesystem unmounted";
 
     unmount();
     
@@ -194,23 +180,13 @@ void SftpPlugin::onUnmounted(bool idleTimeout)
 
 void SftpPlugin::onFailed(const QString& message)
 {
-    knotify(KNotification::Error
-        , message
-        , KIconLoader::global()->loadIcon("dialog-error", KIconLoader::Desktop)
-    );
+    KNotification::event(KNotification::Error, device()->name(), message);
 
     unmount();
 
     Q_EMIT unmounted();
 }
 
-void SftpPlugin::knotify(int type, const QString& text, const QPixmap& icon) const
-{
-    KNotification::event(KNotification::StandardEvent(type)
-      , i18n("Device %1", device()->name()), text, icon, 0
-      , KNotification::CloseOnTimeout);
-}
-
 QVariantMap SftpPlugin::getDirectories()
 {
     return remoteDirectories;
diff --git a/plugins/sftp/sftpplugin.h b/plugins/sftp/sftpplugin.h
index afd651e..48d8952 100644
--- a/plugins/sftp/sftpplugin.h
+++ b/plugins/sftp/sftpplugin.h
@@ -58,7 +58,7 @@ public Q_SLOTS:
 
 private Q_SLOTS:
     void onMounted();
-    void onUnmounted(bool idleTimeout);
+    void onUnmounted();
     void onFailed(const QString& message);
     
 private:

-- 
kdeconnect packaging



More information about the pkg-kde-commits mailing list