aboutsummaryrefslogtreecommitdiff
path: root/qmidiplayer-desktop
diff options
context:
space:
mode:
authorGravatar Chris Xiong <chirs241097@gmail.com> 2019-09-25 00:30:25 +0800
committerGravatar Chris Xiong <chirs241097@gmail.com> 2019-09-25 00:30:25 +0800
commit5ad76bb13ecc29aeb5b2b71cb33a00add44c5b35 (patch)
treea91dc87bc78251ff8952cffd0a43e166d4015390 /qmidiplayer-desktop
parentc944d7279bd3745f3391c56dc1dbc5e02f26c425 (diff)
downloadQMidiPlayer-5ad76bb13ecc29aeb5b2b71cb33a00add44c5b35.tar.xz
Use QStandardPaths.
RIP Windows users.
Diffstat (limited to 'qmidiplayer-desktop')
-rw-r--r--qmidiplayer-desktop/qmpplistwindow.cpp5
-rw-r--r--qmidiplayer-desktop/qmpsettingswindow.cpp3
2 files changed, 5 insertions, 3 deletions
diff --git a/qmidiplayer-desktop/qmpplistwindow.cpp b/qmidiplayer-desktop/qmpplistwindow.cpp
index 667682e..b4b0c02 100644
--- a/qmidiplayer-desktop/qmpplistwindow.cpp
+++ b/qmidiplayer-desktop/qmpplistwindow.cpp
@@ -6,6 +6,7 @@
#include <QSettings>
#include <QUrl>
#include <QMimeData>
+#include <QStandardPaths>
#include "qmpplistwindow.hpp"
#include "ui_qmpplistwindow.h"
#include "qmpmainwindow.hpp"
@@ -24,7 +25,7 @@ qmpPlistWindow::qmpPlistWindow(QWidget *parent) :
repeat=0;shuffle=0;
if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/RestorePlaylist","").toInt())
{
- QSettings* plist=new QSettings(QDir::homePath()+QString("/.config/qmpplist"),
+ QSettings* plist=new QSettings(QStandardPaths::writableLocation(QStandardPaths::StandardLocation::ConfigLocation)+QString("/qmpplist"),
QSettings::IniFormat);
int fc=plist->value("Playlist/FileCount",0).toInt();
ui->lwFiles->clear();for(int i=1;i<=fc;++i)
@@ -113,7 +114,7 @@ void qmpPlistWindow::closeEvent(QCloseEvent *event)
}
if(qmpMainWindow::getInstance()->isFinalizing()&&qmpSettingsWindow::getSettingsIntf()->value("Behavior/RestorePlaylist","").toInt())
{
- QSettings* plist=new QSettings(QDir::homePath()+QString("/.config/qmpplist"),
+ QSettings* plist=new QSettings(QStandardPaths::writableLocation(QStandardPaths::StandardLocation::ConfigLocation)+QString("/qmpplist"),
QSettings::IniFormat);
plist->setValue("Playlist/FileCount",ui->lwFiles->count());
for(int i=0;i<ui->lwFiles->count();++i)
diff --git a/qmidiplayer-desktop/qmpsettingswindow.cpp b/qmidiplayer-desktop/qmpsettingswindow.cpp
index 5c5c7b0..bb0ba05 100644
--- a/qmidiplayer-desktop/qmpsettingswindow.cpp
+++ b/qmidiplayer-desktop/qmpsettingswindow.cpp
@@ -4,6 +4,7 @@
#include <QDir>
#include <QMessageBox>
#include <QDesktopWidget>
+#include <QStandardPaths>
#include "qmpsettingswindow.hpp"
#include "ui_qmpsettingswindow.h"
#include "qmpmainwindow.hpp"
@@ -23,7 +24,7 @@ qmpSettingsWindow::qmpSettingsWindow(QWidget *parent) :
{
ui->setupUi(this);customOptions.clear();customOptPages.clear();
connect(this,&qmpSettingsWindow::dialogClosing,(qmpMainWindow*)parent,&qmpMainWindow::dialogClosed);
- settings=new QSettings(QDir::homePath()+QString("/.config/qmprc"),QSettings::IniFormat);
+ settings=new QSettings(QStandardPaths::writableLocation(QStandardPaths::StandardLocation::ConfigLocation)+QString("/qmprc"),QSettings::IniFormat);
settingsInit();outwidget=ui->cbOutputDevice;
ui->pbAdd->setIcon(QIcon(getThemedIcon(":/img/add.svg")));
ui->pbRemove->setIcon(QIcon(getThemedIcon(":/img/remove.svg")));