Skip to content
Permalink
Browse files
GUI: Fix #246 (Don't default to documents dir in patch dialog)
  • Loading branch information
Nukem9 committed Apr 11, 2015
1 parent b0f06ae commit bc2de9d
Showing 1 changed file with 2 additions and 11 deletions.
@@ -2,7 +2,6 @@
#include "ui_PatchDialog.h"
#include <QMessageBox>
#include <QIcon>
#include <QDesktopServices>
#include <QFileDialog>
#include <QTextStream>

@@ -499,11 +498,7 @@ void PatchDialog::on_btnPatchFile_clicked()

void PatchDialog::on_btnImport_clicked()
{
#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
QString filename = QFileDialog::getOpenFileName(this, tr("Open patch"), QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation), tr("Patch files (*.1337)"));
#else
QString filename = QFileDialog::getOpenFileName(this, tr("Open patch"), QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0], tr("Patch files (*.1337)"));
#endif
QString filename = QFileDialog::getOpenFileName(this, tr("Open patch"), "", tr("Patch files (*.1337)"));
if(!filename.length())
return;
filename = QDir::toNativeSeparators(filename); //convert to native path format (with backlashes)
@@ -638,11 +633,7 @@ void PatchDialog::on_btnExport_clicked()
if(!mPatches->size())
return;

#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
QString filename = QFileDialog::getSaveFileName(this, tr("Save patch"), QDesktopServices::storageLocation(QDesktopServices::DocumentsLocation), tr("Patch files (*.1337)"));
#else
QString filename = QFileDialog::getSaveFileName(this, tr("Save patch"), QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation)[0], tr("Patch files (*.1337)"));
#endif
QString filename = QFileDialog::getSaveFileName(this, tr("Save patch"), "", tr("Patch files (*.1337)"));
if(!filename.length())
return;
filename = QDir::toNativeSeparators(filename); //convert to native path format (with backlashes)

0 comments on commit bc2de9d

Please sign in to comment.