GUI: Fix #246 (Don't default to documents dir in patch dialog)
This commit is contained in:
parent
b0f06aeeb5
commit
bc2de9da45
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue