Skip to content

Commit

Permalink
allow one instance per skill
Browse files Browse the repository at this point in the history
  • Loading branch information
notmart committed Dec 13, 2019
1 parent eebe0be commit e1e2a82
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ find_package(KF5 ${KF5_MIN_VERSION} REQUIRED COMPONENTS I18n)
if(NOT CMAKE_SYSTEM_NAME STREQUAL "Android")
find_package(Qt5Widgets ${QT_MIN_VERSION} REQUIRED)
find_package(KF5Plasma ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5DBusAddons ${KF5_MIN_VERSION} REQUIRED)
find_package(KF5KIO ${KF5_MIN_VERSION} REQUIRED) # FIXME look for "KIOWidgets" (KRun) explicitly
endif()

Expand Down
1 change: 1 addition & 0 deletions application/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ if (CMAKE_SYSTEM_NAME STREQUAL "Android")
else()
set(mycroft_gui_app_EXTRA_LIBS
Qt5::Widgets
KF5::DBusAddons
)
endif()

Expand Down
10 changes: 10 additions & 0 deletions application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <QGuiApplication>
#else
#include <QApplication>
#include <KDBusService>
#endif

#include "speechintent.h"
Expand Down Expand Up @@ -67,6 +68,8 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
#endif

app.setApplicationName(QStringLiteral("mycroft.gui"));
app.setOrganizationDomain(QStringLiteral("kde.org"));
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("mycroft")));

// NOTE: Have to manually implement a --help option because the parser.addHelpOption() would
Expand All @@ -85,6 +88,13 @@ int main(int argc, char *argv[])
int height = parser.value(heightOption).toInt();
bool maximize = parser.isSet(maximizeOption);

#ifndef Q_OS_ANDROID
if (parser.isSet(skillOption)) {
app.setApplicationName(QStringLiteral("mycroft.gui.") + parser.value(skillOption));
}
KDBusService service(KDBusService::Unique);
#endif

QQmlApplicationEngine engine;
engine.rootContext()->setContextProperty(QStringLiteral("deviceWidth"), width);
engine.rootContext()->setContextProperty(QStringLiteral("deviceHeight"), height);
Expand Down

0 comments on commit e1e2a82

Please sign in to comment.