diff options
author | Daniel Teske <daniel.teske@theqtcompany.com> | 2015-05-21 15:32:12 +0200 |
---|---|---|
committer | Daniel Teske <daniel.teske@theqtcompany.com> | 2015-06-01 15:07:26 +0000 |
commit | d7fbe79c1f87cccd3dabce2c05f9c6ef394d211f (patch) | |
tree | 99af505bb0fb7c8c6766633bd922782da213f867 /src/plugins/resourceeditor/qrceditor/resourcefile.cpp | |
parent | 47660a8f094e7b4bd79cfe4c1424c0f6a3197beb (diff) |
ResourceEditor/Node: Add 'Remove missing files' feature
Change-Id: I081ec83b8cdb4f7c29e754b95370b58865ca2993
Task-number: QTCREATORBUG-13941
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@theqtcompany.com>
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/resourceeditor/qrceditor/resourcefile.cpp')
-rw-r--r-- | src/plugins/resourceeditor/qrceditor/resourcefile.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp index ce6bd87a5d..449e064ca3 100644 --- a/src/plugins/resourceeditor/qrceditor/resourcefile.cpp +++ b/src/plugins/resourceeditor/qrceditor/resourcefile.cpp @@ -653,6 +653,25 @@ QString ResourceModel::errorMessage() const return m_resource_file.errorMessage(); } +QList<QModelIndex> ResourceModel::nonExistingFiles() const +{ + QList<QModelIndex> files; + QFileInfo fi; + int prefixCount = rowCount(QModelIndex()); + for (int i = 0; i < prefixCount; ++i) { + QModelIndex prefix = index(i, 0, QModelIndex()); + int fileCount = rowCount(prefix); + for (int j = 0; j < fileCount; ++j) { + QModelIndex fileIndex = index(j, 0, prefix); + QString fileName = file(fileIndex); + fi.setFile(fileName); + if (!fi.exists()) + files << fileIndex; + } + } + return files; +} + Qt::ItemFlags ResourceModel::flags(const QModelIndex &index) const { Qt::ItemFlags f = QAbstractItemModel::flags(index); |