Import configs for iOS [WIP]

This commit is contained in:
pokamest 2023-05-15 17:57:35 -07:00
parent 19c42490e3
commit 230f44f4e6
5 changed files with 92 additions and 8 deletions

View file

@ -249,7 +249,7 @@ void AndroidController::cleanupBackendLogs() {
}
void AndroidController::importConfig(const QString& data){
m_startPageLogic->selectConfigFormat(data);
m_startPageLogic->importAnyFile(data);
}
const QJsonObject &AndroidController::vpnConfig() const

View file

@ -73,15 +73,13 @@
NSLog(@"Application openURL: %@", url);
if (url.fileURL) {
QString filePath(url.path.UTF8String);
qDebug() << "filePath:" << filePath;
if (filePath.isEmpty()) return NO;
QFile file(filePath);
bool isOpenFile = file.open(QIODevice::ReadOnly);
qDebug() << "isOpenFile:" << isOpenFile;
QByteArray data = file.readAll();
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importConnectionFromCode(QString(data));
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importAnyFile(QString(data));
return YES;
}
return NO;