diff --git a/applications_xdg/src/plugin.cpp b/applications_xdg/src/plugin.cpp index 6e65e8d9..bf37cf73 100644 --- a/applications_xdg/src/plugin.cpp +++ b/applications_xdg/src/plugin.cpp @@ -430,7 +430,8 @@ vector Plugin::indexApps(const bool &abort) const // To determine the ID of a desktop file, make its full path relative to // the $XDG_DATA_DIRS component in which the desktop file is installed, // remove the "applications/" prefix, and turn '/' into '-'. - QString desktopFileId = fIt.filePath().remove(QRegularExpression("^.*applications/")).replace("/","-"); + static QRegularExpression re("^.*applications/"); + QString desktopFileId = fIt.filePath().remove(re).replace("/","-"); if (const auto &[it, success] = desktopFiles.emplace(desktopFileId, fIt.filePath()); !success) DEBG << QString("Desktop file '%1' will be skipped: Shadowed by '%2'").arg(fIt.filePath(), desktopFiles[desktopFileId]);