From 75cd8b3bab3e4d094565748215013ee78c9962d9 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 18 Feb 2020 18:09:03 -0500 Subject: added more timings missed fileregisterfwd.h in cmake list --- src/CMakeLists.txt | 2 ++ src/directoryrefresher.cpp | 2 +- src/downloadmanager.cpp | 4 +++- src/main.cpp | 12 ++++++++++-- src/modinfo.cpp | 2 ++ src/organizercore.cpp | 3 ++- src/plugincontainer.cpp | 2 ++ src/pluginlist.cpp | 2 ++ 8 files changed, 24 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85d8af0f..d1430963 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -293,6 +293,7 @@ SET(organizer_HDRS shared/fileentry.h shared/filesorigin.h shared/fileregister.h + shared/fileregisterfwd.h shared/originconnection.h shared/util.h shared/appconfig.h @@ -481,6 +482,7 @@ set(register shared/fileentry shared/filesorigin shared/fileregister + shared/fileregisterfwd shared/originconnection directoryrefresher ) diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index e8c26c90..5a3cca5c 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -463,7 +463,7 @@ void DirectoryRefresher::addMultipleModsFilesToStructure( void DirectoryRefresher::refresh() { SetThisThreadName("DirectoryRefresher"); - TimeThis tt("refresh"); + TimeThis tt("DirectoryRefresher::refresh()"); auto* p = new DirectoryRefreshProgress(this); { diff --git a/src/downloadmanager.cpp b/src/downloadmanager.cpp index a93182b4..4defd96b 100644 --- a/src/downloadmanager.cpp +++ b/src/downloadmanager.cpp @@ -320,6 +320,8 @@ void DownloadManager::setPluginContainer(PluginContainer *pluginContainer) void DownloadManager::refreshList() { + TimeThis tt("DownloadManager::refreshList()"); + try { //avoid triggering other refreshes startDisableDirWatcher(); @@ -1873,7 +1875,7 @@ void DownloadManager::nxmFileInfoFromMd5Available(QString gameName, QVariant use //Unable to determine the correct mod / file. Revert to the old method if (chosenIdx < 0) { //don't use the normal state set function as we don't want to create a meta file - info->m_State = DownloadManager::STATE_READY; + info->m_State = DownloadManager::STATE_READY; queryInfo(m_ActiveDownloads.indexOf(info)); return; } diff --git a/src/main.cpp b/src/main.cpp index 105299a8..8813aaa7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -506,6 +506,8 @@ static QString getVersionDisplayString() int runApplication(MOApplication &application, SingleInstance &instance, const QString &splashPath) { + TimeThis tt("runApplication() to exec()"); + log::info( "starting Mod Organizer version {} revision {} in {}, usvfs: {}", getVersionDisplayString(), GITID, QCoreApplication::applicationDirPath(), @@ -703,7 +705,7 @@ int runApplication(MOApplication &application, SingleInstance &instance, } QPixmap pixmap; - + QSplashScreen splash(nullptr); if (useSplash) { @@ -748,13 +750,15 @@ int runApplication(MOApplication &application, SingleInstance &instance, log::debug("displaying main window"); mainWindow.show(); mainWindow.activateWindow(); - + if (useSplash) { // don't pass mainwindow as it just waits half a second for it // instead of proceding splash.finish(nullptr); } + tt.stop(); + res = application.exec(); mainWindow.close(); @@ -855,6 +859,8 @@ void initLogging() int main(int argc, char *argv[]) { + TimeThis tt("main to runApplication()"); + // handle --crashdump first for (int i=1; istealDirectoryStructure(); Q_ASSERT(newStructure != m_DirectoryStructure); diff --git a/src/plugincontainer.cpp b/src/plugincontainer.cpp index 767d3eb8..3227f496 100644 --- a/src/plugincontainer.cpp +++ b/src/plugincontainer.cpp @@ -249,6 +249,8 @@ const PreviewGenerator &PluginContainer::previewGenerator() const void PluginContainer::loadPlugins() { + TimeThis tt("PluginContainer::loadPlugins()"); + unloadPlugins(); for (QObject *plugin : QPluginLoader::staticInstances()) { diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 4b2eedbd..d58b1c22 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -174,6 +174,8 @@ void PluginList::refresh(const QString &profileName , const QString &lockedOrderFile , bool force) { + TimeThis tt("PluginList::refresh()"); + if (force) { m_ESPs.clear(); m_ESPsByName.clear(); -- cgit v1.3.1 From f9ad6d97098093b5d03e7792798583ea73a1ea65 Mon Sep 17 00:00:00 2001 From: isanae <14251494+isanae@users.noreply.github.com> Date: Tue, 18 Feb 2020 18:13:23 -0500 Subject: timing for refreshBSAList and updateProblemsButton --- src/directoryrefresher.cpp | 4 ++-- src/mainwindow.cpp | 10 ++++++---- src/modinfo.cpp | 2 +- src/organizercore.cpp | 4 +++- 4 files changed, 12 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/directoryrefresher.cpp b/src/directoryrefresher.cpp index 5a3cca5c..57948236 100644 --- a/src/directoryrefresher.cpp +++ b/src/directoryrefresher.cpp @@ -286,7 +286,7 @@ void DirectoryRefresher::addModFilesToStructure( DirectoryEntry *directoryStructure, const QString &modName, int priority, const QString &directory, const QStringList &stealFiles) { - TimeThis tt("addModFilesToStructure()"); + TimeThis tt("DirectoryRefresher::addModFilesToStructure()"); std::wstring directoryW = ToWString(QDir::toNativeSeparators(directory)); DirectoryStats dummy; @@ -307,7 +307,7 @@ void DirectoryRefresher::addModToStructure(DirectoryEntry *directoryStructure , const QStringList &stealFiles , const QStringList &archives) { - TimeThis tt("addModToStructure()"); + TimeThis tt("DirectoryRefresher::addModToStructure()"); DirectoryStats dummy; diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 21a6fa41..325a7e93 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -962,6 +962,8 @@ void MainWindow::scheduleUpdateButton() void MainWindow::updateProblemsButton() { + TimeThis tt("MainWindow::updateProblemsButton()"); + // if the current stylesheet doesn't provide an icon, this is used instead const char* DefaultIconName = ":/MO/gui/warning"; @@ -1667,9 +1669,9 @@ void MainWindow::on_profileBox_currentIndexChanged(int index) // Avoid doing any refresh if currentProfile is already set but previous index was -1 // as it means that this is happening during initialization so everything has already been set. - if (previousIndex == -1 - && m_OrganizerCore.currentProfile() != nullptr - && m_OrganizerCore.currentProfile()->exists() + if (previousIndex == -1 + && m_OrganizerCore.currentProfile() != nullptr + && m_OrganizerCore.currentProfile()->exists() && ui->profileBox->currentText() == m_OrganizerCore.currentProfile()->name()){ return; } @@ -5517,7 +5519,7 @@ void MainWindow::nxmUpdatesAvailable(QString gameName, int modID, QVariant userD bool foundUpdate = false; bool oldFile = false; QString installedFile = mod->getInstallationFile(); - if (!installedFile.isEmpty()) { + if (!installedFile.isEmpty()) { QVariantMap foundFile; for (auto file : files) { QVariantMap fileData = file.toMap(); diff --git a/src/modinfo.cpp b/src/modinfo.cpp index 5c381830..71a4a386 100644 --- a/src/modinfo.cpp +++ b/src/modinfo.cpp @@ -251,7 +251,7 @@ void ModInfo::updateFromDisc(const QString &modDirectory, bool displayForeign, MOBase::IPluginGame const *game) { - TimeThis tt("updateFromDisc()"); + TimeThis tt("ModInfo::updateFromDisc()"); QMutexLocker lock(&s_Mutex); s_Collection.clear(); diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 3c499b36..0b3a4bfe 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1127,6 +1127,8 @@ void OrganizerCore::refreshESPList(bool force) void OrganizerCore::refreshBSAList() { + TimeThis tt("OrganizerCore::refreshBSAList()"); + DataArchives *archives = m_GamePlugin->feature(); if (archives != nullptr) { @@ -1409,7 +1411,7 @@ void OrganizerCore::refreshDirectoryStructure() void OrganizerCore::directory_refreshed() { log::debug("directory refreshed, finishing up"); - TimeThis tt("directory_refreshed()"); + TimeThis tt("OrganizerCore::directory_refreshed()"); DirectoryEntry *newStructure = m_DirectoryRefresher->stealDirectoryStructure(); Q_ASSERT(newStructure != m_DirectoryStructure); -- cgit v1.3.1