summaryrefslogtreecommitdiff
path: root/src/mainwindow.cpp
diff options
context:
space:
mode:
authorTannin <devnull@localhost>2013-09-22 13:10:21 +0200
committerTannin <devnull@localhost>2013-09-22 13:10:21 +0200
commitc57b172204432f18856ef05d8faa9ebf3001b0c8 (patch)
treebdda662916e6a56b7b9e77b0187ea2e69a26244a /src/mainwindow.cpp
parentdfca8be71b15bc13997110cc8777dd5a84a1fde7 (diff)
- 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
Diffstat (limited to 'src/mainwindow.cpp')
-rw-r--r--src/mainwindow.cpp21
1 files changed, 18 insertions, 3 deletions
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<QDialog*>("__overwriteDialog");
+ if (dialog != NULL) {
+ dialog->deleteLater();
+ }
+}
+
+
void MainWindow::displayModInformation(ModInfo::Ptr modInfo, unsigned int index, int tab)
{
std::vector<ModInfo::EFlag> 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();
}