EntryProvider: Introduce readEntryFromPath()

Inheritance: Use readEntryFromPath instead of assuming always .desktop
files

Switch project to C++17
This commit is contained in:
2020-09-06 22:23:36 +02:00
父節點 36b6390292
當前提交 edb781580e
共有 3 個文件被更改,包括 33 次插入19 次删除

查看文件

@@ -2,6 +2,7 @@
#define ENTRYPROVIDER_H
#include <QIcon>
#include <QSettings>
#include <optional>
class ConfigFormatException : public std::runtime_error
{
@@ -35,8 +36,9 @@ class EntryProvider
QStringList _desktopIgnoreArgs;
QStringList userEntriesDirsPaths;
QStringList systemEntriesDirsPaths;
EntryConfig readFromFile(const QString &path);
EntryConfig readqsrunFile(const QString &path);
EntryConfig readFromDesktopFile(const QString &path);
std::optional<EntryConfig> readEntryFromPath(const QString &path);
QVector<EntryConfig> readConfig(QStringList paths);
QString resolveEntryPath(QString path);