From 4a2e4652f47b063e0a5a33ae7f45703140fc904f Mon Sep 17 00:00:00 2001 From: Tannin Date: Sat, 21 Mar 2015 16:37:49 +0100 Subject: - after closing the overwrite dialog the in-memory directory structure is updated again - bugfix: crash on creating shortcuts --- src/mainwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/mainwindow.cpp') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 767f405c..1566bc8a 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2274,6 +2274,7 @@ void MainWindow::overwriteClosed(int) m_OrganizerCore.modList()->modInfoChanged(dialog->modInfo()); dialog->deleteLater(); } + m_OrganizerCore.refreshDirectoryStructure(); } @@ -3196,9 +3197,8 @@ void MainWindow::linkToolbar() void MainWindow::linkDesktop() { - QComboBox* executablesList = findChild("executablesListBox"); - - const Executable &selectedExecutable = executablesList->itemData(executablesList->currentIndex()).value(); + const Executable &selectedExecutable = + ui->executablesListBox->itemData(ui->executablesListBox->currentIndex()).value(); QString linkName = getDesktopDirectory() + "\\" + selectedExecutable.m_Title + ".lnk"; if (QFile::exists(linkName)) { @@ -3208,7 +3208,7 @@ void MainWindow::linkDesktop() reportError(tr("failed to remove %1").arg(linkName)); } } else { - QFileInfo exeInfo(qApp->arguments().at(0)); + QFileInfo exeInfo(qApp->applicationFilePath()); // create link std::wstring targetFile = ToWString(exeInfo.absoluteFilePath()); std::wstring parameter = ToWString(QString("\"%1\" %2").arg(QDir::toNativeSeparators(selectedExecutable.m_BinaryInfo.absoluteFilePath())) @@ -3242,7 +3242,7 @@ void MainWindow::linkMenu() reportError(tr("failed to remove %1").arg(linkName)); } } else { - QFileInfo exeInfo(qApp->arguments().at(0)); + QFileInfo exeInfo(qApp->applicationFilePath()); // create link std::wstring targetFile = ToWString(exeInfo.absoluteFilePath()); std::wstring parameter = ToWString(QString("\"%1\" %2").arg(QDir::toNativeSeparators(selectedExecutable.m_BinaryInfo.absoluteFilePath())) -- cgit v1.3.1