mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-25 00:37:24 +02:00
[launcher] show button to copy existing data on iOS >= 13
This commit is contained in:
@ -25,5 +25,7 @@ const char *bundlePath();
|
|||||||
const char *frameworksPath();
|
const char *frameworksPath();
|
||||||
|
|
||||||
const char *bundleIdentifier();
|
const char *bundleIdentifier();
|
||||||
|
|
||||||
|
bool isOsVersionAtLeast(unsigned int osMajorVersion);
|
||||||
}
|
}
|
||||||
#pragma GCC visibility pop
|
#pragma GCC visibility pop
|
||||||
|
@ -46,4 +46,9 @@ const char *bundlePath() { return NSBundle.mainBundle.bundlePath.fileSystemRepre
|
|||||||
const char *frameworksPath() { return NSBundle.mainBundle.privateFrameworksPath.fileSystemRepresentation; }
|
const char *frameworksPath() { return NSBundle.mainBundle.privateFrameworksPath.fileSystemRepresentation; }
|
||||||
|
|
||||||
const char *bundleIdentifier() { return NSBundle.mainBundle.bundleIdentifier.UTF8String; }
|
const char *bundleIdentifier() { return NSBundle.mainBundle.bundleIdentifier.UTF8String; }
|
||||||
|
|
||||||
|
bool isOsVersionAtLeast(unsigned int osMajorVersion)
|
||||||
|
{
|
||||||
|
return NSProcessInfo.processInfo.operatingSystemVersion.majorVersion >= osMajorVersion;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -215,6 +215,7 @@ endif()
|
|||||||
|
|
||||||
if(APPLE_IOS)
|
if(APPLE_IOS)
|
||||||
target_link_libraries(vcmilauncher
|
target_link_libraries(vcmilauncher
|
||||||
|
iOS_utils
|
||||||
"-framework UniformTypeIdentifiers"
|
"-framework UniformTypeIdentifiers"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@
|
|||||||
|
|
||||||
#ifdef VCMI_IOS
|
#ifdef VCMI_IOS
|
||||||
#include "ios/selectdirectory.h"
|
#include "ios/selectdirectory.h"
|
||||||
|
|
||||||
|
#include "iOS_utils.h"
|
||||||
#elif defined(VCMI_ANDROID)
|
#elif defined(VCMI_ANDROID)
|
||||||
#include <QAndroidJniObject>
|
#include <QAndroidJniObject>
|
||||||
#include <QtAndroid>
|
#include <QtAndroid>
|
||||||
@ -228,9 +230,12 @@ void FirstLaunchView::heroesDataMissing()
|
|||||||
|
|
||||||
#ifdef VCMI_ANDROID
|
#ifdef VCMI_ANDROID
|
||||||
// selecting directory with ACTION_OPEN_DOCUMENT_TREE is available only since API level 21
|
// selecting directory with ACTION_OPEN_DOCUMENT_TREE is available only since API level 21
|
||||||
bool canUseDataCopy = QtAndroid::androidSdkVersion() >= 21;
|
const bool canUseDataCopy = QtAndroid::androidSdkVersion() >= 21;
|
||||||
|
#elif defined(VCMI_IOS)
|
||||||
|
// selecting directory through UIDocumentPickerViewController is available only since iOS 13
|
||||||
|
const bool canUseDataCopy = iOS_utils::isOsVersionAtLeast(13);
|
||||||
#else
|
#else
|
||||||
bool canUseDataCopy = true;
|
const bool canUseDataCopy = true;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
ui->labelDataCopyTitle->setVisible(canUseDataCopy);
|
ui->labelDataCopyTitle->setVisible(canUseDataCopy);
|
||||||
|
Reference in New Issue
Block a user