Skip to content

Commit

Permalink
Don't print stuff twice, and make sure data directories are checked c…
Browse files Browse the repository at this point in the history
…orrectly
  • Loading branch information
Timo6 committed May 14, 2012
1 parent f05d428 commit e5006fe
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/pathmanager.cpp
Expand Up @@ -56,16 +56,18 @@ void PATHMANAGER::Init(std::ostream & info_output, std::ostream & error_output)
// Find data dir. // Find data dir.
const char * datadir = getenv("VDRIFT_DATA_DIRECTORY"); const char * datadir = getenv("VDRIFT_DATA_DIRECTORY");
if (datadir == NULL) if (datadir == NULL)
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
if (FileExists("data/settings/options.config")) if (FileExists("data/settings/options.config"))
data_directory = "data"; data_directory = "data";
else else
data_directory = DATA_DIR; data_directory = DATA_DIR;
#elif __APPLE__
data_directory = get_mac_data_dir();
#else #else
data_directory = "data"; data_directory = "data";
#endif #endif
else else
data_directory = std::string(datadir); data_directory = std::string(datadir);


// Find settings file. // Find settings file.
settings_path = home_directory; settings_path = home_directory;
Expand Down Expand Up @@ -95,7 +97,7 @@ void PATHMANAGER::Init(std::ostream & info_output, std::ostream & error_output)
info_output << "Data directory: " << data_directory; info_output << "Data directory: " << data_directory;
if (datadir) if (datadir)
info_output << "\nVDRIFT_DATA_DIRECTORY: " << datadir; info_output << "\nVDRIFT_DATA_DIRECTORY: " << datadir;
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
info_output << "\nDATA_DIR: " << DATA_DIR; info_output << "\nDATA_DIR: " << DATA_DIR;
#endif #endif
info_output << std::endl; info_output << std::endl;
Expand Down

0 comments on commit e5006fe

Please sign in to comment.