mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-08-02 01:34:46 +00:00
manage arguments in activateRequested
This commit is contained in:
parent
c267e6e689
commit
356c504183
1 changed files with 7 additions and 1 deletions
|
|
@ -95,10 +95,16 @@ int main(int argc, char **argv)
|
||||||
QWindow *window = qobject_cast<QWindow *>(obj->rootObject());
|
QWindow *window = qobject_cast<QWindow *>(obj->rootObject());
|
||||||
if (window) {
|
if (window) {
|
||||||
QObject::connect(&service, &KDBusService::activateRequested, [=](const QStringList &arguments, const QString &workingDirectory) {
|
QObject::connect(&service, &KDBusService::activateRequested, [=](const QStringList &arguments, const QString &workingDirectory) {
|
||||||
Q_UNUSED(arguments)
|
|
||||||
Q_UNUSED(workingDirectory);
|
Q_UNUSED(workingDirectory);
|
||||||
window->show();
|
window->show();
|
||||||
window->requestActivate();
|
window->requestActivate();
|
||||||
|
if (arguments.length() > 0) {
|
||||||
|
QString numberArg = arguments[1];
|
||||||
|
if (numberArg.startsWith("call://")) {
|
||||||
|
numberArg = numberArg.mid(7);
|
||||||
|
}
|
||||||
|
obj->rootObject()->metaObject()->invokeMethod(obj->rootObject(), "call", Q_ARG(QVariant, numberArg));
|
||||||
|
}
|
||||||
});
|
});
|
||||||
if (!parser.isSet(daemonOption)) {
|
if (!parser.isSet(daemonOption)) {
|
||||||
window->show();
|
window->show();
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue