Refactoring/ios (#300)

iOS app refactoring (native part):
- connection bugs fixed
- improved stability 
- logs from network extension
This commit is contained in:
pokamest 2023-08-27 10:46:41 -07:00 committed by GitHub
parent 3ce1e40b43
commit ece15c7394
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
32 changed files with 935 additions and 3191 deletions

View file

@ -10,6 +10,10 @@
#include <QStandardPaths>
#include <utilities.h>
#ifdef Q_OS_IOS
#include <CoreFoundation/CoreFoundation.h>
#endif
using namespace amnezia;
using namespace PageEnumNS;
@ -89,6 +93,18 @@ void AppSettingsLogic::onPushButtonRestoreAppConfigClicked()
if (fileName.isEmpty()) return;
QFile file(fileName);
#ifdef Q_OS_IOS
CFURLRef url = CFURLCreateWithFileSystemPath(
kCFAllocatorDefault, CFStringCreateWithCharacters(0, reinterpret_cast<const UniChar *>(fileName.unicode()),
fileName.length()),
kCFURLPOSIXPathStyle, 0);
if (!CFURLStartAccessingSecurityScopedResource(url)) {
qDebug() << "Could not access path " << QUrl::fromLocalFile(fileName).toString();
}
#endif
file.open(QIODevice::ReadOnly);
QByteArray data = file.readAll();