Introduce EntryType. Retire userEntry boolean

Introduce EntryType, allowing to distnguish between:

- inherietd entries: Those inherit their values from
other entries, typcally system entries. They do not
allow overwriting the value, except row/col.
- system entries: those not created by the user in any way,
usually .desktop files in /usr/share/applications/...
- user entries: those that have been created by the user.
they can however also inherit, and overwrite inherited values.

inherited are used for the "favourites" feature.
This commit is contained in:
2020-10-04 19:30:41 +02:00
والد 95e855f325
کامیت 79d15fb628
4فایلهای تغییر یافته به همراه103 افزوده شده و 66 حذف شده

مشاهده پرونده

@ -15,10 +15,17 @@ class ConfigFormatException : public std::runtime_error
}
};
enum EntryType
{
USER,
INHERIT,
SYSTEM
};
class EntryConfig
{
public:
bool userEntry = false;
EntryType type = SYSTEM;
bool hidden = false;
QString entryPath;
QString key;
@ -42,7 +49,7 @@ class EntryProvider
EntryConfig readqsrunFile(const QString &path);
EntryConfig readFromDesktopFile(const QString &path);
std::optional<EntryConfig> readEntryFromPath(const QString &path);
QVector<EntryConfig> readConfig(QStringList paths, bool userentrymode = false);
QVector<EntryConfig> readConfig(QStringList paths);
QString resolveEntryPath(QString path);
public: