Another approach to use the enum everywhere in ApplicationListModel

This commit is contained in:
Jonah Brüchert 2020-03-21 12:48:45 +01:00
parent 59f61325a7
commit 5f0e3ec05d
2 changed files with 10 additions and 10 deletions

View file

@ -94,7 +94,7 @@ void ApplicationListModel::sycocaDbChanged(const QStringList &changes)
loadApplications();
}
bool appNameLessThan(const ApplicationData &a1, const ApplicationData &a2)
bool appNameLessThan(const ApplicationListModel::ApplicationData &a1, const ApplicationListModel::ApplicationData &a2)
{
return a1.name.toLower() < a2.name.toLower();
}

View file

@ -32,15 +32,6 @@ class QString;
class ApplicationListModel;
struct ApplicationData {
QString name;
QString icon;
QString storageId;
QString entryPath;
int location = 0; //FIXME
bool startupNotify = true;
};
class ApplicationListModel : public QAbstractListModel {
Q_OBJECT
@ -56,6 +47,15 @@ public:
};
Q_ENUM(LauncherLocation)
struct ApplicationData {
QString name;
QString icon;
QString storageId;
QString entryPath;
LauncherLocation location = LauncherLocation::Grid;
bool startupNotify = true;
};
enum Roles {
ApplicationNameRole = Qt::UserRole + 1,
ApplicationIconRole,