Skip to content

Commit 14619b1

Browse files
authored
use QStandardPaths::ApplicationsLocation for open with (flameshot-org#3663)
1 parent fe3bcac commit 14619b1

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/tools/launcher/applauncherwidget.cpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,14 @@ AppLauncherWidget::AppLauncherWidget(const QPixmap& p, QWidget* parent)
6262
m_parser.processDirectory(allUserAppsFolder);
6363
}
6464
#else
65-
QString dirLocal = QDir::homePath() + "/.local/share/applications/";
66-
QDir appsDirLocal(dirLocal);
67-
m_parser.processDirectory(appsDirLocal);
65+
QStringList appsLocations =
66+
QStandardPaths::standardLocations(QStandardPaths::ApplicationsLocation);
67+
68+
for (auto appsLocation : appsLocations) {
69+
QDir appsDir(appsLocation);
70+
m_parser.processDirectory(QDir(appsDir));
71+
}
6872

69-
QString dir = QStringLiteral("/usr/share/applications/");
70-
QDir appsDir(dir);
71-
m_parser.processDirectory(appsDir);
7273
#endif
7374

7475
initAppMap();

0 commit comments

Comments
 (0)