forked from qt-creator/qt-creator
QmlDesigner: Add simple tracing to AssetsLibraryModel
Change-Id: I5306ce637e44ac275411fdb60c5e83f96039ec62 Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -36,19 +36,24 @@
|
|||||||
|
|
||||||
#include <coreplugin/icore.h>
|
#include <coreplugin/icore.h>
|
||||||
|
|
||||||
|
#include <utils/filesystemwatcher.h>
|
||||||
|
#include <utils/stylehelper.h>
|
||||||
|
|
||||||
|
#include <QCheckBox>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QDirIterator>
|
#include <QDirIterator>
|
||||||
|
#include <QElapsedTimer>
|
||||||
#include <QFont>
|
#include <QFont>
|
||||||
#include <QImageReader>
|
#include <QImageReader>
|
||||||
|
#include <QLoggingCategory>
|
||||||
|
#include <QMessageBox>
|
||||||
#include <QMetaProperty>
|
#include <QMetaProperty>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QRawFont>
|
#include <QRawFont>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
#include <QMessageBox>
|
|
||||||
#include <QCheckBox>
|
static Q_LOGGING_CATEGORY(assetsLibraryBenchmark, "qtc.assetsLibrary.setRoot", QtWarningMsg)
|
||||||
#include <utils/stylehelper.h>
|
|
||||||
#include <utils/filesystemwatcher.h>
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
@@ -298,6 +303,12 @@ void AssetsLibraryModel::refresh()
|
|||||||
|
|
||||||
void AssetsLibraryModel::setRootPath(const QString &path)
|
void AssetsLibraryModel::setRootPath(const QString &path)
|
||||||
{
|
{
|
||||||
|
QElapsedTimer time;
|
||||||
|
if (assetsLibraryBenchmark().isInfoEnabled())
|
||||||
|
time.start();
|
||||||
|
|
||||||
|
qCInfo(assetsLibraryBenchmark) << "start:" << time.elapsed();
|
||||||
|
|
||||||
static const QStringList ignoredTopLevelDirs {"imports", "asset_imports"};
|
static const QStringList ignoredTopLevelDirs {"imports", "asset_imports"};
|
||||||
|
|
||||||
m_fileSystemWatcher->clear();
|
m_fileSystemWatcher->clear();
|
||||||
@@ -345,6 +356,8 @@ void AssetsLibraryModel::setRootPath(const QString &path)
|
|||||||
return isEmpty;
|
return isEmpty;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
qCInfo(assetsLibraryBenchmark) << "directories parsed:" << time.elapsed();
|
||||||
|
|
||||||
if (m_assetsDir)
|
if (m_assetsDir)
|
||||||
delete m_assetsDir;
|
delete m_assetsDir;
|
||||||
|
|
||||||
@@ -360,6 +373,8 @@ void AssetsLibraryModel::setRootPath(const QString &path)
|
|||||||
|
|
||||||
m_assetsDir->setDirVisible(!noAssets); // if there are no assets, hide all empty asset folders
|
m_assetsDir->setDirVisible(!noAssets); // if there are no assets, hide all empty asset folders
|
||||||
endResetModel();
|
endResetModel();
|
||||||
|
|
||||||
|
qCInfo(assetsLibraryBenchmark) << "model reset:" << time.elapsed();
|
||||||
}
|
}
|
||||||
|
|
||||||
void AssetsLibraryModel::setSearchText(const QString &searchText)
|
void AssetsLibraryModel::setSearchText(const QString &searchText)
|
||||||
|
Reference in New Issue
Block a user