diff options
author | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-05-25 16:52:13 -0700 |
---|---|---|
committer | Matt Ranostay <matt.ranostay@konsulko.com> | 2017-06-02 22:28:18 -0700 |
commit | f3ddc376291262a6b305cc2b0a52792abdc7c85c (patch) | |
tree | 5e2685d2f62690e32ee8b4920e8dd139bab322d1 /app/dbus.cpp | |
parent | b0f682b1579e520896ccd5492d6666d962a0c226 (diff) |
binding: remove non-binding lightmediascanner detection
Switch to binding over raw DBus commands for media detection.
Bug-AGL: SPEC-610
Change-Id: Icf924000d721d92a1056962e55f5c2c75f159ee5
Signed-off-by: Matt Ranostay <matt.ranostay@konsulko.com>
Diffstat (limited to 'app/dbus.cpp')
-rw-r--r-- | app/dbus.cpp | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/app/dbus.cpp b/app/dbus.cpp index 3c298a0..a562989 100644 --- a/app/dbus.cpp +++ b/app/dbus.cpp @@ -22,60 +22,6 @@ DbusService::DbusService(QObject *parent) : QObject(parent) } /* - * Light Media Scanner - */ - -bool DbusService::enableLMS() -{ - QDBusConnection session_bus = QDBusConnection::sessionBus(); - QDBusConnection system_bus = QDBusConnection::systemBus(); - bool ret; - - if (!session_bus.isConnected()) - return false; - - if (!system_bus.isConnected()) - return false; - - ret = session_bus.connect(QString("org.lightmediascanner"), QString("/org/lightmediascanner/Scanner1"), "org.freedesktop.DBus.Properties", "PropertiesChanged", this, SLOT(lmsUpdate(QString,QVariantMap,QStringList))); - if (!ret) - return false; - - /* Only subscribe to DeviceRemoved events, since we need lms scan to complete on insert */ - return system_bus.connect(QString("org.freedesktop.UDisks"), QString("/org/freedesktop/UDisks"), "org.freedesktop.UDisks", "DeviceRemoved", this, SLOT(mediaRemoved(QDBusObjectPath))); -} - -void DbusService::mediaRemoved(const QDBusObjectPath&) -{ - emit stopPlayback(); -} - -#if defined(HAVE_LIGHTMEDIASCANNER) -void DbusService::lmsUpdate(const QString&, const QVariantMap& map, const QStringList&) -{ - QVariantList mediaFiles; - QString music; - - if (!map.contains("IsScanning") && !map.contains("WriteLocked")) - return; - - if (map["IsScanning"].toBool() || map["WriteLocked"].toBool()) - return; - - mediaFiles = LightMediaScanner::processLightMediaScanner(); - - if (!mediaFiles.isEmpty()) - emit processPlaylistUpdate(mediaFiles); - else - emit processPlaylistHide(); -} -#else -void DbusService::lmsUpdate(const QString&, const QVariantMap&, const QStringList&) -{ -} -#endif - -/* * Bluetooth */ |