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/main.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/main.cpp')
-rw-r--r-- | app/main.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/app/main.cpp b/app/main.cpp index 528f840..a5bab67 100644 --- a/app/main.cpp +++ b/app/main.cpp @@ -29,10 +29,6 @@ #include <libhomescreen.hpp> #endif -#ifdef HAVE_LIGHTMEDIASCANNER -#include "lightmediascanner.h" -#endif - #ifdef HAVE_DBUS #include "dbus.h" #endif @@ -73,20 +69,19 @@ int main(int argc, char *argv[]) qmlRegisterType<PlaylistWithMetadata>("MediaPlayer", 1, 0, "PlaylistWithMetadata"); - QVariantList mediaFiles; + QQmlApplicationEngine engine; + QQmlContext *context = engine.rootContext(); -#ifdef HAVE_LIGHTMEDIASCANNER - mediaFiles = LightMediaScanner::processLightMediaScanner(); -#else +#ifndef HAVE_LIGHTMEDIASCANNER + QVariantList mediaFiles; QString music; for (const auto &music : QStandardPaths::standardLocations(QStandardPaths::MusicLocation)) { mediaFiles.append(readMusicFile(music)); } -#endif - QQmlApplicationEngine engine; - QQmlContext *context = engine.rootContext(); + context->setContextProperty("mediaFiles", mediaFiles); +#endif QCommandLineParser parser; parser.addPositionalArgument("port", app.translate("main", "port for binding")); @@ -110,8 +105,6 @@ int main(int argc, char *argv[]) context->setContextProperty(QStringLiteral("bindingAddress"), bindingAddress); } - context->setContextProperty("mediaFiles", mediaFiles); - #if defined(HAVE_DBUS) DbusService dbus_service; context->setContextProperty("dbus", &dbus_service); @@ -120,10 +113,6 @@ int main(int argc, char *argv[]) engine.load(QUrl(QStringLiteral("qrc:/MediaPlayer.qml"))); #if defined(HAVE_DBUS) -#if defined(HAVE_LIGHTMEDIASCANNER) - if (!dbus_service.enableLMS()) - qWarning() << "Cannot run enableLMS"; -#endif if (!dbus_service.enableBluetooth()) qWarning() << "Cannot run enableBluetooth"; #endif |