diff options
| -rw-r--r-- | android/AndroidManifest.xml | 12 | ||||
| -rw-r--r-- | path_functions.cpp | 20 | ||||
| -rw-r--r-- | text_file_functions.cpp | 4 |
3 files changed, 24 insertions, 12 deletions
diff --git a/android/AndroidManifest.xml b/android/AndroidManifest.xml index 73d5c2c4..f458c6a7 100644 --- a/android/AndroidManifest.xml +++ b/android/AndroidManifest.xml @@ -1,7 +1,7 @@ <?xml version="1.0"?> -<manifest package="com.aceattorneyonline.android" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.3.5.0" android:versionCode="2" android:installLocation="auto"> - <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Attorney Online" android:icon="@drawable/icon"> - <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="Attorney Online Lobby" android:screenOrientation="unspecified" android:launchMode="singleTop"> +<manifest package="com.aceattorneyonline.ao2" xmlns:android="http://schemas.android.com/apk/res/android" android:versionName="2.3.5.0" android:versionCode="2" android:installLocation="auto"> + <application android:hardwareAccelerated="true" android:name="org.qtproject.qt5.android.bindings.QtApplication" android:label="Attorney Online 2" android:icon="@drawable/icon"> + <activity android:configChanges="orientation|uiMode|screenLayout|screenSize|smallestScreenSize|layoutDirection|locale|fontScale|keyboard|keyboardHidden|navigation" android:name="org.qtproject.qt5.android.bindings.QtActivity" android:label="Attorney Online 2 Lobby" android:screenOrientation="unspecified" android:launchMode="singleTop"> <intent-filter> <action android:name="android.intent.action.MAIN"/> <category android:name="android.intent.category.LAUNCHER"/> @@ -11,7 +11,7 @@ <!-- meta-data android:name="android.app.arguments" android:value="arg1 arg2 arg3"/ --> <!-- Application arguments --> - <meta-data android:name="android.app.lib_name" android:value="Attorney_Online_remake"/> + <meta-data android:name="android.app.lib_name" android:value="-- %%INSERT_APP_LIB_NAME%% --"/> <meta-data android:name="android.app.qt_sources_resource_id" android:resource="@array/qt_sources"/> <meta-data android:name="android.app.repository" android:value="default"/> <meta-data android:name="android.app.qt_libs_resource_id" android:resource="@array/qt_libs"/> @@ -63,12 +63,12 @@ </application> - <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="16"/> + <uses-sdk android:minSdkVersion="16" android:targetSdkVersion="23"/> <supports-screens android:largeScreens="true" android:normalScreens="true" android:anyDensity="true" android:smallScreens="true"/> <!-- The following comment will be replaced upon deployment with default permissions based on the dependencies of the application. Remove the comment if you do not require these default permissions. --> - <!-- %%INSERT_PERMISSIONS --> + <!-- The following comment will be replaced upon deployment with default features based on the dependencies of the application. Remove the comment if you do not require these default features. --> diff --git a/path_functions.cpp b/path_functions.cpp index e9476d56..c415fa09 100644 --- a/path_functions.cpp +++ b/path_functions.cpp @@ -3,22 +3,32 @@ #include "file_functions.h" #include <QDir> #include <QDebug> +#include <QStandardPaths> #ifdef BASE_OVERRIDE #include "base_override.h" #endif +QString base_path = ""; QString AOApplication::get_base_path() { + if (base_path == "") + { #ifdef BASE_OVERRIDE - return base_override; + base_path = base_override; #elif defined(ANDROID) - return "/storage/extSdCard/AO2/"; + QString sdcard_storage = getenv("SECONDARY_STORAGE"); + if (dir_exists(sdcard_storage)){ + base_path = sdcard_storage + "/AO2/"; + }else{ + QString external_storage = getenv("EXTERNAL_STORAGE"); + base_path = external_storage + "/AO2/"; + } #else - return QDir::currentPath() + "/base/"; + base_path = QDir::currentPath() + "/base/"; #endif - - +} + return base_path; /* #ifdef OMNI_DEBUG return "/media/omnitroid/Data/winshare/AO/client/base/"; diff --git a/text_file_functions.cpp b/text_file_functions.cpp index fc75eab7..e4bc2a10 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -152,8 +152,10 @@ QString AOApplication::read_design_ini(QString p_identifier, QString p_design_pa design_ini.setFileName(p_design_path); if (!design_ini.open(QIODevice::ReadOnly)) + { + qDebug() << "Could not find design ini " + p_design_path; return ""; - + } QTextStream in(&design_ini); QString result = ""; |
