[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:12:37 UTC 2016


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

The following commit has been merged in the master branch:
commit 60582bf386f4d0b64d686cb8fd7c35615b42275d
Author: Daniele E. Domenichelli <daniele.domenichelli at gmail.com>
Date:   Wed Sep 28 02:17:31 2011 +0100

    Build with -DQT_NO_CAST_FROM_ASCII and -DQT_NO_KEYWORDS
    
    Reviewed-by: Martin Klapetek <martin.klapetek at gmail.com>
---
 CMakeLists.txt                   |  7 +++++--
 autoaway.cpp                     |  6 +++---
 config/telepathy-kded-config.cpp | 22 ++++++++++++----------
 telepathy-module.cpp             |  6 +++---
 telepathy-mpris.cpp              | 36 ++++++++++++++++++------------------
 5 files changed, 41 insertions(+), 36 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b1ab638..28a8d21 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -14,7 +14,10 @@ include (KDE4Defaults)
 # make some more macros available
 include (MacroLibrary)
 
-add_definitions (${KDE4_DEFINITIONS})
+add_definitions (${KDE4_DEFINITIONS}
+                 -DQT_NO_CAST_FROM_ASCII
+                 -DQT_NO_KEYWORDS
+)
 
 include_directories (${KDE4_INCLUDES}
                      ${CMAKE_CURRENT_BINARY_DIR}
@@ -46,4 +49,4 @@ install (FILES telepathy_kded_module.desktop
 )
 
 
-add_subdirectory(config)
\ No newline at end of file
+add_subdirectory(config)
diff --git a/autoaway.cpp b/autoaway.cpp
index 436cddd..812ba97 100644
--- a/autoaway.cpp
+++ b/autoaway.cpp
@@ -57,13 +57,13 @@ void AutoAway::timeoutReached(int id)
                 m_accountManager->onlineAccounts()->accounts().first()->currentPresence().type() != Tp::Presence::hidden().type()) {
 
                 m_prevPresence = m_accountManager->onlineAccounts()->accounts().first()->currentPresence();
-                emit setPresence(Tp::Presence::away());
+                Q_EMIT setPresence(Tp::Presence::away());
 
             }
         } else if (id == m_extAwayTimeoutId) {
             if (!m_accountManager->onlineAccounts()->accounts().isEmpty()) {
                 if (m_accountManager->onlineAccounts()->accounts().first()->currentPresence().type() == Tp::Presence::away().type()) {
-                    emit setPresence(Tp::Presence::xa());
+                    Q_EMIT setPresence(Tp::Presence::xa());
                 }
             }
         }
@@ -73,7 +73,7 @@ void AutoAway::timeoutReached(int id)
 void AutoAway::backFromIdle()
 {
     kDebug();
-    emit setPresence(m_prevPresence);
+    Q_EMIT setPresence(m_prevPresence);
 }
 
 void AutoAway::readConfig()
diff --git a/config/telepathy-kded-config.cpp b/config/telepathy-kded-config.cpp
index b9fb8a4..89ed2c8 100644
--- a/config/telepathy-kded-config.cpp
+++ b/config/telepathy-kded-config.cpp
@@ -70,20 +70,20 @@ void TelepathyKDEDConfig::load()
     KConfigGroup kdedConfig = config->group("KDED");
 
     //check if auto-away is enabled
-    bool autoAwayEnabled = kdedConfig.readEntry("autoAwayEnabled", true);
+    bool autoAwayEnabled = kdedConfig.readEntry(QLatin1String("autoAwayEnabled"), true);
 
     //default away time is 5 minutes
-    int awayTime = kdedConfig.readEntry("awayAfter", 5);
+    int awayTime = kdedConfig.readEntry(QLatin1String("awayAfter"), 5);
 
     ui->m_awayCheckBox->setChecked(autoAwayEnabled);
     ui->m_awayMins->setValue(awayTime);
     ui->m_awayMins->setEnabled(autoAwayEnabled);
 
     //check for x-away
-    bool autoXAEnabled = kdedConfig.readEntry("autoXAEnabled", true);
+    bool autoXAEnabled = kdedConfig.readEntry(QLatin1String("autoXAEnabled"), true);
 
     //default x-away time is 15 minutes
-    int xaTime = kdedConfig.readEntry("xaAfter", 15);
+    int xaTime = kdedConfig.readEntry(QLatin1String("xaAfter"), 15);
 
     //enable auto-x-away only if auto-away is enabled
     ui->m_xaCheckBox->setChecked(autoXAEnabled && autoAwayEnabled);
@@ -102,14 +102,16 @@ void TelepathyKDEDConfig::save()
     KSharedConfigPtr config = KSharedConfig::openConfig(QLatin1String("ktelepathyrc"));
     KConfigGroup kdedConfig = config->group("KDED");
 
-    kdedConfig.writeEntry("autoAwayEnabled", ui->m_awayCheckBox->isChecked());
-    kdedConfig.writeEntry("awayAfter", ui->m_awayMins->value());
-    kdedConfig.writeEntry("autoXAEnabled", ui->m_xaCheckBox->isChecked());
-    kdedConfig.writeEntry("xaAfter", ui->m_xaMins->value());
-    kdedConfig.writeEntry("nowPlayingEnabled", ui->m_nowPlayingCheckBox->isChecked());
+    kdedConfig.writeEntry(QLatin1String("autoAwayEnabled"), ui->m_awayCheckBox->isChecked());
+    kdedConfig.writeEntry(QLatin1String("awayAfter"), ui->m_awayMins->value());
+    kdedConfig.writeEntry(QLatin1String("autoXAEnabled"), ui->m_xaCheckBox->isChecked());
+    kdedConfig.writeEntry(QLatin1String("xaAfter"), ui->m_xaMins->value());
+    kdedConfig.writeEntry(QLatin1String("nowPlayingEnabled"), ui->m_nowPlayingCheckBox->isChecked());
     kdedConfig.sync();
 
-    QDBusMessage message = QDBusMessage::createSignal("/Telepathy", "org.kde.Telepathy", "settingsChange");
+    QDBusMessage message = QDBusMessage::createSignal(QLatin1String("/Telepathy"),
+                                                      QLatin1String( "org.kde.Telepathy"),
+                                                      QLatin1String("settingsChange"));
     QDBusConnection::sessionBus().send(message);
 }
 
diff --git a/telepathy-module.cpp b/telepathy-module.cpp
index cbf115a..526be4f 100644
--- a/telepathy-module.cpp
+++ b/telepathy-module.cpp
@@ -61,8 +61,8 @@ TelepathyModule::TelepathyModule(QObject* parent, const QList<QVariant>& args)
             SIGNAL(finished(Tp::PendingOperation*)),
             SLOT(onAccountManagerReady(Tp::PendingOperation*)));
 
-    QDBusConnection::sessionBus().connect(QString(), "/Telepathy", "org.kde.Telepathy",
-                                          "settingsChange", this, SIGNAL(settingsChanged()) );
+    QDBusConnection::sessionBus().connect(QString(), QLatin1String("/Telepathy"), QLatin1String("org.kde.Telepathy"),
+                                          QLatin1String("settingsChange"), this, SIGNAL(settingsChanged()) );
 
 }
 
@@ -94,7 +94,7 @@ void TelepathyModule::onAccountManagerReady(Tp::PendingOperation* op)
 void TelepathyModule::setPresence(const Tp::Presence &presence)
 {
     kDebug() << "Setting presence to" << presence.status() << presence.statusMessage();
-    foreach (const Tp::AccountPtr &account, m_accountManager->allAccounts()) {
+    Q_FOREACH (const Tp::AccountPtr &account, m_accountManager->allAccounts()) {
         if (account->isEnabled() && account->isValid() && account->isOnline()) {
             account->setRequestedPresence(presence);
         }
diff --git a/telepathy-mpris.cpp b/telepathy-mpris.cpp
index c43ea03..4b360cb 100644
--- a/telepathy-mpris.cpp
+++ b/telepathy-mpris.cpp
@@ -37,25 +37,25 @@ TelepathyMPRIS::TelepathyMPRIS(const Tp::AccountManagerPtr am, QObject* parent)
     m_originalPresence = am->onlineAccounts()->accounts().first()->currentPresence().statusMessage();
 
     QDBusConnectionInterface *i = QDBusConnection::sessionBus().interface();
-    QStringList mprisServices = i->registeredServiceNames().value().filter("org.mpris.MediaPlayer2");
+    QStringList mprisServices = i->registeredServiceNames().value().filter(QLatin1String("org.mpris.MediaPlayer2"));
 
     QString artist;
     QString title;
     QString album;
 
-    foreach (const QString &service, mprisServices) {
-        QDBusInterface mprisInterface(service, "/org/mpris/MediaPlayer2", "org.mpris.MediaPlayer2.Player");
+    Q_FOREACH (const QString &service, mprisServices) {
+        QDBusInterface mprisInterface(service, QLatin1String("/org/mpris/MediaPlayer2"), QLatin1String("org.mpris.MediaPlayer2.Player"));
         if (mprisInterface.property("PlaybackStatus") == QLatin1String("Playing")) {
             QMap<QString, QVariant> metadata = mprisInterface.property("Metadata").toMap();
-            artist = metadata.value("xesam:artist").toString();
-            title = metadata.value("xesam:title").toString();
-            album = metadata.value("xesam:album").toString();
+            artist = metadata.value(QLatin1String("xesam:artist")).toString();
+            title = metadata.value(QLatin1String("xesam:title")).toString();
+            album = metadata.value(QLatin1String("xesam:album")).toString();
 
             QDBusConnection::sessionBus().connect(
-                "org.mpris.MediaPlayer2.clementine",
-                "/org/mpris/MediaPlayer2",
-                "org.freedesktop.DBus.Properties",
-                "PropertiesChanged",
+                QLatin1String("org.mpris.MediaPlayer2.clementine"), //FIXME do not hardcode clementine here
+                QLatin1String("/org/mpris/MediaPlayer2"),
+                QLatin1String("org.freedesktop.DBus.Properties"),
+                QLatin1String("PropertiesChanged"),
                 this,
                 SLOT(onPlayerSignalReceived(const QString& ,
                                             const QVariantMap& ,
@@ -71,11 +71,11 @@ TelepathyMPRIS::TelepathyMPRIS(const Tp::AccountManagerPtr am, QObject* parent)
         Tp::SimplePresence presence;
         presence.type = currentPresence.type();
         presence.status = currentPresence.status();
-        presence.statusMessage = QString("Now listening to %1 by %2 from album %3").arg(title, artist, album);
+        presence.statusMessage = QString(QLatin1String("Now listening to %1 by %2 from album %3")).arg(title, artist, album);
 
         kDebug() << "Setting presence message to" << presence.statusMessage;
 
-        emit setPresence(presence);
+        Q_EMIT setPresence(presence);
     }
 }
 
@@ -93,7 +93,7 @@ void TelepathyMPRIS::onPlayerSignalReceived(const QString &interface, const QVar
         return;
     }
     //FIXME We can do less lame parsing
-    foreach (const QVariant &property, changedProperties.values()) {
+    Q_FOREACH (const QVariant &property, changedProperties.values()) {
         if (property.canConvert<QDBusArgument>()) {
             QString artist;
             QString title;
@@ -101,18 +101,18 @@ void TelepathyMPRIS::onPlayerSignalReceived(const QString &interface, const QVar
 
             QDBusArgument g = property.value<QDBusArgument>();
             QMap<QString, QVariant> k = qdbus_cast<QMap<QString, QVariant> >(g);
-            title = k.value("xesam:title").toString();
-            artist = k.value("xesam:artist").toString();
-            album = k.value("xesam:album").toString();
+            title = k.value(QLatin1String("xesam:title")).toString();
+            artist = k.value(QLatin1String("xesam:artist")).toString();
+            album = k.value(QLatin1String("xesam:album")).toString();
 
             Tp::Presence currentPresence = m_accountManager->onlineAccounts()->accounts().first()->currentPresence();
 
             Tp::SimplePresence presence;
             presence.type = currentPresence.type();
             presence.status = currentPresence.status();
-            presence.statusMessage = QString("Now listening to %1 by %2 from album %3").arg(title, artist, album);
+            presence.statusMessage = QString(QLatin1String("Now listening to %1 by %2 from album %3")).arg(title, artist, album);
 
-            emit setPresence(presence);
+            Q_EMIT setPresence(presence);
         }
 
         if (property.canConvert<QString>()) {

-- 
ktp-kded-integration-module packaging



More information about the pkg-kde-commits mailing list