Skip to content

Commit

Permalink
fix uniqueness when called with a skill
Browse files Browse the repository at this point in the history
  • Loading branch information
notmart committed Dec 23, 2019
1 parent 649abab commit 2c0c009
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions application/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,29 +88,30 @@ 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);
engine.rootContext()->setContextProperty(QStringLiteral("deviceMaximized"), maximize);
engine.rootContext()->setContextProperty(QStringLiteral("hideTextInput"), parser.isSet(hideTextInputOption));
engine.rootContext()->setContextProperty(QStringLiteral("globalScreenRotation"), parser.isSet(rotateScreen) ? 180 : 0);

const QString singleSkill = parser.value(skillOption);
QString singleSkill = parser.value(skillOption);
if (singleSkill.endsWith(QStringLiteral(".home"))) {
engine.rootContext()->setContextProperty(QStringLiteral("singleSkill"), singleSkill.left(singleSkill.indexOf(QStringLiteral(".home"))));
singleSkill = singleSkill.left(singleSkill.indexOf(QStringLiteral(".home")));
engine.rootContext()->setContextProperty(QStringLiteral("singleSkill"), singleSkill);
engine.rootContext()->setContextProperty(QStringLiteral("singleSkillHome"), singleSkill);
} else {
engine.rootContext()->setContextProperty(QStringLiteral("singleSkill"), singleSkill);
engine.rootContext()->setContextProperty(QStringLiteral("singleSkillHome"), QString());
}

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

AppSettings *appSettings = new AppSettings(&view);
engine.rootContext()->setContextProperty(QStringLiteral("applicationSettings"), appSettings);

Expand Down

0 comments on commit 2c0c009

Please sign in to comment.