[SCM] kdeconnect packaging branch, master, updated. debian/0.9g-1-1183-g9d69498
Maximiliano Curia
maxy at moszumanska.debian.org
Fri Oct 14 14:27:15 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/kdeconnect.git;a=commitdiff;h=ecc0697
The following commit has been merged in the master branch:
commit ecc06971b4c05f6d607557669e377ad382a1e555
Author: Samoilenko Yuri <kinnalru at gmail.com>
Date: Wed Jan 15 01:39:27 2014 +0400
settings for sftp plugin
---
kded/plugins/sftp/CMakeLists.txt | 16 ++++
kded/plugins/sftp/kdeconnect_sftp_config.desktop | 12 +++
kded/plugins/sftp/sftp_config.cpp | 91 ++++++++++++++++++++++
.../{share/share_config.h => sftp/sftp_config.h} | 21 ++---
kded/plugins/sftp/sftp_config.ui | 70 +++++++++++++++++
5 files changed, 201 insertions(+), 9 deletions(-)
diff --git a/kded/plugins/sftp/CMakeLists.txt b/kded/plugins/sftp/CMakeLists.txt
index 59ffcc1..2410eab 100644
--- a/kded/plugins/sftp/CMakeLists.txt
+++ b/kded/plugins/sftp/CMakeLists.txt
@@ -44,3 +44,19 @@ generate_and_install_dbus_interface(
org.kde.kdeconnect.device.sftp.xml
OPTIONS -a
)
+
+#######################################
+# Config
+
+set( kdeconnect_sftp_config_SRCS sftp_config.cpp )
+kde4_add_ui_files( kdeconnect_sftp_config_SRCS sftp_config.ui )
+
+kde4_add_plugin( kdeconnect_sftp_config ${kdeconnect_sftp_config_SRCS} )
+target_link_libraries( kdeconnect_sftp_config
+ ${KDE4_KDECORE_LIBS}
+ ${KDE4_KDEUI_LIBS}
+ ${KDE4_KIO_LIBS}
+)
+
+install(TARGETS kdeconnect_sftp_config DESTINATION ${PLUGIN_INSTALL_DIR} )
+install(FILES kdeconnect_sftp_config.desktop DESTINATION ${SERVICES_INSTALL_DIR} )
diff --git a/kded/plugins/sftp/kdeconnect_sftp_config.desktop b/kded/plugins/sftp/kdeconnect_sftp_config.desktop
new file mode 100644
index 0000000..d6c4c67
--- /dev/null
+++ b/kded/plugins/sftp/kdeconnect_sftp_config.desktop
@@ -0,0 +1,12 @@
+[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[uk]=Настройки SFTP обозревателя
+Name[ru]=Настройки SFTP обозревателя
+
+Categories=Qt;KDE;X-KDE-settings-kdeconnect;
diff --git a/kded/plugins/sftp/sftp_config.cpp b/kded/plugins/sftp/sftp_config.cpp
new file mode 100644
index 0000000..ce526b2
--- /dev/null
+++ b/kded/plugins/sftp/sftp_config.cpp
@@ -0,0 +1,91 @@
+/**
+ * Copyright 2013 Albert Vaca <albertvaka 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 <KGlobalSettings>
+#include <KPluginFactory>
+#include <KSharedConfig>
+#include <KStandardDirs>
+
+#include "../../kdebugnamespace.h"
+
+#include "ui_sftp_config.h"
+
+K_PLUGIN_FACTORY(SftpConfigFactory, registerPlugin<SftpConfig>();)
+K_EXPORT_PLUGIN(SftpConfigFactory("kdeconnect_sftp_config", "kdeconnect_sftp_config"))
+
+SftpConfig::SftpConfig(QWidget *parent, const QVariantList& )
+ : KCModule(SftpConfigFactory::componentData(), parent)
+ , ui(new Ui::SftpConfigUi())
+ , cfg(KSharedConfig::openConfig("kdeconnect/plugins/sftp"))
+{
+ ui->setupUi(this);
+
+ ui->check->setIcon(KIconLoader::global()->loadIcon("view-refresh", KIconLoader::Dialog));
+ connect(ui->check, SIGNAL(clicked(bool)), this, SLOT(refresh()));
+ refresh();
+}
+
+SftpConfig::~SftpConfig()
+{
+ delete ui;
+}
+
+void SftpConfig::refresh()
+{
+ const QString sshfs = KStandardDirs::findExe("sshfs");
+
+ if (sshfs.isEmpty())
+ {
+ ui->label->setText(i18n("sshfs not found in PATH"));
+ ui->pixmap->setPixmap(KIconLoader::global()->loadIcon("dialog-error", KIconLoader::Dialog));
+ }
+ else
+ {
+ ui->label->setText(i18n("sshfs found at %1").arg(sshfs));
+ ui->pixmap->setPixmap(KIconLoader::global()->loadIcon("dialog-ok", KIconLoader::Dialog));
+ }
+}
+
+void SftpConfig::defaults()
+{
+ KCModule::defaults();
+ refresh();
+ //Q_EMIT changed(true);
+}
+
+
+void SftpConfig::load()
+{
+ KCModule::load();
+ refresh() ;
+ //Q_EMIT changed(false);
+}
+
+
+void SftpConfig::save()
+{
+ refresh();
+ KCModule::save();
+ //Q_EMIT changed(false);
+}
+
diff --git a/kded/plugins/share/share_config.h b/kded/plugins/sftp/sftp_config.h
similarity index 77%
copy from kded/plugins/share/share_config.h
copy to kded/plugins/sftp/sftp_config.h
index 7743fcc..acab3a9 100644
--- a/kded/plugins/share/share_config.h
+++ b/kded/plugins/sftp/sftp_config.h
@@ -1,5 +1,5 @@
/**
- * Copyright 2013 Albert Vaca <albertvaka at gmail.com>
+ * 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
@@ -18,32 +18,35 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef SHARE_CONFIG_H
-#define SHARE_CONFIG_H
+#ifndef SFTP_CONFIG_H
+#define SFTP_CONFIG_H
#include <kcmodule.h>
#include <ksharedconfig.h>
namespace Ui {
- class ShareConfigUi;
+ class SftpConfigUi;
}
-class ShareConfig
+class SftpConfig
: public KCModule
{
Q_OBJECT
public:
- ShareConfig(QWidget *parent, const QVariantList&);
- virtual ~ShareConfig();
+ SftpConfig(QWidget *parent, const QVariantList&);
+ virtual ~SftpConfig();
public Q_SLOTS:
virtual void save();
virtual void load();
virtual void defaults();
+private Q_SLOTS:
+ void refresh();
+
private:
- Ui::ShareConfigUi* m_ui;
- KSharedConfigPtr m_cfg;
+ Ui::SftpConfigUi* ui;
+ KSharedConfigPtr cfg;
};
diff --git a/kded/plugins/sftp/sftp_config.ui b/kded/plugins/sftp/sftp_config.ui
new file mode 100644
index 0000000..00e42bf
--- /dev/null
+++ b/kded/plugins/sftp/sftp_config.ui
@@ -0,0 +1,70 @@
+<?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>353</width>
+ <height>68</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Share plugin settings</string>
+ </property>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <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 row="0" column="1">
+ <widget class="QLabel" name="label">
+ <property name="text">
+ <string/>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignCenter</set>
+ </property>
+ </widget>
+ </item>
+ <item row="1" column="0" colspan="2">
+ <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>
+ <item row="0" column="2">
+ <widget class="QPushButton" name="check">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>
--
kdeconnect packaging
More information about the pkg-kde-commits
mailing list