Permalink
Browse files

Don't print stuff twice, and make sure data directories are checked c…

…orrectly
  • Loading branch information...
1 parent f05d428 commit e5006fe581314df11c1172d3c466ef3b681998dc @Timo6 Timo6 committed May 14, 2012
Showing with 6 additions and 4 deletions.
  1. +6 −4 src/pathmanager.cpp
View
@@ -56,16 +56,18 @@ void PATHMANAGER::Init(std::ostream & info_output, std::ostream & error_output)
// Find data dir.
const char * datadir = getenv("VDRIFT_DATA_DIRECTORY");
if (datadir == NULL)
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
if (FileExists("data/settings/options.config"))
data_directory = "data";
else
data_directory = DATA_DIR;
+#elif __APPLE__
+ data_directory = get_mac_data_dir();
#else
data_directory = "data";
#endif
- else
- data_directory = std::string(datadir);
+ else
+ data_directory = std::string(datadir);
// Find settings file.
settings_path = home_directory;
@@ -95,7 +97,7 @@ void PATHMANAGER::Init(std::ostream & info_output, std::ostream & error_output)
info_output << "Data directory: " << data_directory;
if (datadir)
info_output << "\nVDRIFT_DATA_DIRECTORY: " << datadir;
-#ifndef _WIN32
+#if !defined(_WIN32) && !defined(__APPLE__)
info_output << "\nDATA_DIR: " << DATA_DIR;
#endif
info_output << std::endl;

0 comments on commit e5006fe

Please sign in to comment.