diff options
| author | Tannin <devnull@localhost> | 2014-05-05 18:24:15 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2014-05-05 18:24:15 +0200 |
| commit | 0eb1662a0eaf8eee680cab5b913fff3fcc9b8b2f (patch) | |
| tree | 4cccf64266f73d9acabc15e517abd510da79b582 /src/mainwindow.cpp | |
| parent | 164ec25a75a9d5b5fcbafbe321935ba37fe0885c (diff) | |
- very effective optimization to findfirstfile-calls
- several configuration files are now only saved to disk if the content actually changed.
This should also get rid of a problem where plugins.txt was re-written immediately after starting the game
(causing a conflict with the game)
- reduced "noise" from hook.dll
- removed some debugging messages
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 34 |
1 files changed, 5 insertions, 29 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index b8c357f8..5dc2eb2a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -664,8 +664,9 @@ void MainWindow::saveArchiveList() } } } - archiveFile.commit(); - qDebug("%s saved", qPrintable(QDir::toNativeSeparators(m_CurrentProfile->getArchivesFileName()))); + if (archiveFile.commitIfDifferent(m_ArchiveListHash)) { + qDebug("%s saved", qPrintable(QDir::toNativeSeparators(m_CurrentProfile->getArchivesFileName()))); + } } else { qWarning("archive list not initialised"); } @@ -1423,7 +1424,7 @@ HANDLE MainWindow::spawnBinaryDirect(const QFileInfo &binary, const QString &arg } } - while (m_RefreshProgress->isVisible()) { + while (m_DirectoryUpdate) { ::Sleep(100); QCoreApplication::processEvents(); } @@ -1432,7 +1433,6 @@ HANDLE MainWindow::spawnBinaryDirect(const QFileInfo &binary, const QString &arg if (m_CurrentProfile != nullptr) { m_CurrentProfile->writeModlistNow(true); } - savePluginList(); // TODO: should also pass arguments if (m_AboutToRun(binary.absoluteFilePath())) { @@ -1443,28 +1443,6 @@ HANDLE MainWindow::spawnBinaryDirect(const QFileInfo &binary, const QString &arg } } -/* -void MainWindow::spawnProgram(const QString &fileName, const QString &argumentsArg, - const QString &profileName, const QDir ¤tDirectory) -{ - QFileInfo binary; - QString arguments = argumentsArg; - QString steamAppID; - try { - const Executable &exe = m_ExecutablesList.find(fileName); - steamAppID = exe.m_SteamAppID; - if (arguments == "") { - arguments = exe.m_Arguments; - } - binary = exe.m_BinaryInfo; - } catch (const std::runtime_error&) { - qWarning("\"%s\" not set up as executable", fileName.toUtf8().constData()); - binary = QFileInfo(fileName); - } - spawnBinaryDirect(binary, arguments, profileName, currentDirectory, steamAppID); -} -*/ - void MainWindow::spawnBinary(const QFileInfo &binary, const QString &arguments, const QDir ¤tDirectory, bool closeAfterStart, const QString &steamAppID) { @@ -2774,8 +2752,6 @@ void MainWindow::refresher_progress(int percent) void MainWindow::directory_refreshed() { - statusBar()->hide(); - DirectoryEntry *newStructure = m_DirectoryRefresher.getDirectoryStructure(); if (newStructure != NULL) { DirectoryEntry *oldStructure = m_DirectoryStructure; @@ -2800,6 +2776,7 @@ void MainWindow::directory_refreshed() ModInfo::Ptr modInfo = ModInfo::getByIndex(i); modInfo->clearCaches(); } + statusBar()->hide(); } @@ -5375,7 +5352,6 @@ void MainWindow::on_bossButton_clicked() HANDLE stdOutWrite = INVALID_HANDLE_VALUE; HANDLE stdOutRead = INVALID_HANDLE_VALUE; createStdoutPipe(&stdOutRead, &stdOutWrite); - HANDLE loot = startBinary(QFileInfo(qApp->applicationDirPath() + "/loot/lootcli.exe"), parameters.join(" "), m_CurrentProfile->getName(), |
