Add src/xmbentry.h

This commit is contained in:
milonekrone 2026-01-14 16:06:39 +01:00
parent 68b67a964c
commit 1aa795ebf7

39
src/xmbentry.h Normal file
View 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;
}
};