diff options
author | Gatis Paeglis <gatis.paeglis@digia.com> | 2013-10-03 15:07:32 +0200 |
---|---|---|
committer | Gatis Paeglis <gatis.paeglis@digia.com> | 2013-10-08 11:18:02 +0300 |
commit | e22ce24755f9a4cb5139ba0171a932b4b3e5037c (patch) | |
tree | 879ac3409f7e060a322ba00dd8ab107290cd777c | |
parent | 00f8fc178831d703121c6960448362fac2834343 (diff) |
Use contents of title.txt as applications namev1.0.0-RC2
Current implementation uses demo application's directory name as
a title in the qtlauncher. This is problematic when we want to run a
qmake on a demo and at the same time have a title that consists of
spaces.
Therefore if a demo provides a file called "title.txt" we use its
content as a title.
Change-Id: Id6e2ad94dca3b021acb9ad3ece952f48053e4b03
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@digia.com>
-rw-r--r-- | src/applicationsmodel.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/applicationsmodel.cpp b/src/applicationsmodel.cpp index 107188f..bd29f04 100644 --- a/src/applicationsmodel.cpp +++ b/src/applicationsmodel.cpp @@ -48,7 +48,15 @@ public: AppData data; data.location = QUrl::fromLocalFile(path); - data.name = iterator.fileName(); + + if (QFile::exists(path + "/title.txt")) { + QFile titleFile(path + "/title.txt"); + if (titleFile.open(QFile::ReadOnly)) + data.name = QString::fromUtf8(titleFile.readAll()); + } + if (data.name.isEmpty()) + data.name = iterator.fileName(); + data.main = "main.qml"; QFile file(path + "/description.txt"); |