Permalink
Browse files

fixes for Android res/raw folder (no subfolders.)

Signed-off-by: FellowTraveler <F3llowTraveler@gmail.com>
  • Loading branch information...
1 parent 6c46861 commit 21b0d8836ba6b9f39aa1a985273e9246547eac53 @FellowTraveler committed Feb 28, 2014
Showing with 9 additions and 7 deletions.
  1. +2 −2 include/otapi/OTAPI.hpp
  2. +1 −1 include/otlib/OTPaths.hpp
  3. +2 −2 src/otapi/OTAPI.cpp
  4. +1 −1 src/otapi/OT_ME.cpp
  5. +3 −1 src/otlib/OTPaths.cpp
View
@@ -213,9 +213,9 @@ public :
// Certain platforms use this to override the Prefix folder.
// Basically /usr/local is the prefix folder by default, meaning
// /usr/local/lib/opentxs will be the location of the scripts. But
- // if you override AppBinary folder to, say, "res/raw/files"
+ // if you override AppBinary folder to, say, "res/raw"
// (Android does something like that) then even though the prefix remains
- // as /usr/local, the scripts folder will be res/raw/lib/opentxs
+ // as /usr/local, the scripts folder will be res/raw
//
//
EXPORT static void SetAppBinaryFolder(const std::string & strFolder);
@@ -188,7 +188,7 @@ class OTPaths
//const bool & bIsRelative = false
);
- EXPORT static bool LoadSetScriptsFolder // ie. PrefixFolder() + lib/opentxs/
+ EXPORT static bool LoadSetScriptsFolder // ie. PrefixFolder() + [if (NOT Android) "lib/opentxs/" ]
(
OTSettings & config = s_settings, //optional
const OTString & strScriptsFolder = "", //optional
View
@@ -277,9 +277,9 @@ bool OTAPI_Wrap::AppCleanup() // Call this ONLY ONCE, when your App is shutting
// Certain platforms use this to override the Prefix folder.
// Basically /usr/local is the prefix folder by default, meaning
// /usr/local/lib/opentxs will be the location of the scripts. But
-// if you override AppBinary folder to, say, "res/raw/files"
+// if you override AppBinary folder to, say, "res/raw"
// (Android does something like that) then even though the prefix remains
-// as /usr/local, the scripts folder will be res/raw/lib/opentxs
+// as /usr/local, the scripts folder will be res/raw
//
//
void OTAPI_Wrap::SetAppBinaryFolder(const std::string & strFolder)
View
@@ -2775,7 +2775,7 @@ bool NewScriptExists(const OTString & strScriptFilename, bool bIsHeader, OTStrin
OT_FAIL;
}
- OTString strScriptsFolder(OTPaths::ScriptsFolder()); // /usr/local / lib / opentxs
+ OTString strScriptsFolder(OTPaths::ScriptsFolder()); // /usr/local / lib / opentxs OR (android) res/raw
{ bool bGetFolderSuccess = strScriptsFolder.Exists() && 3 < strScriptsFolder.GetLength();
OT_ASSERT_MSG(bGetFolderSuccess,"NewScriptHeaderExists: Unalbe to Get Scripts Path"); }
View
@@ -203,6 +203,8 @@
#ifdef _WIN32
#define OT_SCRIPTS_DIR "scripts/ot"
+#elif defined(ANDROID)
+#define OT_SCRIPTS_DIR ""
#else
#define OT_SCRIPTS_DIR "lib/opentxs"
#endif
@@ -455,7 +457,7 @@ bool OTPaths::LoadSetPrefixFolder // eg. /usr/local/
}
//static
-bool OTPaths::LoadSetScriptsFolder // ie. PrefixFolder() + lib/opentxs/
+bool OTPaths::LoadSetScriptsFolder // ie. PrefixFolder() + [ if (NOT Android) "lib/opentxs/" ]
(
OTSettings & config, //optional
const OTString & strScriptsFolder, //optional

0 comments on commit 21b0d88

Please sign in to comment.