Changes: removed locations singleton.
[ptas] / zouba / src / locations.h
1 #ifndef LOCATIONS_H
2 #define LOCATIONS_H
3
4 #include "location.h"
5
6 #include <QHash>
7 #include <QString>
8 #include <QObject>
9
10 class Locations: public QObject
11 {
12   Q_OBJECT
13
14 public:
15   Locations();
16   ~Locations();
17
18   static Locations *instance();
19   bool addLocation( Location *location );
20
21   Location *location( const QString &label );
22
23 public Q_SLOTS:
24   void saveLocation();
25
26 private:
27   void restoreLocations();
28   static QHash<QString,Location *> locationHash;
29   static bool initialised;
30
31   void saveLocation( Location *location );
32 };
33 #endif // LOCATIONS_H