Skip to content

Commit bc2de9d

Browse files
committed
GUI: Fix #246 (Don't default to documents dir in patch dialog)
1 parent b0f06ae commit bc2de9d

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

x64_dbg_gui/Project/Src/Gui/PatchDialog.cpp

+2-11
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
#include "ui_PatchDialog.h"
33
#include <QMessageBox>
44
#include <QIcon>
5-
#include <QDesktopServices>
65
#include <QFileDialog>
76
#include <QTextStream>
87

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

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

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

0 commit comments

Comments
 (0)