MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / LoadConfigure

Method LoadConfigure

Service/Service.cpp:92–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92int CService::LoadConfigure(const QString &szDir)
93{
94 int nRet = 0;
95 QString szFolder = szDir;
96 QString szFile;
97 if(szFolder.isEmpty())
98 {
99 szFile = RabbitCommon::CDir::Instance()->GetFileUserConfigure();
100 QSettings set(szFile, QSettings::IniFormat);
101 szFolder = set.value("Configure/Folder",
102 RabbitCommon::CDir::Instance()->GetDirUserConfig()).toString();
103 szFile = set.value("Configure/File/" + m_pPlugin->Id(),
104 szFolder
105 + QDir::separator()
106 + m_pPlugin->Id()
107 + ".rrs").toString();
108 } else {
109 szFile = szFolder + QDir::separator() + m_pPlugin->Id() + ".rrs";
110 }
111 qInfo(Service) << "Configure file:" << szFile;
112 QDir d;
113 if(d.exists(szFile)){
114 nRet = GetParameters()->Load(szFile);
115 if(nRet)
116 {
117 qInfo(Service) << "Load configure file fail:" << nRet << ":" << szFile;
118 return -1;
119 }
120 }
121 return nRet;
122}
123
124int CService::SaveConfigure(const QString &szDir)
125{

Callers 1

foreachFunction · 0.80

Calls 3

isEmptyMethod · 0.45
IdMethod · 0.45
LoadMethod · 0.45

Tested by

no test coverage detected