Save files for iOS
This commit is contained in:
parent
1b3a32f83f
commit
195a3ab170
6 changed files with 22 additions and 9 deletions
|
@ -24,7 +24,8 @@ void FileUtilites::saveFile(QString fileName, const QString &data)
|
|||
#endif
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
QFile file(fileName);
|
||||
QUrl fileUrl = QDir::tempPath() + "/" + fileName;
|
||||
QFile file(fileUrl.toString());
|
||||
#else
|
||||
QUrl fileUrl = QUrl(fileName);
|
||||
QFile file(fileUrl.toLocalFile());
|
||||
|
@ -37,7 +38,7 @@ void FileUtilites::saveFile(QString fileName, const QString &data)
|
|||
|
||||
#ifdef Q_OS_IOS
|
||||
QStringList filesToSend;
|
||||
filesToSend.append(fileName);
|
||||
filesToSend.append(fileUrl.toString());
|
||||
MobileUtils::shareText(filesToSend);
|
||||
return;
|
||||
#else
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
#ifndef QTAPPDELEGATECINTERFACE_H
|
||||
#define QTAPPDELEGATECINTERFACE_H
|
||||
|
||||
#include "ui/controllers/importController.h"
|
||||
|
||||
void QtAppDelegateInitialize();
|
||||
|
||||
#endif // QTAPPDELEGATECINTERFACE_H
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
|
||||
#include "ui/controllers/importController.h"
|
||||
|
||||
@interface QtAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
@end
|
||||
|
|
|
@ -69,7 +69,13 @@ DrawerType {
|
|||
text: qsTr("Share")
|
||||
imageSource: "qrc:/images/controls/share-2.svg"
|
||||
|
||||
onClicked: fileDialog.open()
|
||||
onClicked: {
|
||||
if (Qt.platform.os === "ios") {
|
||||
ExportController.saveFile("amnezia_config.vpn")
|
||||
} else {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
|
|
|
@ -100,7 +100,13 @@ PageType {
|
|||
|
||||
image: "qrc:/images/controls/save.svg"
|
||||
|
||||
onClicked: fileDialog.open()
|
||||
onClicked: {
|
||||
if (Qt.platform.os === "ios") {
|
||||
SettingsController.exportLogsFile("AmneziaVPN.log")
|
||||
} else {
|
||||
fileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: fileDialog
|
||||
|
|
|
@ -302,8 +302,12 @@ PageType {
|
|||
text: qsTr("Save site list")
|
||||
|
||||
clickedFunction: function() {
|
||||
if (Qt.platform.os === "ios") {
|
||||
ExportController.saveFile("amezia_tunnel.json")
|
||||
} else {
|
||||
saveFileDialog.open()
|
||||
}
|
||||
}
|
||||
|
||||
FileDialog {
|
||||
id: saveFileDialog
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue