Fix iOS build
This commit is contained in:
parent
4e9f68acff
commit
cacf74af3c
8 changed files with 15 additions and 18 deletions
|
|
@ -112,6 +112,7 @@ void AmneziaApplication::init()
|
|||
|
||||
#ifdef Q_OS_IOS
|
||||
IosController::Instance()->initialize();
|
||||
setImportController(m_importController.get());
|
||||
#endif
|
||||
|
||||
m_notificationHandler.reset(NotificationHandler::create(nullptr));
|
||||
|
|
|
|||
|
|
@ -40,17 +40,10 @@ void FileUtilites::saveFile(QString fileName, const QString &data)
|
|||
filesToSend.append(fileName);
|
||||
MobileUtils::shareText(filesToSend);
|
||||
return;
|
||||
#endif
|
||||
|
||||
#ifdef Q_OS_IOS
|
||||
QStringList filesToSend;
|
||||
filesToSend.append(fileUrl.toString());
|
||||
MobileUtils::shareText(filesToSend);
|
||||
return;
|
||||
#endif
|
||||
|
||||
#else
|
||||
QFileInfo fi(fileUrl.toLocalFile());
|
||||
QDesktopServices::openUrl(fi.absoluteDir().absolutePath());
|
||||
#endif
|
||||
}
|
||||
|
||||
QString FileUtilites::getFileName(QString fileName)
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#ifndef QTAPPDELEGATECINTERFACE_H
|
||||
#define QTAPPDELEGATECINTERFACE_H
|
||||
|
||||
#include "ui/pages_logic/StartPageLogic.h"
|
||||
#include "ui/controllers/importController.h"
|
||||
|
||||
void QtAppDelegateInitialize();
|
||||
void setStartPageLogic(StartPageLogic*);
|
||||
void setImportController(ImportController*);
|
||||
|
||||
#endif // QTAPPDELEGATECINTERFACE_H
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
#import <UIKit/UIKit.h>
|
||||
#import "QtAppDelegate-C-Interface.h"
|
||||
|
||||
#include "ui/pages_logic/StartPageLogic.h"
|
||||
#include "ui/controllers/importController.h"
|
||||
|
||||
@interface QtAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
+(QtAppDelegate *)sharedQtAppDelegate;
|
||||
@property (nonatomic) StartPageLogic* startPageLogic;
|
||||
@property (nonatomic) ImportController* ImportController;
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@
|
|||
bool isOpenFile = file.open(QIODevice::ReadOnly);
|
||||
QByteArray data = file.readAll();
|
||||
|
||||
[QtAppDelegate sharedQtAppDelegate].startPageLogic->importAnyFile(QString(data));
|
||||
[QtAppDelegate sharedQtAppDelegate].ImportController->extractConfigFromData(QString(data));
|
||||
return YES;
|
||||
}
|
||||
return NO;
|
||||
|
|
@ -92,8 +92,8 @@ void QtAppDelegateInitialize()
|
|||
NSLog(@"Created a new AppDelegate");
|
||||
}
|
||||
|
||||
void setStartPageLogic(StartPageLogic* startPage) {
|
||||
[QtAppDelegate sharedQtAppDelegate].startPageLogic = startPage;
|
||||
void setImportController(ImportController* controller) {
|
||||
[QtAppDelegate sharedQtAppDelegate].ImportController = controller;
|
||||
}
|
||||
|
||||
@end
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@ void ImportController::extractConfigFromFile(const QString &fileName)
|
|||
}
|
||||
}
|
||||
|
||||
void ImportController::extractConfigFromData(QString &data)
|
||||
void ImportController::extractConfigFromData(QString data)
|
||||
{
|
||||
auto configFormat = checkConfigFormat(data);
|
||||
if (configFormat == ConfigTypes::OpenVpn) {
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ public:
|
|||
public slots:
|
||||
void importConfig();
|
||||
void extractConfigFromFile(const QString &fileName);
|
||||
void extractConfigFromData(QString &data);
|
||||
void extractConfigFromData(QString data);
|
||||
void extractConfigFromCode(QString code);
|
||||
bool extractConfigFromQr(const QByteArray &data);
|
||||
QString getConfig();
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
#ifndef OSXUTIL_H
|
||||
#define OSXUTIL_H
|
||||
|
||||
#ifndef Q_OS_IOS
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
|
||||
void setDockIconVisible(bool visible);
|
||||
void fixWidget(QWidget *widget);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue