Changeset 285


Ignore:
Timestamp:
08/22/10 09:51:17 (18 months ago)
Author:
mickem
Message:

Various settings loading fixes

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/settings/settings_ini.hpp

    r283 r285  
    225225        return; 
    226226      } 
    227       SI_Error rc = ini.LoadFile(get_file_name().string().c_str()); 
     227      std::wstring f = get_file_name().string(); 
     228      get_core()->get_logger()->debug(__FILEW__, __LINE__, _T("Loading: ") + f); 
     229      SI_Error rc = ini.LoadFile(f.c_str()); 
    228230      if (rc < 0) 
    229231        throw_SI_error(rc, _T("Failed to load file")); 
  • trunk/include/settings/settings_interface_impl.hpp

    r283 r285  
    492492    } 
    493493    virtual std::wstring get_file_from_context() { 
    494       return core_->find_file(url_.host + url_.path, DEFAULT_CONF_OLD_LOCATION); 
     494      return core_->find_file(url_.host + url_.path, _T("")); 
    495495    } 
    496496    ////////////////////////////////////////////////////////////////////////// 
  • trunk/service/NSClient++.cpp

    r283 r285  
    13761376  strEx::replace(file, _T("${shared-path}"), getBasePath().string()); 
    13771377#else 
    1378   strEx::replace(file, _T("${shared-path}"), _T("/usr/shared/nsclient++")); 
     1378  strEx::replace(file, _T("${shared-path}"), _T("/usr/share/nsclient++")); 
    13791379#endif 
    13801380  strEx::replace(file, _T("${exe-path}"), getBasePath().string()); 
  • trunk/service/settings_manager_impl.cpp

    r283 r285  
    4444  settings::instance_raw_ptr NSCSettingsImpl::create_instance(std::wstring key) { 
    4545    net::url url = net::parse(key); 
     46    if (url.host.empty() && url.path.empty())  
     47      key = _T(""); 
    4648#ifdef WIN32 
    4749    if (url.protocol == _T("old")) { 
    4850      old_ = true; 
     51      if (key.empty()) 
     52        key = DEFAULT_CONF_OLD_LOCATION; 
    4953      return settings::instance_raw_ptr(new settings::OLDSettings(this, key)); 
    50     }  
    51     if (url.protocol == _T("registry")) 
     54    } 
     55    if (url.protocol == _T("registry")) { 
     56      if (key.empty()) 
     57        key = DEFAULT_CONF_REG_LOCATION; 
    5258      return settings::instance_raw_ptr(new settings::REGSettings(this, key)); 
     59    } 
    5360#endif 
    54     if (url.protocol == _T("ini")) 
     61    if (url.protocol == _T("ini")) { 
     62      if (key.empty()) 
     63        key = DEFAULT_CONF_INI_LOCATION; 
    5564      return settings::instance_raw_ptr(new settings::INISettings(this, key)); 
     65    } 
    5666    throw settings::settings_exception(_T("Undefined settings protocol: ") + url.protocol); 
    5767  } 
Note: See TracChangeset for help on using the changeset viewer.