Merge pull request #117 from adasauce/file-download-path

use the standard system download path for file downloads
This commit is contained in:
DeepBlueV7.X 2020-02-15 03:28:22 +01:00 committed by GitHub
commit f70923f374
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 8 deletions

View file

@ -27,6 +27,7 @@
#include <QPushButton>
#include <QScrollArea>
#include <QSettings>
#include <QStandardPaths>
#include <QString>
#include <QTextStream>
@ -513,7 +514,9 @@ UserSettingsPage::paintEvent(QPaintEvent *)
void
UserSettingsPage::importSessionKeys()
{
auto fileName = QFileDialog::getOpenFileName(this, tr("Open Sessions File"), "", "");
const QString homeFolder = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
const QString fileName =
QFileDialog::getOpenFileName(this, tr("Open Sessions File"), homeFolder, "");
QFile file(fileName);
if (!file.open(QIODevice::ReadOnly)) {
@ -572,7 +575,8 @@ UserSettingsPage::exportSessionKeys()
}
// Open file dialog to save the file.
auto fileName =
const QString homeFolder = QStandardPaths::writableLocation(QStandardPaths::HomeLocation);
const QString fileName =
QFileDialog::getSaveFileName(this, tr("File to save the exported session keys"), "", "");
QFile file(fileName);