Added facility to restore and save locations, and set existing location in home and...
[ptas] / zouba / locations.h
index fe32bf4..40f8be0 100644 (file)
@@ -5,18 +5,29 @@
 
 #include <QHash>
 #include <QString>
+#include <QObject>
 
-class Locations
+class Locations: public QObject
 {
+  Q_OBJECT
+
 public:
   Locations();
   ~Locations();
 
+  static Locations *instance();
   bool addLocation( Location *location );
 
   Location *location( const QString &label );
 
+public Q_SLOTS:
+  void saveLocation();
+
 private:
+  void restoreLocations();
   static QHash<QString,Location *> locationHash;
+  static Locations singleton;
+
+  void saveLocation( Location *location );
 };
 #endif // LOCATIONS_H