Commit 9b0be45f authored by Martin Straka's avatar Martin Straka

Fixed iOS global helper object

parent 1d898372
......@@ -42,7 +42,6 @@
- (void)openExportDocumentPicker:(NSArray<NSURL *> *)exportUrls {
//NSLog(@"EXPORT FILE URLs: %@", exportUrls);
UIDocumentPickerViewController *documentPicker = [[UIDocumentPickerViewController alloc] initWithURLs:exportUrls inMode:UIDocumentPickerModeExportToService];
documentPicker.delegate = self;
documentPicker.modalPresentationStyle = UIModalPresentationFormSheet;
......@@ -71,12 +70,12 @@
QUrl tmpUrl = QUrl::fromNSURL(url);
qUrls.append(tmpUrl);
}
if (Q_NULLPTR != GlobInstcs::iOSHelperPtr) {
GlobInstcs::iOSHelperPtr->importFilesToAppInbox(qUrls);
}
} else if (controller.documentPickerMode == UIDocumentPickerModeExportToService) {
NSLog(@"STORAGE FILE URLs: %@", urls);
}
}
......
......@@ -408,6 +408,12 @@ int main(int argc, char *argv[])
logErrorNL("%s", "Cannot create image provider.");
return EXIT_FAILURE;
}
GlobInstcs::iOSHelperPtr = new (std::nothrow) IosHelper;
if (GlobInstcs::iOSHelperPtr == Q_NULLPTR) {
logErrorNL("%s", "Cannot create iOS helper.");
return EXIT_FAILURE;
}
}
QStringList cmdLineFileNames;
......@@ -448,6 +454,7 @@ int main(int argc, char *argv[])
Files files;
Log log(&memLog);
IsdsWrapper isds;
IosHelper iOSHelper;
GovWrapper gov(&isds);
GlobalSettingsQmlWrapper settings;
InteractionZfoFile interactionZfoFile;
......@@ -455,20 +462,14 @@ int main(int argc, char *argv[])
StringManipulation strManipulation;
Zfo zfo;
IosHelper iOSHelper;
GlobInstcs::iOSHelperPtr = new (std::nothrow) IosHelper;
if (GlobInstcs::iOSHelperPtr == Q_NULLPTR) {
logErrorNL("%s", "Cannot create iOS helper.");
return EXIT_FAILURE;
}
GlobInstcs::iOSHelperPtr = &iOSHelper;
/* Inicialize app delegate component for interaction with iOS
* Reaction on the iOS action "Open in..." */
#if defined Q_OS_IOS
QtAppDelegateInitialize(&interactionZfoFile);
GlobInstcs::iOSHelperPtr = &iOSHelper;
/* Clear send dir. */
iOSHelper.clearSendDir();
#endif
......@@ -763,7 +764,7 @@ int main(int argc, char *argv[])
delete GlobInstcs::workPoolPtr; GlobInstcs::workPoolPtr = Q_NULLPTR;
delete GlobInstcs::msgProcEmitterPtr; GlobInstcs::msgProcEmitterPtr = Q_NULLPTR;
delete GlobInstcs::iOSHelperPtr; GlobInstcs::iOSHelperPtr = Q_NULLPTR;
GlobInstcs::iOSHelperPtr = Q_NULLPTR;
}
/* Finally, destroy global log object. */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment