LunaSysMgr
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
Settings.cpp File Reference
#include "Common.h"
#include "Settings.h"
#include <QHash>
#include <stdio.h>
#include <string.h>
#include <glib.h>
#include <math.h>
#include "Utils.h"
#include "Logging.h"
#include <lunaprefs.h>
Include dependency graph for Settings.cpp:

Macros

#define SETTINGS_TRACE(...)   (void)0
 
#define KEY_STRING(cat, name, var)
 
#define KEY_MEMORY_STRING(cat, name, var)
 
#define KEY_BOOLEAN(cat, name, var)
 
#define KEY_INTEGER(cat, name, var)
 
#define KEY_DOUBLE(cat, name, var)
 

Functions

unsigned long MemStringToBytes (const char *ptr)
 

Macro Definition Documentation

#define KEY_BOOLEAN (   cat,
  name,
  var 
)
Value:
{\
gboolean _vb;\
GError* _error = 0;\
_vb=g_key_file_get_boolean(keyfile,cat,name,&_error);\
if( !_error ) { var=_vb; allSettings->insert(name, var); }\
else g_error_free(_error); \
}
#define KEY_DOUBLE (   cat,
  name,
  var 
)
Value:
{\
double _v;\
GError* _error = 0;\
_v=g_key_file_get_double(keyfile,cat,name,&_error);\
if( !_error ) { var=_v; allSettings->insert(name, var); }\
else g_error_free(_error); \
}
#define KEY_INTEGER (   cat,
  name,
  var 
)
Value:
{\
int _v;\
GError* _error = 0;\
_v=g_key_file_get_integer(keyfile,cat,name,&_error);\
if( !_error ) { var=_v; allSettings->insert(name, var); }\
else g_error_free(_error); \
}
#define KEY_MEMORY_STRING (   cat,
  name,
  var 
)
Value:
{\
gchar* _vs;\
GError* _error = 0;\
_vs=g_key_file_get_string(keyfile,cat,name,&_error);\
if( !_error && _vs ) { var=::MemStringToBytes((const char*)_vs); g_free(_vs); allSettings->insert(name, QString::fromStdString(var)); }\
else g_error_free(_error); \
}
#define KEY_STRING (   cat,
  name,
  var 
)
Value:
{\
gchar* _vs;\
GError* _error = 0;\
_vs=g_key_file_get_string(keyfile,cat,name,&_error);\
if( !_error && _vs ) { var=(const char*)_vs; g_free(_vs); allSettings->insert(name, QString::fromStdString(var)); }\
else g_error_free(_error); \
}
#define SETTINGS_TRACE (   ...)    (void)0

Function Documentation

unsigned long MemStringToBytes ( const char *  ptr)