diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2013-10-15 16:06:16 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2013-10-16 15:17:00 +0300 |
commit | 26be2a9f06cbd303d5943fd336bf10991b95081e (patch) | |
tree | 3a5fc2d2fa7715a325421fac3f56a561a1d782a1 | |
parent | e22ce24755f9a4cb5139ba0171a932b4b3e5037c (diff) |
Use exclude.txt to exclude unsupported demosv1.0.0-RC5v1.0.0-RC4v1.0.0
Use "base OS + HW" to list a setup that doesn't support
a specific demo, for example:
android_nexus7
android_beagleboard
":" can be used as a separator if more than one setup does
not support a demo.
Change-Id: I5f666f3bb6a6448e8947d56c975062a4c65aadb1
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Rainer Keller <rainer.keller@digia.com>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r-- | src/applicationsmodel.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/applicationsmodel.cpp b/src/applicationsmodel.cpp index bd29f04..6389fce 100644 --- a/src/applicationsmodel.cpp +++ b/src/applicationsmodel.cpp @@ -28,6 +28,7 @@ public: { QList<AppData> results; QList<QString> roots = root.split(":"); + target = qgetenv("B2QT_BASE") + "-" + qgetenv("B2QT_PLATFORM"); foreach (const QString &root, roots) { results += indexDirectory(root); } @@ -46,14 +47,20 @@ public: if (!QFile::exists(path + "/main.qml")) continue; + QFile excludeFile(path + "/exclude.txt"); + if (excludeFile.open(QFile::ReadOnly)) { + const QStringList excludeList = QString::fromUtf8(excludeFile.readAll()).split(":"); + if (excludeList.contains(target)) + continue; + } + AppData data; data.location = QUrl::fromLocalFile(path); - if (QFile::exists(path + "/title.txt")) { - QFile titleFile(path + "/title.txt"); - if (titleFile.open(QFile::ReadOnly)) - data.name = QString::fromUtf8(titleFile.readAll()); - } + QFile titleFile(path + "/title.txt"); + if (titleFile.open(QFile::ReadOnly)) + data.name = QString::fromUtf8(titleFile.readAll()); + if (data.name.isEmpty()) data.name = iterator.fileName(); @@ -76,6 +83,7 @@ public: QString root; ApplicationsModel *model; + QString target; }; ApplicationsModel::ApplicationsModel(QObject *parent) : |