Add src/xmbentry.h
This commit is contained in:
parent
68b67a964c
commit
1aa795ebf7
39
src/xmbentry.h
Normal file
39
src/xmbentry.h
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
#pragma once
|
||||||
|
#include <QString>
|
||||||
|
#include <QVariantMap>
|
||||||
|
|
||||||
|
enum class EntryType {
|
||||||
|
Desktop,
|
||||||
|
Link,
|
||||||
|
JsonAction,
|
||||||
|
Folder,
|
||||||
|
Unknown
|
||||||
|
};
|
||||||
|
|
||||||
|
struct XmbEntry {
|
||||||
|
QString title;
|
||||||
|
QString subtitle;
|
||||||
|
QString icon; // URL/QRC/file path
|
||||||
|
EntryType type = EntryType::Unknown;
|
||||||
|
|
||||||
|
// Launch data:
|
||||||
|
QString exec; // command or desktopExec
|
||||||
|
QStringList args;
|
||||||
|
QString path; // file/folder path
|
||||||
|
QString gameId; // steam game id
|
||||||
|
QString url; // steam://... or http(s)://...
|
||||||
|
|
||||||
|
QVariantMap toVariant() const {
|
||||||
|
QVariantMap m;
|
||||||
|
m["title"] = title;
|
||||||
|
m["subtitle"] = subtitle;
|
||||||
|
m["icon"] = icon;
|
||||||
|
m["type"] = static_cast<int>(type);
|
||||||
|
m["exec"] = exec;
|
||||||
|
m["args"] = args;
|
||||||
|
m["path"] = path;
|
||||||
|
m["gameId"] = gameId;
|
||||||
|
m["url"] = url;
|
||||||
|
return m;
|
||||||
|
}
|
||||||
|
};
|
||||||
Loading…
x
Reference in New Issue
Block a user