Changeset 287
- Timestamp:
- 08/22/10 10:12:56 (18 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
-
include/settings/settings_ini.hpp (modified) (5 diffs)
-
service/NSClient++.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/include/settings/settings_ini.hpp
r286 r287 15 15 class INISettings : public settings::SettingsInterfaceImpl { 16 16 private: 17 boost::filesystem::wpathfilename_;17 std::wstring filename_; 18 18 bool is_loaded_; 19 19 CSimpleIni ini; … … 209 209 virtual void save() { 210 210 SettingsInterfaceImpl::save(); 211 SI_Error rc = ini.SaveFile(get_file_name(). string().c_str());211 SI_Error rc = ini.SaveFile(get_file_name().c_str()); 212 212 if (rc < 0) 213 213 throw_SI_error(rc, _T("Failed to save file")); … … 225 225 return; 226 226 } 227 std::wstring f = get_file_name() .string();227 std::wstring f = get_file_name(); 228 228 get_core()->get_logger()->debug(__FILEW__, __LINE__, _T("Loading: ") + f + _T(" from ") + get_context()); 229 229 SI_Error rc = ini.LoadFile(f.c_str()); … … 248 248 throw settings_exception(msg + _T(": ") + get_context() + _T(" - ") + error_str); 249 249 } 250 boost::filesystem::wpathget_file_name() {250 std::wstring get_file_name() { 251 251 if (filename_.empty()) { 252 252 filename_ = get_file_from_context(); 253 253 //filename_ = get_core()->get_base() / boost::filesystem::wpath(get_core()->get_boot_string(get_context(), _T("file"), _T("nsclient.ini"))); 254 get_core()->get_logger()->debug(__FILEW__, __LINE__, _T("Reading INI settings from: ") + filename_ .string());254 get_core()->get_logger()->debug(__FILEW__, __LINE__, _T("Reading INI settings from: ") + filename_); 255 255 } 256 256 return filename_; … … 260 260 } 261 261 virtual std::wstring get_info() { 262 return _T("INI settings: (") + context_ + _T(", ") + get_file_name() .string()+ _T(")");262 return _T("INI settings: (") + context_ + _T(", ") + get_file_name() + _T(")"); 263 263 } 264 264 -
trunk/service/NSClient++.cpp
r285 r287 517 517 518 518 void NSClientT::load_all_plugins(int mode) { 519 boost::filesystem::wpath pluginPath = expand_path(_T("${module-path}")); 519 boost::filesystem::wpath pluginPath; 520 try { 521 pluginPath = expand_path(_T("${module-path}")); 522 } catch (std::exception &e) { 523 LOG_CRITICAL_STD(_T("Failed to load plugins: ") + to_wstring(e.what()) + _T(" for ") + expand_path(_T("${module-path}"))); 524 return; 525 } 520 526 plugin_alias_list_type plugins = find_all_plugins(false); 521 527 std::pair<std::wstring,std::wstring> v; … … 1376 1382 strEx::replace(file, _T("${shared-path}"), getBasePath().string()); 1377 1383 #else 1378 strEx::replace(file, _T("${shared-path}"), _T("/usr/share/nsclient++")); 1384 strEx::replace(file, _T("${shared-path}"), getBasePath().string()); 1385 // strEx::replace(file, _T("${shared-path}"), _T("/usr/share/nsclient++")); 1379 1386 #endif 1380 1387 strEx::replace(file, _T("${exe-path}"), getBasePath().string());
Note: See TracChangeset
for help on using the changeset viewer.







