[SCM] ktp-kded-integration-module packaging branch, master, updated. debian/15.12.1-2-382-gbd961c2

Maximiliano Curia maxy at moszumanska.debian.org
Sat May 28 00:15:51 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-kded-module.git;a=commitdiff;h=d1b1a9e

The following commit has been merged in the master branch:
commit d1b1a9ee8c53dfcb7510654aa7993bfa674c262e
Author: Martin Klapetek <mklapetek at kde.org>
Date:   Wed Dec 3 11:59:12 2014 +0100

    Make ktp-kded-module kdelibs4support free
    
    Also fixes the module autoloading
    
    REVIEW: 121330
---
 CMakeLists.txt                                     | 17 ++++----
 config/CMakeLists.txt                              |  8 +++-
 config/nowplaying-listwidget.cpp                   |  5 +--
 config/telepathy-kded-config.cpp                   | 10 ++---
 config/telepathy-kded-config.ui                    | 11 ++----
 contact-cache.cpp                                  | 14 +++++--
 contact-request-handler.cpp                        | 46 +++++++++++-----------
 contact-request-handler.h                          |  7 ++--
 error-handler.cpp                                  |  9 +++--
 ...odule.desktop => ktp_integration_module.desktop |  2 +-
 ...thy.Client.KTp.KdedIntegrationModule.service.in |  2 +-
 telepathy-module.cpp                               |  1 -
 12 files changed, 69 insertions(+), 63 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4a8aa41..67e6701 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,17 +14,14 @@ include(KDECMakeSettings)
 include(KDECompilerSettings)
 include(FeatureSummary)
 
-find_package (Qt5 REQUIRED COMPONENTS Concurrent Widgets Sql)
-find_package (KF5 REQUIRED COMPONENTS DBusAddons Config I18n Notifications ConfigWidgets IdleTime KDELibs4Support)
+find_package (Qt5 REQUIRED COMPONENTS Concurrent Widgets Sql Network)
+find_package (KF5 REQUIRED COMPONENTS DBusAddons WidgetsAddons Config I18n KIO Notifications ConfigWidgets IdleTime KCMUtils)
 
 find_package (KTp REQUIRED)
 
 # Add an option for building tests
 option(ENABLE_TESTS "Enable compilation of tests" FALSE)
 
-# make some more macros available
-include (MacroLibrary)
-
 add_definitions (-DQT_NO_CAST_FROM_ASCII
                  -DQT_NO_KEYWORDS
 )
@@ -52,23 +49,27 @@ add_library (kded_ktp_integration_module MODULE ${kded_ktp_integration_module_SR
 )
 
 target_link_libraries (kded_ktp_integration_module
+                       KTp::CommonInternals
+                       KTp::Widgets
                        KF5::DBusAddons
                        KF5::ConfigGui
+                       KF5::ConfigCore
                        KF5::I18n
                        KF5::Notifications
                        KF5::IdleTime
-                       KF5::KDELibs4Support
+                       KF5::KIOWidgets
+                       KF5::WidgetsAddons
                        ${TELEPATHY_QT5_LIBRARIES}
-                       KTp::CommonInternals
                        Qt5::Concurrent
                        Qt5::Sql
+                       Qt5::Network
 )
 
 install (TARGETS kded_ktp_integration_module
          DESTINATION ${PLUGIN_INSTALL_DIR}
 )
 
-install (FILES kded_ktp_integration_module.desktop
+install (FILES ktp_integration_module.desktop
          DESTINATION ${SERVICES_INSTALL_DIR}/kded
 )
 
diff --git a/config/CMakeLists.txt b/config/CMakeLists.txt
index a357e87..c89b7aa 100644
--- a/config/CMakeLists.txt
+++ b/config/CMakeLists.txt
@@ -15,7 +15,13 @@ ki18n_wrap_ui(kcm_ktp_integration_module_SRCS ${kcm_ktp_integration_module_UI})
 
 add_library(kcm_ktp_integration_module MODULE ${kcm_ktp_integration_module_SRCS})
 
-target_link_libraries(kcm_ktp_integration_module Qt5::Widgets KF5::I18n KF5::ConfigWidgets KF5::KDELibs4Support)
+target_link_libraries(kcm_ktp_integration_module Qt5::Widgets
+                                                 Qt5::DBus
+                                                 KF5::I18n
+                                                 KF5::ConfigWidgets
+                                                 KF5::WidgetsAddons
+                                                 KF5::KIOWidgets
+)
 
 
 install(TARGETS kcm_ktp_integration_module
diff --git a/config/nowplaying-listwidget.cpp b/config/nowplaying-listwidget.cpp
index 27c110f..638f4c5 100644
--- a/config/nowplaying-listwidget.cpp
+++ b/config/nowplaying-listwidget.cpp
@@ -18,8 +18,7 @@
 
 #include "nowplaying-listwidget.h"
 
-#include <KIcon>
-#include <KIconLoader>
+#include <QIcon>
 #include <QScrollBar>
 #include <QDrag>
 #include <QMimeData>
@@ -59,7 +58,7 @@ void NowPlayingListWidget::setupItems()
         tagName = tagName.right(tagName.size() - 1); //cut the '%' character
         tagName = tagName.left(1).toUpper() + tagName.mid(1); //capitalize tag name
 
-        QListWidgetItem *newItem = new QListWidgetItem(KIcon(m_itemsIcons.at(i)), tagName);
+        QListWidgetItem *newItem = new QListWidgetItem(QIcon::fromTheme(m_itemsIcons.at(i)), tagName);
         addItem(newItem);
     }
 }
diff --git a/config/telepathy-kded-config.cpp b/config/telepathy-kded-config.cpp
index 9c686d1..4ed6a16 100644
--- a/config/telepathy-kded-config.cpp
+++ b/config/telepathy-kded-config.cpp
@@ -25,8 +25,8 @@
 #include <KPluginFactory>
 #include <KSharedConfig>
 #include <KLocalizedString>
-#include <KUrl>
 
+#include <QUrl>
 #include <QDBusMessage>
 #include <QDBusConnection>
 
@@ -83,15 +83,15 @@ TelepathyKDEDConfig::TelepathyKDEDConfig(QWidget *parent, const QVariantList& ar
     ui->m_xaMins->setSuffix(i18nc("Unit after number in spinbox, denotes time unit 'minutes', keep the leading whitespace!",
                                     " minutes"));
 
-    ui->m_awayMessage->setClickMessage(i18n("Leave empty for no message"));
+    ui->m_awayMessage->setPlaceholderText(i18n("Leave empty for no message"));
     // xgettext: no-c-format
     ui->m_awayMessage->setToolTip(i18n("Use %time to insert UTC time of when you went away"));
 
-    ui->m_xaMessage->setClickMessage(i18n("Leave empty for no message"));
+    ui->m_xaMessage->setPlaceholderText(i18n("Leave empty for no message"));
     // xgettext: no-c-format
     ui->m_xaMessage->setToolTip(i18n("Use %time to insert UTC time of when you went not available"));
 
-    ui->m_screenSaverAwayMessage->setClickMessage(i18n("Leave empty for no message"));
+    ui->m_screenSaverAwayMessage->setPlaceholderText(i18n("Leave empty for no message"));
     // xgettext: no-c-format
     ui->m_screenSaverAwayMessage->setToolTip(i18n("Use %time to insert UTC time of when the screen saver was activated"));
 
@@ -153,7 +153,7 @@ void TelepathyKDEDConfig::load()
     // download directory
     QString downloadDirectory = filetransferConfig.readPathEntry(QLatin1String("downloadDirectory"),
                     QDir::homePath() + QLatin1String("/") + i18nc("This is the download directory in user's home", "Downloads"));
-    ui->m_downloadUrlRequester->setUrl(KUrl(downloadDirectory));
+    ui->m_downloadUrlRequester->setUrl(QUrl::fromUserInput(downloadDirectory));
     ui->m_downloadUrlCheckBox->setChecked(filetransferConfig.readEntry(QLatin1String("alwaysAsk"), false));
     ui->m_downloadUrlRequester->setEnabled(!ui->m_downloadUrlCheckBox->isChecked());
 
diff --git a/config/telepathy-kded-config.ui b/config/telepathy-kded-config.ui
index 93c06dc..2b80dfa 100644
--- a/config/telepathy-kded-config.ui
+++ b/config/telepathy-kded-config.ui
@@ -158,7 +158,7 @@
                </widget>
               </item>
               <item>
-               <widget class="KLineEdit" name="m_awayMessage"/>
+               <widget class="QLineEdit" name="m_awayMessage"/>
               </item>
              </layout>
             </item>
@@ -257,7 +257,7 @@
                </widget>
               </item>
               <item>
-               <widget class="KLineEdit" name="m_xaMessage"/>
+               <widget class="QLineEdit" name="m_xaMessage"/>
               </item>
              </layout>
             </item>
@@ -315,7 +315,7 @@
                </widget>
               </item>
               <item>
-               <widget class="KLineEdit" name="m_screenSaverAwayMessage"/>
+               <widget class="QLineEdit" name="m_screenSaverAwayMessage"/>
               </item>
              </layout>
             </item>
@@ -444,11 +444,6 @@
  </widget>
  <customwidgets>
   <customwidget>
-   <class>KLineEdit</class>
-   <extends>QLineEdit</extends>
-   <header>klineedit.h</header>
-  </customwidget>
-  <customwidget>
    <class>KUrlRequester</class>
    <extends>QFrame</extends>
    <header>kurlrequester.h</header>
diff --git a/contact-cache.cpp b/contact-cache.cpp
index a06ad30..e3ed4aa 100644
--- a/contact-cache.cpp
+++ b/contact-cache.cpp
@@ -31,9 +31,8 @@
 #include <TelepathyQt/PendingOperation>
 #include <TelepathyQt/PendingReady>
 
-#include <KGlobal>
-#include <KStandardDirs>
-
+#include <QStandardPaths>
+#include <QDir>
 #include <QSqlQuery>
 #include <QSqlDriver>
 #include <QSqlField>
@@ -58,7 +57,14 @@ ContactCache::ContactCache(QObject *parent):
     QObject(parent),
     m_db(QSqlDatabase::addDatabase(QLatin1String("QSQLITE")))
 {
-    m_db.setDatabaseName(KGlobal::dirs()->locateLocal("data", QLatin1String("ktp/cache.db")));
+    QString path(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) + QLatin1Char('/') + QStringLiteral("ktp"));
+    QDir dir(path);
+
+    if (!dir.exists()) {
+        dir.mkpath(path);
+    }
+
+    m_db.setDatabaseName(dir.absolutePath() + QStringLiteral("/cache.db"));
     m_db.open();
 
     if (!m_db.tables().contains(QLatin1String("groups"))) {
diff --git a/contact-request-handler.cpp b/contact-request-handler.cpp
index de25328..e6a5080 100644
--- a/contact-request-handler.cpp
+++ b/contact-request-handler.cpp
@@ -22,8 +22,8 @@
 #include "ktp_kded_debug.h"
 
 #include <KTp/error-dictionary.h>
-#include <KTp/contact-info-dialog.h>
 #include <KTp/core.h>
+#include <KTp/Widgets/contact-info-dialog.h>
 
 #include <TelepathyQt/Account>
 #include <TelepathyQt/AccountManager>
@@ -33,15 +33,14 @@
 #include <TelepathyQt/PendingComposite>
 #include <TelepathyQt/PendingOperation>
 
-#include <KGlobal>
-#include <KAboutData>
-#include <KMenu>
-#include <KAction>
-#include <KIcon>
 #include <KStatusNotifierItem>
+#include <KLocalizedString>
 
-#include <QtCore/QFutureWatcher>
+#include <QAction>
+#include <QIcon>
+#include <QFutureWatcher>
 #include <QtConcurrentFilter>
+#include <QMenu>
 
 Q_DECLARE_METATYPE(Tp::ContactPtr)
 
@@ -228,7 +227,7 @@ void ContactRequestHandler::onNotifierActivated(bool active, const QPoint &pos)
 
 void ContactRequestHandler::onContactRequestApproved()
 {
-    QString contactId = qobject_cast<KAction*>(sender())->data().toString();
+    QString contactId = qobject_cast<QAction*>(sender())->data().toString();
 
     // Disable the action in the meanwhile
     m_menuItems.value(contactId)->setEnabled(false);
@@ -261,7 +260,7 @@ void ContactRequestHandler::onContactRequestApproved()
 
 void ContactRequestHandler::onShowContactDetails()
 {
-    QString contactId = qobject_cast<KAction*>(sender())->data().toString();
+    QString contactId = qobject_cast<QAction*>(sender())->data().toString();
 
     if (!contactId.isEmpty()) {
         const Tp::ContactPtr contact = m_pendingContacts.find(contactId).value();
@@ -319,7 +318,7 @@ void ContactRequestHandler::onAuthorizePresencePublicationFinished(Tp::PendingOp
 
 void ContactRequestHandler::onContactRequestDenied()
 {
-    QString contactId = qobject_cast<KAction*>(sender())->data().toString();
+    QString contactId = qobject_cast<QAction*>(sender())->data().toString();
 
     // Disable the action in the meanwhile
     m_menuItems.value(contactId)->setEnabled(false);
@@ -393,8 +392,8 @@ void ContactRequestHandler::updateMenus()
         m_notifierItem.data()->setTitle(i18nc("Menu title", "Pending contact requests"));
         m_notifierItem.data()->setStatus(KStatusNotifierItem::Active);
 
-        KMenu *notifierMenu = new KMenu(0);
-        notifierMenu->addTitle(i18nc("Context menu title", "Received contact requests"));
+        QMenu *notifierMenu = new QMenu(0);
+        notifierMenu->setTitle(i18nc("Context menu title", "Received contact requests"));
 
         connect(m_notifierItem.data(), SIGNAL(activateRequested(bool,QPoint)), SLOT(onNotifierActivated(bool,QPoint)));
 
@@ -414,32 +413,33 @@ void ContactRequestHandler::updateMenus()
         qCDebug(KTP_KDED_MODULE);
         Tp::ContactPtr contact = i.value();
 
-        KMenu *contactMenu = new KMenu(m_notifierItem.data()->contextMenu());
+        QMenu *contactMenu = new QMenu(m_notifierItem.data()->contextMenu());
         contactMenu->setTitle(i18n("Request from %1", contact->alias()));
         contactMenu->setObjectName(contact->id());
 
-        KAction *menuAction;
-        if (!contact->publishStateMessage().isEmpty()) {
-            contactMenu->addTitle(contact->publishStateMessage());
-        } else {
-            contactMenu->addTitle(contact->alias());
-        }
+        QAction *menuAction;
 
-        menuAction = new KAction(KIcon(QLatin1String("user-identity")), i18n("Contact Details"), contactMenu);
+        menuAction = new QAction(QIcon(QLatin1String("user-identity")), i18n("Contact Details"), contactMenu);
         menuAction->setData(i.key());
         connect(menuAction, SIGNAL(triggered()),
                 this, SLOT(onShowContactDetails()));
         contactMenu->addAction(menuAction);
 
+        if (!contact->publishStateMessage().isEmpty()) {
+            contactMenu->insertSection(menuAction, contact->publishStateMessage());
+        } else {
+            contactMenu->insertSection(menuAction, contact->alias());
+        }
+
         contactMenu->addSeparator();
 
-        menuAction = new KAction(KIcon(QLatin1String("dialog-ok-apply")), i18n("Approve"), contactMenu);
+        menuAction = new QAction(QIcon::fromTheme(QLatin1String("dialog-ok-apply")), i18n("Approve"), contactMenu);
         menuAction->setData(i.key());
         connect(menuAction, SIGNAL(triggered()),
                 this, SLOT(onContactRequestApproved()));
         contactMenu->addAction(menuAction);
 
-        menuAction = new KAction(KIcon(QLatin1String("dialog-close")), i18n("Deny"), contactMenu);
+        menuAction = new QAction(QIcon::fromTheme(QLatin1String("dialog-close")), i18n("Deny"), contactMenu);
         menuAction->setData(i.key());
         connect(menuAction, SIGNAL(triggered()),
                 this, SLOT(onContactRequestDenied()));
@@ -450,7 +450,7 @@ void ContactRequestHandler::updateMenus()
     }
 
     //remove items that are still in the menu, but not in pending contacts
-    QHash<QString, KMenu*>::iterator j = m_menuItems.begin();
+    QHash<QString, QMenu*>::iterator j = m_menuItems.begin();
     while (j != m_menuItems.end()) {
         if (m_pendingContacts.contains(j.key())) {
             // Skip
diff --git a/contact-request-handler.h b/contact-request-handler.h
index 93807b6..7218151 100644
--- a/contact-request-handler.h
+++ b/contact-request-handler.h
@@ -25,8 +25,7 @@
 #include <TelepathyQt/Types>
 #include <TelepathyQt/PendingOperation>
 
-class KMenu;
-class KAction;
+class QMenu;
 class KStatusNotifierItem;
 class ContactRequestHandler : public QObject
 {
@@ -57,9 +56,9 @@ private:
     void updateMenus();
     void handleNewConnection(const Tp::ConnectionPtr &connection);
 
-    QWeakPointer<KStatusNotifierItem> m_notifierItem;
+    QPointer<KStatusNotifierItem> m_notifierItem;
     QHash<QString, Tp::ContactPtr> m_pendingContacts;
-    QHash<QString, KMenu*> m_menuItems;
+    QHash<QString, QMenu*> m_menuItems;
 };
 
 #endif // CONTACT_REQUEST_HANDLER_H
diff --git a/error-handler.cpp b/error-handler.cpp
index 1787e7e..f62ff3d 100644
--- a/error-handler.cpp
+++ b/error-handler.cpp
@@ -30,10 +30,9 @@
 #include <KLocalizedString>
 #include <KNotification>
 
-#include <Solid/Networking>
-
 #include <QScopedPointer>
 #include <QTimer>
+#include <QNetworkConfigurationManager>
 
 /** Stores the last error message for an account
     For every new error if we're online we wait 30 seconds and show 1 notification for all errors. This will be the only error we show for that account until the user reconnects.
@@ -122,7 +121,8 @@ ErrorHandler::~ErrorHandler()
 void ErrorHandler::showErrorNotification()
 {
     //if we're not currently connected to the network, any older errors were probably related to this, ignore them.
-    if (Solid::Networking::status() != Solid::Networking::Connected) {
+    QNetworkConfigurationManager network;
+    if (!network.isOnline()) {
         return;
     }
 
@@ -170,7 +170,8 @@ void ErrorHandler::onConnectionStatusChanged(const Tp::ConnectionStatus status)
     Tp::AccountPtr account(qobject_cast< Tp::Account* >(sender()));
 
     //if we're not connected to the network, errors are pointless
-    if (Solid::Networking::status() != Solid::Networking::Connected) {
+    QNetworkConfigurationManager network;
+    if (!network.isOnline()) {
         return;
     }
 
diff --git a/kded_ktp_integration_module.desktop b/ktp_integration_module.desktop
similarity index 99%
rename from kded_ktp_integration_module.desktop
rename to ktp_integration_module.desktop
index 0326e2b..afa6267 100644
--- a/kded_ktp_integration_module.desktop
+++ b/ktp_integration_module.desktop
@@ -2,7 +2,7 @@
 Type=Service
 X-KDE-ServiceTypes=KDEDModule
 X-KDE-Library=ktp_integration_module
-X-KDE-DBus-ModuleName=kded_ktp_integration_module
+X-KDE-DBus-ModuleName=ktp_integration_module
 X-KDE-Kded-autoload=false
 X-KDE-Kded-load-on-demand=true
 Name=Telepathy Integration Module
diff --git a/org.freedesktop.Telepathy.Client.KTp.KdedIntegrationModule.service.in b/org.freedesktop.Telepathy.Client.KTp.KdedIntegrationModule.service.in
index 80f0b3d..4ac8cb0 100644
--- a/org.freedesktop.Telepathy.Client.KTp.KdedIntegrationModule.service.in
+++ b/org.freedesktop.Telepathy.Client.KTp.KdedIntegrationModule.service.in
@@ -1,3 +1,3 @@
 [D-BUS Service]
 Name=org.freedesktop.Telepathy.Client.KTp.KdedIntegrationModule
-Exec=@DBUS_SEND_PATH@ --session --type=method_call --dest=org.kde.kded5 /kded org.kde.kded5.loadModule string:"kded_ktp_integration_module"
+Exec=@DBUS_SEND_PATH@ --session --type=method_call --dest=org.kde.kded5 /kded org.kde.kded5.loadModule string:"ktp_integration_module"
diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index 8489ff8..b74053b 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -37,7 +37,6 @@
 #include <KPluginFactory>
 
 K_PLUGIN_FACTORY(TelepathyModuleFactory, registerPlugin<TelepathyModule>(); )
-K_EXPORT_PLUGIN(TelepathyModuleFactory("ktp_integration_module", "kded_ktp_integration_module"))
 
 TelepathyModule::TelepathyModule(QObject *parent, const QList<QVariant> &args)
     : KDEDModule(parent),

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list