diff options
author | Kari Oikarinen <kari.oikarinen@qt.io> | 2017-04-26 15:08:02 +0300 |
---|---|---|
committer | Kari Oikarinen <kari.oikarinen@qt.io> | 2017-05-02 10:37:54 +0000 |
commit | 991ce80e3662e9e27eef2499dff3578b79e76fe0 (patch) | |
tree | 3bb23ae454699dd708d89d3156b74be999e9ea93 | |
parent | d4af031c38f5d820ee81dc51ab2f0ab3f5f92b29 (diff) |
Remove dead function
indexDirectory isn't used, since the application data is read from XML
file instead.
Change-Id: Ibef202b17509c058b7655d145db395e80bec8a54
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
-rw-r--r-- | src/applicationsmodel.cpp | 52 |
1 files changed, 0 insertions, 52 deletions
diff --git a/src/applicationsmodel.cpp b/src/applicationsmodel.cpp index ed54584..63821cf 100644 --- a/src/applicationsmodel.cpp +++ b/src/applicationsmodel.cpp @@ -135,58 +135,6 @@ public: QCoreApplication::postEvent(model, new ResultEvent(results)); } - QList<AppData> indexDirectory(const QString &root) { - QDirIterator iterator(root); - - QList<AppData> results; - - while (iterator.hasNext()) { - QString path = iterator.next(); - - 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(QRegExp(":|\\s+")); - if (excludeList.contains(target) || excludeList.contains(QStringLiteral("all"))) - continue; - } - - AppData data; - data.location = QUrl::fromLocalFile(path); - - 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"); - if (file.open(QFile::ReadOnly)) - data.description = QString::fromUtf8(file.readAll()); - - QString imageName = path + "/preview_l.jpg"; - data.icon = QFile::exists(imageName) - ? QUrl::fromLocalFile(imageName) - : QUrl("qrc:///qml/images/codeless.png"); - - results << data; - } - - std::sort(results.begin(), results.end(), appOrder); - - // Remove any leading digits followed by '.' from the name - for (int i = 0; i < results.count(); ++i) { - results[i].name.remove(QRegExp("^\\d+\\.\\s*")); - } - - return results; - } - QString root; ApplicationsModel *model; QString target; |