Changeset View
Changeset View
Standalone View
Standalone View
src/appchooser.cpp
Show All 13 Lines | |||||
14 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | 14 | * License along with this library. If not, see <http://www.gnu.org/licenses/>. | ||
15 | * | 15 | * | ||
16 | * Authors: | 16 | * Authors: | ||
17 | * Jan Grulich <jgrulich@redhat.com> | 17 | * Jan Grulich <jgrulich@redhat.com> | ||
18 | */ | 18 | */ | ||
19 | 19 | | |||
20 | #include "appchooser.h" | 20 | #include "appchooser.h" | ||
21 | #include "appchooserdialog.h" | 21 | #include "appchooserdialog.h" | ||
22 | #include "utils.h" | ||||
22 | 23 | | |||
23 | #include <QLoggingCategory> | 24 | #include <QLoggingCategory> | ||
24 | 25 | | |||
25 | #include <KLocalizedString> | 26 | #include <KLocalizedString> | ||
26 | 27 | | |||
27 | Q_LOGGING_CATEGORY(XdgDesktopPortalKdeAppChooser, "xdp-kde-app-chooser") | 28 | Q_LOGGING_CATEGORY(XdgDesktopPortalKdeAppChooser, "xdp-kde-app-chooser") | ||
28 | 29 | | |||
29 | 30 | | |||
Show All 22 Lines | 46 | { | |||
52 | 53 | | |||
53 | QString latestChoice; | 54 | QString latestChoice; | ||
54 | 55 | | |||
55 | if (options.contains(QLatin1String("last_choice"))) { | 56 | if (options.contains(QLatin1String("last_choice"))) { | ||
56 | latestChoice = options.value(QLatin1String("last_choice")).toString(); | 57 | latestChoice = options.value(QLatin1String("last_choice")).toString(); | ||
57 | } | 58 | } | ||
58 | 59 | | |||
59 | AppChooserDialog *appDialog = new AppChooserDialog(choices, latestChoice, options.value(QLatin1String("filename")).toString()); | 60 | AppChooserDialog *appDialog = new AppChooserDialog(choices, latestChoice, options.value(QLatin1String("filename")).toString()); | ||
61 | Utils::setParentWindow(appDialog, parent_window); | ||||
60 | 62 | | |||
61 | if (appDialog->exec()) { | 63 | if (appDialog->exec()) { | ||
62 | results.insert(QLatin1String("choice"), appDialog->selectedApplication()); | 64 | results.insert(QLatin1String("choice"), appDialog->selectedApplication()); | ||
63 | appDialog->deleteLater(); | 65 | appDialog->deleteLater(); | ||
64 | return 0; | 66 | return 0; | ||
65 | } | 67 | } | ||
66 | appDialog->deleteLater(); | 68 | appDialog->deleteLater(); | ||
67 | 69 | | |||
68 | return 1; | 70 | return 1; | ||
69 | } | 71 | } |