Skip to content

Commit

Permalink
GUI: Fix #246 (Don't default to documents dir in patch dialog)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nukem9 committed Apr 11, 2015
1 parent b0f06ae commit bc2de9d
Showing 1 changed file with 2 additions and 11 deletions.
13 changes: 2 additions & 11 deletions x64_dbg_gui/Project/Src/Gui/PatchDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#include "ui_PatchDialog.h"
#include <QMessageBox>
#include <QIcon>
#include <QDesktopServices>
#include <QFileDialog>
#include <QTextStream>

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit bc2de9d

Please sign in to comment.