Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use static QSettings in playlist.cpp #69

Merged
merged 1 commit into from
Feb 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading