summaryrefslogtreecommitdiff
path: root/src/client
diff options
context:
space:
mode:
Diffstat (limited to 'src/client')
-rw-r--r--src/client/Client.cpp15
-rw-r--r--src/client/Client.h3
2 files changed, 13 insertions, 5 deletions
diff --git a/src/client/Client.cpp b/src/client/Client.cpp
index ea9c639..0f6273c 100644
--- a/src/client/Client.cpp
+++ b/src/client/Client.cpp
@@ -676,12 +676,8 @@ void Client::RemoveListener(ClientListener * listener)
}
}
-void Client::Shutdown()
+void Client::WritePrefs()
{
- ClearThumbnailRequests();
- http_done();
-
- //Save config
std::ofstream configFile;
configFile.open("powder.pref", std::ios::trunc);
if(configFile)
@@ -708,6 +704,15 @@ void Client::Shutdown()
}
}
+void Client::Shutdown()
+{
+ ClearThumbnailRequests();
+ http_done();
+
+ //Save config
+ WritePrefs();
+}
+
Client::~Client()
{
}
diff --git a/src/client/Client.h b/src/client/Client.h
index d9fedd5..95ae952 100644
--- a/src/client/Client.h
+++ b/src/client/Client.h
@@ -141,6 +141,9 @@ public:
void Tick();
void Shutdown();
+ //Force flushing preferences to file on disk.
+ void WritePrefs();
+
std::string GetPrefString(std::string property, std::string defaultValue);
double GetPrefNumber(std::string property, double defaultValue);
int GetPrefInteger(std::string property, int defaultValue);