Commit b53c09a1 authored by Martin Straka's avatar Martin Straka

iOS: Added licence statement and some comments

parent c7a633b1
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#import <UIKit/UIKit.h>
#import <qt_app_delegate.h>
......
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#include <QtCore>
#include "src/files.h"
......@@ -5,9 +28,11 @@
@implementation QtAppDelegate
/* Pointer to Files object - use openZfoFileFromStorage for zfo showing */
Files *filesPtr;
+(QtAppDelegate *)sharedQtAppDelegate{
+(QtAppDelegate *)sharedQtAppDelegate
{
static dispatch_once_t pred;
static QtAppDelegate *shared = nil;
dispatch_once(&pred, ^{shared = [[super alloc] init];});
......@@ -22,7 +47,7 @@ Files *filesPtr;
if (url != nil && [url isFileURL]) {
if ([[url pathExtension] isEqualToString:@"zfo"]) {
NSLog(@"URL:%@", [url absoluteString]);
//NSLog(@"URL:%@", [url absoluteString]);
if (Q_NULLPTR != filesPtr) {
filesPtr->openZfoFileFromStorage(QString::fromNSString(url.path));
}
......@@ -33,9 +58,11 @@ Files *filesPtr;
void QtAppDelegateInitialize (Files *files)
{
/* Pointer to Files object */
filesPtr = files;
/* Init share app delegate with iOS */
[[UIApplication sharedApplication] setDelegate:[QtAppDelegate sharedQtAppDelegate]];
NSLog(@"Created a new appdelegate");
//NSLog(@"Created a new appdelegate");
}
@end
/*
* Copyright (C) 2014-2017 CZ.NIC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* In addition, as a special exception, the copyright holders give
* permission to link the code of portions of this program with the
* OpenSSL library under certain conditions as described in each
* individual source file, and distribute linked combinations including
* the two.
*/
#ifndef QTAPPDELEGATECINTERFACE_H
#define QTAPPDELEGATECINTERFACE_H
#include "src/files.h"
/*!
* @brief Inicialization of App Delegate for interaction with iOS service
* "Open in" in Qt.
*
* @param[in] files Pointer to Files object.
*/
void QtAppDelegateInitialize(Files *files);
#endif // QTAPPDELEGATECINTERFACE_H
......@@ -48,7 +48,7 @@
#include "src/sqlite/file_db_container.h"
#include "src/setwrapper.h"
/* iOS extras. */
/* iOS app_delegate - for interaction with iOS action Open in... */
#if defined Q_OS_IOS
#include "ios/src/qt_app_delegate.h"
#endif
......@@ -217,6 +217,8 @@ int main(int argc, char *argv[])
IsdsWrapper isds;
GlobalSettingsQmlWrapper settings;
/* Inicialize app delegate component for interaction with iOS
* Reaction on the iOS action "Open in..." */
#if defined Q_OS_IOS
QtAppDelegateInitialize(&files);
#endif
......
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