Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add API to register app ID #183

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Conversation

jadahl
Copy link

@jadahl jadahl commented Jan 14, 2025

Meant to be used by host apps to more reliably get an app ID. See flatpak/xdg-desktop-portal#1521.

Copy link
Member

@GeorgesStavracas GeorgesStavracas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, the only thing I think is missing is the documentation blocks for introspection.

@jadahl
Copy link
Author

jadahl commented Jan 15, 2025

Tweaked the qt examples a bit. The qt5 one now plumbs the app Id via QApplication, but couldn't do that in qt6 - I had to register the app ID before doing QApplication a(argc, argv); since constructing the QApplication already started to talk to the portal (I'm guessing for settings or something).

These are no-ops when running under flatpak or snap, but when running on
the host, they will call Register() on org.freedesktop.host.portal.Registry.
@ilya-fedin
Copy link
Contributor

The qt5 one now plumbs the app Id via QApplication, but couldn't do that in qt6 - I had to register the app ID before doing QApplication a(argc, argv); since constructing the QApplication already started to talk to the portal (I'm guessing for settings or something).

desktopFileName and setDesktopFileName are static methods of QGuiApplication (which QApplication inherits from), you can use them before constructing QApplication just fine

@smcv
Copy link
Contributor

smcv commented Feb 12, 2025

desktopFileName and setDesktopFileName are static methods of QGuiApplication (which QApplication inherits from), you can use them before constructing QApplication just fine

Does this mean it would be more correct to call them as QGuiApplication::setDesktopFileName(APP_ID) and QGuiApplication::desktopFileName(), rather than app->setDesktopFileName(APP_ID) and app->desktopFileName()?

@ilya-fedin
Copy link
Contributor

Does this mean it would be more correct to call them as QGuiApplication::setDesktopFileName(APP_ID) and QGuiApplication::desktopFileName(), rather than app->setDesktopFileName(APP_ID) and app->desktopFileName()?

Exactly

Copy link
Contributor

@smcv smcv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check whether the Qt code paths can be improved based on what @ilya-fedin said

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants