CFEL - ASG Software Suite  2.5.0
CASS
cass_settings.h
Go to the documentation of this file.
1 // Copyright (C) 2009, 2010 Lutz Foucar
2 
3 /**
4  * @file cass_settings.h file contains specialized class that do the settings
5  * for cass
6  *
7  * @author Lutz Foucar
8  */
9 
10 #ifndef _CASS_SETTINGS_H_
11 #define _CASS_SETTINGS_H_
12 
13 #include <string>
14 #include <QtCore/QSettings>
15 
16 #include "cass.h"
17 
18 namespace cass
19 {
20  /** Settings for CASS
21  *
22  * This class is needed since one cannot set the filename of the cass.ini
23  * globally.
24  *
25  * @todo Make this class serializable, so that the settings can be send
26  * to a program that can modify it and send it back.
27  *
28  * @author Lutz Foucar
29  */
31  {
32  public:
33  /** constructor
34  *
35  * Will take the filename as it is stored in CassIniFilename. Default is
36  * (userScope)/organizationName/applicationName.ini
37  */
39  : QSettings(_filename.c_str(),QSettings::defaultFormat())
40  {}
41 
42  /** virtual destructor */
43  virtual ~CASSSettings() {}
44 
45  /** function to set the filename */
46  static void setFilename(const std::string &in) { _filename = in;}
47 
48  protected:
49  /** cass.ini filname
50  * name with complete path to the cass.ini to load, needed to circumvent
51  * QSettings limitations.
52  */
53  static std::string _filename;
54  };
55 }//end namespace cass
56 
57 #endif
virtual ~CASSSettings()
virtual destructor
Definition: cass_settings.h:43
#define CASSSHARED_EXPORT
Definition: cass.h:30
Settings for CASS.
Definition: cass_settings.h:30
CASSSettings()
constructor
Definition: cass_settings.h:38
static std::string _filename
cass.ini filname name with complete path to the cass.ini to load, needed to circumvent QSettings limi...
Definition: cass_settings.h:53
static void setFilename(const std::string &in)
function to set the filename
Definition: cass_settings.h:46
file contains global definitions for project cass