From c57b172204432f18856ef05d8faa9ebf3001b0c8 Mon Sep 17 00:00:00 2001 From: Tannin Date: Sun, 22 Sep 2013 13:10:21 +0200 Subject: - removed some obsolete code - MO will no longer start an application while the directory structure is being refreshed because MO may need to access profile files afterwards - bugfix: the overwrite info-dialog was not destroyed and could thus keep a lock on files thus preventing those files from being moved/deleted --- src/mainwindow.cpp | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index ffec91a1..fdd16049 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1272,6 +1272,11 @@ HANDLE MainWindow::spawnBinaryDirect(const QFileInfo &binary, const QString &arg } } + while (m_RefreshProgress->isVisible()) { + ::Sleep(1000); + QCoreApplication::processEvents(); + } + return startBinary(binary, arguments, profileName, m_Settings.logLevel(), currentDirectory, true); } @@ -2612,7 +2617,7 @@ void MainWindow::fileMoved(const QString &filePath, const QString &oldOriginName reportError(tr("Failed to move \"%1\" from mod \"%2\" to \"%3\": %4").arg(filePath).arg(oldOriginName).arg(newOriginName).arg(e.what())); } } else { - reportError(tr("Failed to relocate \"%1\"").arg(filePath)); + // this is probably not an error, the specified path is likely a directory } } @@ -2871,6 +2876,15 @@ void MainWindow::unendorse_clicked() } +void MainWindow::overwriteClosed(int) +{ + QDialog *dialog = this->findChild("__overwriteDialog"); + if (dialog != NULL) { + dialog->deleteLater(); + } +} + + void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, int tab) { std::vector flags = modInfo->getFlags(); @@ -2883,6 +2897,7 @@ void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, dialog->show(); dialog->raise(); dialog->activateWindow(); + connect(dialog, SIGNAL(finished(int)), this, SLOT(overwriteClosed(int))); } else { ModInfoDialog dialog(modInfo, m_DirectoryStructure, this); connect(&dialog, SIGNAL(nexusLinkActivated(QString)), this, SLOT(nexusLinkActivated(QString))); @@ -3100,8 +3115,8 @@ void MainWindow::createModFromOverwrite() } ModInfo::Ptr overwriteInfo = ModInfo::getByIndex(m_ContextRow); - - shellMove(QStringList(overwriteInfo->absolutePath() + "\\*"), QStringList(newMod->absolutePath()), this); + shellMove(QStringList(QDir::toNativeSeparators(overwriteInfo->absolutePath()) + "\\*"), + QStringList(QDir::toNativeSeparators(newMod->absolutePath())), this); refreshModList(); } -- cgit v1.3.1