Skip to content

Commit

Permalink
Use current user's homedir as Phone memory path (#46)
Browse files Browse the repository at this point in the history
Closes #15
This should return the current user's home directory instead of hard-coding it.
Documentation reference: https://doc.qt.io/qt-5/qstandardpaths.html
Alternatively, [`QDir::homePath](https://doc.qt.io/qt-5/qdir.html#homePath) can be used.
(not actually tested)
  • Loading branch information
Simon Schmeisser authored Nov 5, 2023
1 parent 0ba5cf1 commit 4ac3758
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/config.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#include "config.h"

#include <QSettings>
#include <QStandardPaths>

QSettings sets("cepiperez", "fileboxplus");

Expand Down Expand Up @@ -29,5 +30,5 @@ void Config::removeConfig(QString data1)

QString Config::getHome()
{
return readConfig("PhoneMemoryFolder", "/home/defaultuser");
return QStandardPaths::standardLocations(QStandardPaths::HomeLocation).first();
}

0 comments on commit 4ac3758

Please sign in to comment.