| 90 | } |
| 91 | |
| 92 | int 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 | |
| 124 | int CService::SaveConfigure(const QString &szDir) |
| 125 | { |