refactored AppSettings to Singleton pattern.
[vlc-remote] / src / appsettings.h
index 47ff5a0..8280a18 100644 (file)
@@ -63,26 +63,59 @@ public:
     explicit AppSettings();
     ~AppSettings();
     static QString getCurrentKey();
-    static void setCurrentKey(QString key);
+    static QString setCurrentKey(QString);
     static QString getCurrentIp();
-    static void setCurrentIp(QString ip);
+    static QString setCurrentIp(QString);
     static QStringList getAllAccounts();
     static VlcDirectory getHomeDirectory();
     static QList<VlcDirectory>* getFavourites();
-    static bool addFavourite(VlcDirectory dir);
-    static bool deleteFavourite(VlcDirectory dir);
-    static bool setHomeDirectory(VlcDirectory dir);
-    static Orientation setOrientation(Orientation orientation);
-    static Orientation getOrientation();
+    static bool addFavourite(VlcDirectory);
+    static bool deleteFavourite(VlcDirectory);
+    static bool setHomeDirectory(VlcDirectory);
     static bool isConnected();
     static int getStatusPollTimeout();
+    static int setStatusPollTimeout(int);
     static int getPingTimeout();
+    static int setPingTimeout(int);
     static int getConnectionTimeout();
+    static int setConnectionTimeout(int);
     static int getRetrieveArtTimeout();
+    static int setRetrieveArtTimeout(int);
     static int getRetryNetworkTimeout();
+    static int setRetryNetworkTimeout(int);
     static bool getShowUnknownFileTypes();
+    static bool setShowUnknownFileTypes(bool);
     static bool getShowAlbumArt();
+    static bool setShowAlbumArt(bool);
     static bool getAlertOnClose();
+    static bool setAlertOnClose(bool);
+    static Orientation setOrientation(Orientation);
+    static Orientation getOrientation();
+
+private:
+    static bool _haveCurrentKey;
+    static QString _currentKey;
+    static bool _haveCurrentIp;
+    static QString _currentIp;
+    static bool _haveConnectionTimeout;
+    static int _connectionTimeout;
+    static bool _havePingTimeout;
+    static int _pingTimeout;
+    static bool _haveStatusPollTimeout;
+    static int _statusPollTimeout;
+    static bool _haveRetrieveArtTimeout;
+    static int _retrieveArtTimeout;
+    static bool _haveRetryNetworkTimeout;
+    static int _retryNetworkTimeout;
+    static bool _haveShowUnknownFileTypes;
+    static bool _showUnknownFileTypes;
+    static bool _haveShowAlbumArt;
+    static bool _showAlbumArt;
+    static bool _haveAlertOnClose;
+    static bool _alertOnClose;
+    static bool _haveOrientation;
+    static Orientation _orientation;
+
 
 };