Changeset 3012

Show
Ignore:
Timestamp:
07/30/06 13:36:58 (2 years ago)
Author:
madcat
Message:

Allows programmatically setting config dir on startup (commandline -c arg still overrrides it

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • hydranode/hncore/hydranode.cpp

    r3001 r3012  
    196196// directory and hidden subdir ".hydranode" there, as is standard on 
    197197// those platforms. 
    198 void Hydranode::initConfig() { 
     198void Hydranode::initConfig(const std::string &customConfDir) { 
    199199        using boost::filesystem::path; 
    200200        using boost::filesystem::native; 
    201201 
    202         if (m_confDir.empty()) { 
     202        if (m_confDir.empty() && customConfDir.empty()) { 
    203203                path confdir; 
    204204 
     
    224224#endif 
    225225                m_confDir = confdir; 
    226         } 
     226        } else if (!customConfDir.empty()) { 
     227                m_confDir = path(customConfDir, native); 
     228        } 
     229 
    227230        m_confDir = checkCreateDir(m_confDir, "config"); 
    228231 
  • hydranode/hncore/hydranode.h

    r3001 r3012  
    217217        //! @name Various initialization functions 
    218218        //@{ 
    219         void initConfig(); 
     219        /** 
     220         * Initializes configuration. The directory where configuration will 
     221         * be stored can be set from commandline (-c argument) or 
     222         * programmatically by passing the path here. Note that commandline 
     223         * always overrides programmatically set directory. 
     224         */ 
     225        void initConfig(const std::string &path = ""); 
    220226        void initLog(); 
    221227        void initSockets();