Commit ad35ae75 authored by Piyush Aggarwal's avatar Piyush Aggarwal 🎮
Browse files

indicator: move KDBusService::Unique call to make sure it works on Windows

parent 9031ccad
Pipeline #65862 passed with stage
in 4 minutes and 14 seconds
......@@ -42,6 +42,8 @@ int main(int argc, char** argv)
i18n("(C) 2016 Aleix Pol Gonzalez"));
KAboutData::setApplicationData(about);
KDBusService dbusService(KDBusService::Unique);
  • Hi @piyushaggarwal this breaks the macOS version: yet here the dbus is not activated yet so that the process exits unexpectedly.

    I'm about to find a better solution for both Windows and macOS. How does it work on Windows?

  • sounds to me like a race condition, @wxiao .

    Anyways, this call was moved up because apparently KIconLoader does something weird that causes this call to basically be ineffective. If you move the call down again, and then start a second instance of the indicator.exe, you'll notice it running in the background. Similarly, all consecutive invocations for the indicator will cause an instance of indicator.exe in the background.

  • Ideally (as in, current behavior on master), this call makes sure that no second instance of kdeconnect-indicator process pops up even if user double clicks the indicator executable.

  • In fact, on macOS, the indicator brings up kdeconnectd by calling helper.daemonHook; and the kdeconnectd brings up the dbus to communicate with the indicator.

    So, it is definitely not a race condition. It's always a determined failure XD

  • Then I'm about to just disable this line through macro on macOS.

  • In fact, on macOS, the indicator brings up kdeconnectd by calling helper.daemonHook; and the kdeconnectd brings up the dbus to communicate with the indicator.

    ah, sounds like you'll need IndicatorHelper before the KDBusService call.. would that work?

  • @wxiao check out !403 (closed)

Please register or sign in to reply
// Trigger loading the KIconLoader plugin
about.setProgramLogo(QIcon(QStringLiteral(":/icons/kdeconnect/kdeconnect.svg")));
......@@ -61,8 +63,6 @@ int main(int argc, char** argv)
return -1;
}
KDBusService dbusService(KDBusService::Unique);
DevicesModel model;
model.setDisplayFilter(DevicesModel::Reachable | DevicesModel::Paired);
QMenu* menu = new QMenu;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment