diff options
| author | oldmud0 <oldmud0@users.noreply.github.com> | 2020-08-13 10:47:50 -0500 |
|---|---|---|
| committer | oldmud0 <oldmud0@users.noreply.github.com> | 2020-08-13 10:48:53 -0500 |
| commit | e88f885a9f69909bd759b8cc81e089f85ee58930 (patch) | |
| tree | f8358f05bef0bb93b2ef132774fc7b31250dcb46 /src/path_functions.cpp | |
| parent | 593e9d7353f601f81bbe26925ace4966434e7370 (diff) | |
| parent | ec1c95bdb33dd063880c4cb6c3c9c3cf5d0ed454 (diff) | |
Merge master with some older CI changes
Diffstat (limited to 'src/path_functions.cpp')
| -rw-r--r-- | src/path_functions.cpp | 36 |
1 files changed, 4 insertions, 32 deletions
diff --git a/src/path_functions.cpp b/src/path_functions.cpp index 358f146b..10c8ae53 100644 --- a/src/path_functions.cpp +++ b/src/path_functions.cpp @@ -30,7 +30,7 @@ QString AOApplication::get_base_path() QString external_storage = getenv("EXTERNAL_STORAGE"); base_path = external_storage + "/AO2/"; } -#elif defined __APPLE__ +#elif defined(__APPLE__) base_path = applicationDirPath() + "/../../../base/"; #else base_path = applicationDirPath() + "/base/"; @@ -93,39 +93,11 @@ QString AOApplication::get_sounds_path(QString p_file) QString AOApplication::get_music_path(QString p_song) { - QString withending_check = get_base_path() + "sounds/music/" + p_song; - QString mp3_check = get_base_path() + "sounds/music/" + p_song + ".mp3"; - QString opus_check = get_base_path() + "sounds/music/" + p_song + ".opus"; - if (p_song.startsWith("http")) { - //it's an URL - return p_song; - } - else if (file_exists(opus_check)) { -#ifndef CASE_SENSITIVE_FILESYSTEM - return opus_check; -#else - return get_case_sensitive_path(opus_check); -#endif - } - else if (file_exists(mp3_check)) { + QString path = get_base_path() + "sounds/music/" + p_song; #ifndef CASE_SENSITIVE_FILESYSTEM - return mp3_check; -#else - return get_case_sensitive_path(mp3_check); -#endif - } - else if (file_exists(withending_check)) { -#ifndef CASE_SENSITIVE_FILESYSTEM - return withending_check; -#else - return get_case_sensitive_path(withending_check); -#endif - } -#ifndef CASE_SENSITIVE_FILESYSTEM - return get_base_path() + "sounds/music/" + p_song + ".wav"; + return path; #else - return get_case_sensitive_path(get_base_path() + "sounds/music/" + p_song + - ".wav"); + return get_case_sensitive_path(path); #endif } |
