2 #include <QtCore/QDebug> //Debug pro informace
3 #include <QtXml/QDomElement>
4 #include <QtCore/QStringList>
5 #include <QtCore/QTextStream>
6 #include <QtCore/QString>
8 #include <QtGui/QStandardItemModel>
11 Sets the pointer to the object to connect to deamon to NULL
13 ProfileDB::ProfileDB(QObject *parent) :
15 profile_manager(new ProfilesManager(this)),
16 sound_files_manager(new SoundFilesManager(this)),
17 rules_manager(new RulesManager(this))
23 Deletes the object to connect to deamon
25 ProfileDB::~ProfileDB()
31 Creates an object ProfileDeamon and connects via ProfileDeamon: ConnectToDeamon
32 Create a model that will list all audio files
33 Then initializes the XML file using InitFile()
34 If the file exists so it attempts to read with readfile()
35 and if not it creates and initializes using CreateFile()
37 bool ProfileDB::Init()
39 if(profile_manager->Init() == false){
42 if(sound_files_manager->Init(profile_manager->GetRootElement()) == false)
46 if(rules_manager->Init() == false)
55 //=============================================================
56 ProfilesManager *ProfileDB::GetProfileManager() const
58 return profile_manager;
61 SoundFilesManager *ProfileDB::GetSoundFilesManager() const
63 return sound_files_manager;
66 RulesManager *ProfileDB::GetRulesManager() const
71 void ProfileDB::SaveProfilesToXml()
73 profile_manager->SaveProfilesToXml();
74 rules_manager->SaveProfilesToXml();
78 //================================================================
79 //=============================================================================================================
80 //=============================================================================================================