Skip to content

Commit

Permalink
Don't use static QSettings in playlist.cpp (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
dcaliste authored Feb 26, 2024
1 parent a8295f5 commit 6c9b321
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/playlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <QXmlStreamReader>
#include <QDir>

QSettings sets;
QList<int> randomlist;
int currentItem, currentRandom;

Expand All @@ -25,12 +24,14 @@ int Playlist::current()

QString Playlist::active() const
{
QSettings sets;
QString t = sets.value("Active", "false").toString();
return t;
}

QString Playlist::unknown() const
{
QSettings sets;
QString t = sets.value("Unknown", "false").toString();
return t;
}
Expand Down Expand Up @@ -415,6 +416,7 @@ void Playlist::changeUnknown(bool active)
{
//qDebug() << "CHANGING UKNOWN: " << active;

QSettings sets;
sets.setValue("Unknown", active);
sets.sync();
}
Expand All @@ -423,6 +425,7 @@ void Playlist::changeMode(QString mode)
{
//qDebug() << "CHANGING MODE: " << mode;

QSettings sets;
sets.setValue("Mode", mode);
sets.sync();
}
Expand Down

0 comments on commit 6c9b321

Please sign in to comment.