summaryrefslogtreecommitdiffstats
path: root/rbutil/rbutilqt/base
diff options
context:
space:
mode:
Diffstat (limited to 'rbutil/rbutilqt/base')
-rw-r--r--rbutil/rbutilqt/base/playerbuildinfo.cpp47
-rw-r--r--rbutil/rbutilqt/base/playerbuildinfo.h7
-rw-r--r--rbutil/rbutilqt/base/systeminfo.cpp33
-rw-r--r--rbutil/rbutilqt/base/systeminfo.h12
4 files changed, 45 insertions, 54 deletions
diff --git a/rbutil/rbutilqt/base/playerbuildinfo.cpp b/rbutil/rbutilqt/base/playerbuildinfo.cpp
index fb8b121e8f..f49917cfef 100644
--- a/rbutil/rbutilqt/base/playerbuildinfo.cpp
+++ b/rbutil/rbutilqt/base/playerbuildinfo.cpp
@@ -57,15 +57,17 @@ const static struct {
PlayerBuildInfo::DeviceInfo item;
const char* name;
} PlayerInfoList[] = {
- { PlayerBuildInfo::BuildStatus, "status/:target:" },
- { PlayerBuildInfo::DisplayName, ":target:/name" },
- { PlayerBuildInfo::BootloaderMethod, ":target:/bootloadermethod" },
- { PlayerBuildInfo::BootloaderName, ":target:/bootloadername" },
- { PlayerBuildInfo::BootloaderFile, ":target:/bootloaderfile" },
- { PlayerBuildInfo::BootloaderFilter, ":target:/bootloaderfilter" },
- { PlayerBuildInfo::Encoder, ":target:/encoder" },
- { PlayerBuildInfo::Brand, ":target:/brand" },
- { PlayerBuildInfo::PlayerPicture, ":target:/playerpic" },
+ { PlayerBuildInfo::BuildStatus, "status/:target:" },
+ { PlayerBuildInfo::DisplayName, ":target:/name" },
+ { PlayerBuildInfo::BootloaderMethod, ":target:/bootloadermethod" },
+ { PlayerBuildInfo::BootloaderName, ":target:/bootloadername" },
+ { PlayerBuildInfo::BootloaderFile, ":target:/bootloaderfile" },
+ { PlayerBuildInfo::BootloaderFilter, ":target:/bootloaderfilter" },
+ { PlayerBuildInfo::Encoder, ":target:/encoder" },
+ { PlayerBuildInfo::Brand, ":target:/brand" },
+ { PlayerBuildInfo::PlayerPicture, ":target:/playerpic" },
+ { PlayerBuildInfo::TargetNamesAll, "" },
+ { PlayerBuildInfo::TargetNamesEnabled, "" },
};
const static struct {
@@ -216,6 +218,14 @@ QVariant PlayerBuildInfo::value(DeviceInfo item, QString target)
result = -1;
break;
}
+ case TargetNamesAll:
+ // list of all internal target names. Doesn't depend on the passed target.
+ result = targetNames(true);
+ break;
+ case TargetNamesEnabled:
+ // list of all non-disabled target names. Doesn't depend on the passed target.
+ result = targetNames(false);
+ break;
default:
result = playerInfo.value(s);
@@ -263,3 +273,22 @@ QString PlayerBuildInfo::statusAsString(QString platform)
return result;
}
+
+
+QStringList PlayerBuildInfo::targetNames(bool all)
+{
+ QStringList result;
+ playerInfo.beginGroup("platforms");
+ QStringList a = playerInfo.childKeys();
+ playerInfo.endGroup();
+ for(int i = 0; i < a.size(); i++)
+ {
+ QString target = playerInfo.value("platforms/" + a.at(i), "null").toString();
+ if(playerInfo.value(target + "/status").toString() != "disabled" || all) {
+ result.append(target);
+ }
+ }
+ result.removeDuplicates();
+ return result;
+}
+
diff --git a/rbutil/rbutilqt/base/playerbuildinfo.h b/rbutil/rbutilqt/base/playerbuildinfo.h
index 81d7d97312..5307148ff5 100644
--- a/rbutil/rbutilqt/base/playerbuildinfo.h
+++ b/rbutil/rbutilqt/base/playerbuildinfo.h
@@ -66,6 +66,9 @@ public:
Encoder,
Brand,
PlayerPicture,
+
+ TargetNamesAll,
+ TargetNamesEnabled,
};
enum SystemUrl {
@@ -97,6 +100,10 @@ protected:
explicit PlayerBuildInfo();
private:
+ //! Return a list with all target names (as used internally).
+ //! @all false filter out all targets with status = disabled.
+ QStringList targetNames(bool all);
+
static PlayerBuildInfo* infoInstance;
QSettings* serverInfo;
QSettings playerInfo;
diff --git a/rbutil/rbutilqt/base/systeminfo.cpp b/rbutil/rbutilqt/base/systeminfo.cpp
index aa847540b9..6717b120cc 100644
--- a/rbutil/rbutilqt/base/systeminfo.cpp
+++ b/rbutil/rbutilqt/base/systeminfo.cpp
@@ -38,39 +38,6 @@ void SystemInfo::ensureSystemInfoExists()
}
-QStringList SystemInfo::platforms(enum SystemInfo::PlatformType type, QString variant)
-{
- ensureSystemInfoExists();
-
- QStringList result;
- systemInfos->beginGroup("platforms");
- QStringList a = systemInfos->childKeys();
- systemInfos->endGroup();
- for(int i = 0; i < a.size(); i++)
- {
- QString target = systemInfos->value("platforms/"+a.at(i), "null").toString();
- QRegExp regex("\\..*$");
- QString targetbase = target;
- targetbase.remove(regex);
- // only add target if its not disabled unless Platform*Disabled requested
- if(type != PlatformAllDisabled && type != PlatformBaseDisabled
- && type != PlatformVariantDisabled
- && systemInfos->value(target+"/status").toString() == "disabled")
- continue;
- // report only matching target if PlatformVariant* is requested
- if((type == PlatformVariant || type == PlatformVariantDisabled)
- && (targetbase != variant))
- continue;
- // report only base targets when PlatformBase* is requested
- if((type == PlatformBase || type == PlatformBaseDisabled))
- result.append(targetbase);
- else
- result.append(target);
- }
- result.removeDuplicates();
- return result;
-}
-
QMap<QString, QStringList> SystemInfo::languages(bool namesOnly)
{
ensureSystemInfoExists();
diff --git a/rbutil/rbutilqt/base/systeminfo.h b/rbutil/rbutilqt/base/systeminfo.h
index 7b5b68131b..d5a99082aa 100644
--- a/rbutil/rbutilqt/base/systeminfo.h
+++ b/rbutil/rbutilqt/base/systeminfo.h
@@ -34,18 +34,6 @@ class SystemInfo : public QObject
MapIncompatible,
};
- enum PlatformType {
- PlatformAll,
- PlatformAllDisabled,
- PlatformBase,
- PlatformBaseDisabled,
- PlatformVariant,
- PlatformVariantDisabled
- };
-
- //! return a list of all platforms (rbutil internal names)
- static QStringList platforms(enum PlatformType type = PlatformAll,
- QString variant="");
//! returns a map of all languages.
//! Maps <language code> to (<language name>, <display name>)
static QMap<QString, QStringList> languages(bool namesOnly = false);