|
From: Lasse Kärkkäi. <tr...@us...> - 2009-12-08 05:55:36
|
Module: performous
Branch: master
Commit: ed910310ae0c84496afc7d613032ed00db0edab3
Author: Lasse Karkkainen <tro...@tr...>
Date: Tue Dec 8 07:18:52 2009 +0200
Revert "Added shared data dir outside prefix (gentoo requirement)"
This reverts commit e9516b593b2573e392e0b4b6746b6de3901ded65.
---
game/configuration.cc | 6 +-----
game/fs.cc | 9 ++-------
2 files changed, 3 insertions(+), 12 deletions(-)
diff --git a/game/configuration.cc b/game/configuration.cc
index c40686e..26d41b6 100644
--- a/game/configuration.cc
+++ b/game/configuration.cc
@@ -316,11 +316,7 @@ void readConfig() {
typedef std::vector<std::string> ConfigList;
ConfigList config_list;
char const* root = getenv("PERFORMOUS_ROOT");
- if( SHARED_DATA_DIR[0] == '/' ) {
- config_list.push_back(SHARED_DATA_DIR CONFIG_SCHEMA);
- } else {
- if (root) config_list.push_back(std::string(root) + "/" SHARED_DATA_DIR CONFIG_SCHEMA);
- }
+ if (root) config_list.push_back(std::string(root) + "/" SHARED_DATA_DIR CONFIG_SCHEMA);
fs::path exec = plugin::execname();
if (!exec.empty()) config_list.push_back(exec.parent_path().string() + "/../" SHARED_DATA_DIR CONFIG_SCHEMA);
ConfigList::const_iterator it = std::find_if(config_list.begin(), config_list.end(), static_cast<bool(&)(fs::path const&)>(fs::exists));
diff --git a/game/fs.cc b/game/fs.cc
index 3d3fc30..852529a 100644
--- a/game/fs.cc
+++ b/game/fs.cc
@@ -88,13 +88,8 @@ std::string getPath(fs::path const& filename) {
dirs.push_back(xdg_data_home ? xdg_data_home / shortDir : getHomeDir() / ".local" / shareDir);
}
#endif
- if( shareDir.string()[0] == '/' ) {
- // Adding absolute path
- dirs.push_back(shareDir);
- } else {
- // Adding relative path from executable
- dirs.push_back(plugin::execname().parent_path().parent_path() / shareDir);
- }
+ // Adding relative path from executable
+ dirs.push_back(plugin::execname().parent_path().parent_path() / shareDir);
#ifndef _WIN32
// Adding XDG_DATA_DIRS
{
|