summaryrefslogtreecommitdiff
path: root/src/settings.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/settings.c')
-rw-r--r--src/settings.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/settings.c b/src/settings.c
index 91fce9a..abdf5b7 100644
--- a/src/settings.c
+++ b/src/settings.c
@@ -62,6 +62,9 @@ void BarSettingsDestroy (BarSettings_t *settings) {
free (settings->controlProxy);
free (settings->username);
free (settings->password);
+ free (settings->lastfmUser);
+ free (settings->lastfmPassword);
+ memset (settings, 0, sizeof (*settings));
}
/* read app settings from file; format is: key = value\n
@@ -104,8 +107,15 @@ void readSettings (BarSettings_t *settings) {
settings->username = strdup (val);
} else if (strcmp ("password", key) == 0) {
settings->password = strdup (val);
+ } else if (strcmp ("lastfm_user", key) == 0) {
+ settings->lastfmUser = strdup (val);
+ } else if (strcmp ("lastfm_password", key) == 0) {
+ settings->lastfmPassword = strdup (val);
}
}
+ if (settings->lastfmUser != NULL && settings->lastfmPassword != NULL) {
+ settings->enableScrobbling = 1;
+ }
fclose (configfd);
}