forked from qt-creator/qt-creator
QmlDesigner: Skip Dependencies folder for resources
This folder is only part of the CMake project.
Task-number: QDS-15037
Change-Id: Ia7d723adfb54f42205b8dcdcb601127508cd7dc1
Reviewed-by: Tim Jenssen <tim.jenssen@qt.io>
(cherry picked from commit 1a3998e51c
)
This commit is contained in:
@@ -183,7 +183,27 @@ QVariant FileResourcesModel::modelNodeBackend() const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
<<<<<<< HEAD (a2c8a1 Core: fix rare crash in GeneralSettingsWidget::apply())
|
||||||
bool filterMetaIcons(const QString &fileName)
|
bool filterMetaIcons(const QString &fileName)
|
||||||
|
=======
|
||||||
|
static bool checkIgnoreFile(const QString &fileName)
|
||||||
|
{
|
||||||
|
QFileInfo info(fileName);
|
||||||
|
|
||||||
|
QDir currentDir = info.dir();
|
||||||
|
|
||||||
|
while (!currentDir.isRoot() && currentDir.path().contains("Dependencies")) {
|
||||||
|
if (QFileInfo(currentDir.absoluteFilePath("ignore-in-qds")).exists())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
currentDir.cdUp();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool filterMetaIcons(const QString &fileName)
|
||||||
|
>>>>>>> CHANGE (1a3998 QmlDesigner: Skip Dependencies folder for resources)
|
||||||
{
|
{
|
||||||
QFileInfo info(fileName);
|
QFileInfo info(fileName);
|
||||||
|
|
||||||
@@ -219,6 +239,10 @@ void FileResourcesModel::refreshModel()
|
|||||||
QDirIterator it(dirPath.absolutePath(), filterList, QDir::Files, QDirIterator::Subdirectories);
|
QDirIterator it(dirPath.absolutePath(), filterList, QDir::Files, QDirIterator::Subdirectories);
|
||||||
while (it.hasNext()) {
|
while (it.hasNext()) {
|
||||||
const QString absolutePath = it.next();
|
const QString absolutePath = it.next();
|
||||||
|
|
||||||
|
if (checkIgnoreFile(absolutePath))
|
||||||
|
continue;
|
||||||
|
|
||||||
if (filterMetaIcons(absolutePath)) {
|
if (filterMetaIcons(absolutePath)) {
|
||||||
const QString relativeFilePath = m_docPath.relativeFilePath(absolutePath);
|
const QString relativeFilePath = m_docPath.relativeFilePath(absolutePath);
|
||||||
m_model.append(
|
m_model.append(
|
||||||
|
Reference in New Issue
Block a user