CVSROOT: /cvsroot/wesnoth
Module name: wesnoth
Branch:
Changes by: Isaac Clerencia <[EMAIL PROTECTED]> 04/08/26 11:51:25
Modified files:
src : filesystem.cpp
Log message:
Add BeOS native settings path support, patch #3154 from ahwayakchih
CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/wesnoth/wesnoth/src/filesystem.cpp.diff?tr1=1.37&tr2=1.38&r1=text&r2=text
Patches:
Index: wesnoth/src/filesystem.cpp
diff -u wesnoth/src/filesystem.cpp:1.37 wesnoth/src/filesystem.cpp:1.38
--- wesnoth/src/filesystem.cpp:1.37 Mon Aug 23 06:40:59 2004
+++ wesnoth/src/filesystem.cpp Thu Aug 26 11:51:25 2004
@@ -1,4 +1,4 @@
-/* $Id: filesystem.cpp,v 1.37 2004/08/23 06:40:59 gakusho Exp $ */
+/* $Id: filesystem.cpp,v 1.38 2004/08/26 11:51:25 isaaccp Exp $ */
/*
Copyright (C) 2003 by David White <[EMAIL PROTECTED]>
Part of the Battle for Wesnoth Project http://wesnoth.whitevine.net
@@ -43,6 +43,13 @@
#endif
+#ifdef __BEOS__
+#include <Directory.h>
+#include <FindDirectory.h>
+#include <Path.h>
+BPath be_path;
+#endif
+
//for getenv
#include <cstdlib>
@@ -250,6 +257,19 @@
} else {
return "userdata";
}
+#elif defined(__BEOS__)
+ if (be_path.InitCheck() != B_OK) {
+ BPath tpath;
+ if (find_directory(B_USER_SETTINGS_DIRECTORY, &be_path, true)
== B_OK) {
+ be_path.Append("wesnoth");
+ } else {
+ be_path.SetTo("/boot/home/config/settings/wesnoth");
+ }
+ tpath = be_path;
+ tpath.Append("editor/maps");
+ create_directory(tpath.Path(), 0775);
+ }
+ return be_path.Path();
#else
static const char* const current_dir = ".";