Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
May 30, 2015, 12:22:27 PM (9 years ago)
Author:
landauf
Message:

moved static application paths (root, executable, modules) into new class named ApplicationPaths
moved configurable data paths (data, log, config) into new class named ConfigurablePaths
removed PathConfig

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/src/libraries/core/Core.cc

    r10484 r10509  
    5959#include "core/singleton/ScopedSingletonIncludes.h"
    6060#include "util/SignalHandler.h"
    61 #include "PathConfig.h"
     61#include "ApplicationPaths.h"
     62#include "ConfigurablePaths.h"
    6263#include "commandline/CommandLineIncludes.h"
    6364#include "config/ConfigFileManager.h"
     
    9495
    9596    Core::Core(const std::string& cmdLine)
    96         : pathConfig_(NULL)
     97        : applicationPaths_(NULL)
     98        , configurablePaths_(NULL)
    9799        , dynLibManager_(NULL)
    98100        , signalHandler_(NULL)
     
    115117
    116118        // Set the hard coded fixed paths
    117         this->pathConfig_ = new PathConfig();
     119        this->applicationPaths_ = new ApplicationPaths();
    118120
    119121        // Create a new dynamic library manager
     
    122124        // Load modules
    123125        orxout(internal_info) << "Loading modules:" << endl;
    124         const std::vector<std::string>& modulePaths = this->pathConfig_->getModulePaths();
     126        const std::vector<std::string>& modulePaths = ApplicationPaths::getInstance().getModulePaths();
    125127        for (std::vector<std::string>::const_iterator it = modulePaths.begin(); it != modulePaths.end(); ++it)
    126128        {
     
    146148
    147149        // Set configurable paths like log, config and media
    148         this->pathConfig_->setConfigurablePaths();
    149 
    150         orxout(internal_info) << "Root path:       " << PathConfig::getRootPathString() << endl;
    151         orxout(internal_info) << "Executable path: " << PathConfig::getExecutablePathString() << endl;
    152         orxout(internal_info) << "Data path:       " << PathConfig::getDataPathString() << endl;
    153         orxout(internal_info) << "Ext. data path:  " << PathConfig::getExternalDataPathString() << endl;
    154         orxout(internal_info) << "Config path:     " << PathConfig::getConfigPathString() << endl;
    155         orxout(internal_info) << "Log path:        " << PathConfig::getLogPathString() << endl;
    156         orxout(internal_info) << "Modules path:    " << PathConfig::getModulePathString() << endl;
    157 
    158         // create a signal handler (only active for Linux)
     150        this->configurablePaths_ = new ConfigurablePaths();
     151        this->configurablePaths_->setConfigurablePaths(ApplicationPaths::getInstance());
     152
     153        orxout(internal_info) << "Root path:       " << ApplicationPaths::getRootPathString() << endl;
     154        orxout(internal_info) << "Executable path: " << ApplicationPaths::getExecutablePathString() << endl;
     155        orxout(internal_info) << "Modules path:    " << ApplicationPaths::getModulePathString() << endl;
     156
     157        orxout(internal_info) << "Data path:       " << ConfigurablePaths::getDataPathString() << endl;
     158        orxout(internal_info) << "Ext. data path:  " << ConfigurablePaths::getExternalDataPathString() << endl;
     159        orxout(internal_info) << "Config path:     " << ConfigurablePaths::getConfigPathString() << endl;
     160        orxout(internal_info) << "Log path:        " << ConfigurablePaths::getLogPathString() << endl;
     161
     162        // create a signal handler
    159163        // This call is placed as soon as possible, but after the directories are set
    160164        this->signalHandler_ = new SignalHandler();
    161         this->signalHandler_->doCatch(PathConfig::getExecutablePathString(), PathConfig::getLogPathString() + "orxonox_crash.log");
     165        this->signalHandler_->doCatch(ApplicationPaths::getExecutablePathString(), ConfigurablePaths::getLogPathString() + "orxonox_crash.log");
    162166
    163167#ifdef ORXONOX_PLATFORM_WINDOWS
     
    186190
    187191        // Set the correct log path and rewrite the log file with the correct log levels
    188         OutputManager::getInstance().getLogWriter()->setLogDirectory(PathConfig::getLogPathString());
     192        OutputManager::getInstance().getLogWriter()->setLogDirectory(ConfigurablePaths::getLogPathString());
    189193
    190194#if !defined(ORXONOX_PLATFORM_APPLE) && !defined(ORXONOX_USE_WINMAIN)
     
    209213
    210214        // initialise Tcl
    211         this->tclBind_ = new TclBind(PathConfig::getDataPathString());
     215        this->tclBind_ = new TclBind(ConfigurablePaths::getDataPathString());
    212216        this->tclThreadManager_ = new TclThreadManager(tclBind_->getTclInterpreter());
    213217
     
    255259        safeObjectDelete(&signalHandler_);
    256260        safeObjectDelete(&dynLibManager_);
    257         safeObjectDelete(&pathConfig_);
     261        safeObjectDelete(&configurablePaths_);
     262        safeObjectDelete(&applicationPaths_);
    258263
    259264        orxout(internal_status) << "finished destroying Core object" << endl;
Note: See TracChangeset for help on using the changeset viewer.