diff options
author | Chris Xiong <chirs241097@gmail.com> | 2016-01-16 16:46:27 +0800 |
---|---|---|
committer | Chris Xiong <chirs241097@gmail.com> | 2016-01-16 16:46:27 +0800 |
commit | ebda8030fdb70a8162c67947dd980b59337f2d05 (patch) | |
tree | 3ef4b43e8ca4f58788888e18d9feaa4cf74f5107 /qmpplistwindow.cpp | |
parent | e3a5241953051e97978ac42fa278572ae735abb3 (diff) | |
download | QMidiPlayer-ebda8030fdb70a8162c67947dd980b59337f2d05.tar.xz |
Peaceful Romancer. (WTF)0.6.2-2
Diffstat (limited to 'qmpplistwindow.cpp')
-rw-r--r-- | qmpplistwindow.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/qmpplistwindow.cpp b/qmpplistwindow.cpp index a930a1d..27704d8 100644 --- a/qmpplistwindow.cpp +++ b/qmpplistwindow.cpp @@ -1,6 +1,7 @@ #include <cstdlib> #include <ctime> #include <QFileDialog> +#include <QDir> #include <QDirIterator> #include <QSettings> #include <QUrl> @@ -19,7 +20,7 @@ qmpPlistWindow::qmpPlistWindow(QWidget *parent) : repeat=0;shuffle=0; if(qmpSettingsWindow::getSettingsIntf()->value("Behavior/RestorePlaylist","").toInt()) { - QSettings* plist=new QSettings(QString(getenv("HOME"))+QString("/.config/qmpplist"), + QSettings* plist=new QSettings(QDir::homePath()+QString("/.config/qmpplist"), QSettings::IniFormat); int fc=plist->value("Playlist/FileCount",0).toInt(); ui->lwFiles->clear();for(int i=1;i<=fc;++i) @@ -80,7 +81,7 @@ void qmpPlistWindow::closeEvent(QCloseEvent *event) } if(qmpMainWindow::getInstance()->isFinalizing()&&qmpSettingsWindow::getSettingsIntf()->value("Behavior/RestorePlaylist","").toInt()) { - QSettings* plist=new QSettings(QString(getenv("HOME"))+QString("/.config/qmpplist"), + QSettings* plist=new QSettings(QDir::homePath()+QString("/.config/qmpplist"), QSettings::IniFormat); plist->setValue("Playlist/FileCount",ui->lwFiles->count()); for(int i=0;i<ui->lwFiles->count();++i) |