Commit 8099f493 authored by Martin Straka's avatar Martin Straka

Removed obsolete and unused code

parent 1de1b1ea
...@@ -12,7 +12,6 @@ HEADERS += \ ...@@ -12,7 +12,6 @@ HEADERS += \
ios/src/doc_picker_controller.h \ ios/src/doc_picker_controller.h \
ios/src/doc_view_controller.h \ ios/src/doc_view_controller.h \
ios/src/qt_app_delegate.h \ ios/src/qt_app_delegate.h \
ios/src/icloud_controller.h \
ios/src/icloud_io.h \ ios/src/icloud_io.h \
ios/src/ios_file_opener.h \ ios/src/ios_file_opener.h \
ios/src/send_email_controller.h \ ios/src/send_email_controller.h \
...@@ -22,7 +21,6 @@ OBJECTIVE_SOURCES += \ ...@@ -22,7 +21,6 @@ OBJECTIVE_SOURCES += \
ios/src/app_delegate.mm \ ios/src/app_delegate.mm \
ios/src/doc_picker_controller.mm \ ios/src/doc_picker_controller.mm \
ios/src/doc_view_controller.mm \ ios/src/doc_view_controller.mm \
ios/src/icloud_controller.mm \
ios/src/icloud_io.mm \ ios/src/icloud_io.mm \
ios/src/ios_file_opener.mm \ ios/src/ios_file_opener.mm \
ios/src/send_email_controller.mm \ ios/src/send_email_controller.mm \
......
/*
* Copyright (C) 2014-2018 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>
@interface ICloudViewController : UIViewController
- (void)getCloudHierarchyAsync;
@property (strong) NSMetadataQuery *query;
@end
/*
* Copyright (C) 2014-2018 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 <QStringList>
#import "ios/src/icloud_controller.h"
#include "src/auxiliaries/icloud_helper.h"
// External globals for transporting of async results back to C++ and QML.
QStringList iCloudFileList;
bool isSearchRunning;
@implementation ICloudViewController
- (void)replyDataNotification:(NSNotification *)notification {
NSMetadataQuery *query = [notification object];
[query disableUpdates];
[query stopQuery];
QStringList files;
for (NSMetadataItem *item in [query results]) {
NSURL *documentURL = [item valueForAttribute:NSMetadataItemURLKey];
files.append(QString::fromNSString(documentURL.absoluteString));
//NSLog(@"iCloud:\n %@\n", documentURL);
}
[[NSNotificationCenter defaultCenter] removeObserver:self name:NSMetadataQueryDidFinishGatheringNotification object:self.query];
self.query = nil;
iCloudFileList = files;
isSearchRunning = false;
}
- (void)getCloudHierarchyAsync {
isSearchRunning = true;
self.query = [[NSMetadataQuery alloc] init];
//[self.query setSearchScopes:[NSArray arrayWithObject:NSMetadataQueryUbiquitousDataScope]];
[self.query setSearchScopes:[NSArray arrayWithObject:NSMetadataQueryUbiquitousDocumentsScope]];
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"%K like '*'", NSMetadataItemFSNameKey];
[self.query setPredicate:predicate];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(replyDataNotification:) name:NSMetadataQueryDidFinishGatheringNotification object:self.query];
[self.query startQuery];
}
@end
...@@ -62,35 +62,6 @@ public: ...@@ -62,35 +62,6 @@ public:
static static
bool isCloudOn(void); bool isCloudOn(void);
/*!
* @brief Create Datovka iCloud conteiner if not exists.
*/
static
void createCloudConteiner(void);
/*!
* @brief Copy single file from iCloud continer to Datovka sandbox.
*
* @param[in] cloudFilePath Source file path.
* @param[in] localFilePath iCloud target path.
* @return Full path where file will stored.
*/
static
QString copyFileFromCloud(const QString &cloudFilePath,
const QString &localFilePath);
/*!
* @brief Search for local iCloud hierarchy - not used now.
*/
static
QStringList getCloudHierarchy(const QString &dir);
/*!
* @brief Create and send async search query for iCloud hierarchy.
*/
static
bool getCloudHierarchyAsync(void);
/*! /*!
* @brief Upload single file into iCloud. * @brief Upload single file into iCloud.
* *
...@@ -102,15 +73,6 @@ public: ...@@ -102,15 +73,6 @@ public:
ICloudResult moveFileToCloud(const QString &srcFilePath, ICloudResult moveFileToCloud(const QString &srcFilePath,
const QString &destFilePath); const QString &destFilePath);
/*!
* @brief Test if file exists in local iCloud conteiner.
*
* @param[in] cloudFilePath iCloud file path.
* @return True if file exists in local iCloud conteiner.
*/
static
bool isDownloadedFromCloud(const QString &cloudFilePath);
/*! /*!
* @brief Create and open document picker controller. * @brief Create and open document picker controller.
* *
......
...@@ -22,7 +22,6 @@ ...@@ -22,7 +22,6 @@
*/ */
#include "ios/src/doc_picker_controller.h" #include "ios/src/doc_picker_controller.h"
#include "ios/src/icloud_controller.h"
#include "ios/src/icloud_io.h" #include "ios/src/icloud_io.h"
ICloudIo::ICloudIo(QObject *parent) ICloudIo::ICloudIo(QObject *parent)
...@@ -30,11 +29,11 @@ ICloudIo::ICloudIo(QObject *parent) ...@@ -30,11 +29,11 @@ ICloudIo::ICloudIo(QObject *parent)
{ {
} }
NSURL * getCloudBaseUrl() { NSURL *getCloudBaseUrl() {
return [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; return [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
} }
NSURL * getCloudDocumentsUrl(NSURL *baseURL) { NSURL *getCloudDocumentsUrl(NSURL *baseURL) {
return [baseURL URLByAppendingPathComponent:@"Documents"]; return [baseURL URLByAppendingPathComponent:@"Documents"];
} }
...@@ -42,71 +41,6 @@ bool ICloudIo::isCloudOn(void) { ...@@ -42,71 +41,6 @@ bool ICloudIo::isCloudOn(void) {
return [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; return [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil];
} }
void ICloudIo::createCloudConteiner(void)
{
NSURL *baseURL = getCloudBaseUrl();
if (!baseURL) {
NSLog(@"iCloud: Unable to access iCloud.");
return;
}
// Create iCloud send message dir
NSURL *sendDirURL = [getCloudDocumentsUrl(baseURL) URLByAppendingPathComponent:@"Send"];
// Create send message subdirectorues for iCloud
NSError *error = nil;
if (![[NSFileManager defaultManager] createDirectoryAtURL:sendDirURL
withIntermediateDirectories:YES attributes:nil error:&error]) {
NSLog(@"iCloud: Create message subdirectories error: %@", error);
return;
}
// Upload send dir into iCloud
if ([[NSFileManager defaultManager] setUbiquitous:YES
itemAtURL:sendDirURL destinationURL:sendDirURL error:&error]) {
NSLog(@"iCloud: File %@ has been uploaded.", sendDirURL);
}
}
/* TODO - removed this tmp function */
QStringList ICloudIo::getCloudHierarchy(const QString &dir)
{
QStringList fileList;
NSURL *baseURL = getCloudBaseUrl();
if (!baseURL) {
NSLog(@"iCloud: Unable to access iCloud.");
return QStringList();
}
// Create iCloud target path
NSURL *documentURL = getCloudDocumentsUrl(baseURL);
NSURL *fileURL;
if (dir.isEmpty()) {
fileURL = documentURL;
} else {
fileURL = [documentURL URLByAppendingPathComponent:dir.toNSString()];
}
NSArray *directoryContent = [[NSFileManager defaultManager] contentsOfDirectoryAtURL:fileURL includingPropertiesForKeys:nil options:0 error:nil];
for (NSUInteger i = 0; i < [directoryContent count]; i++) {
NSLog(@"iCloud:\n %@\n", directoryContent[i]);
NSURL *fileUrlx = directoryContent[i];
fileList.append(QString::fromNSString(fileUrlx.absoluteString));
}
return fileList;
}
bool ICloudIo::getCloudHierarchyAsync(void)
{
static ICloudViewController* iCloudCntlr = nil;
iCloudCntlr = [[ICloudViewController alloc] init];
[iCloudCntlr getCloudHierarchyAsync];
return true;
}
ICloudIo::ICloudResult ICloudIo::moveFileToCloud( ICloudIo::ICloudResult ICloudIo::moveFileToCloud(
const QString &srcFilePath, const QString &destFilePath) const QString &srcFilePath, const QString &destFilePath)
{ {
...@@ -146,81 +80,6 @@ ICloudIo::ICloudResult ICloudIo::moveFileToCloud( ...@@ -146,81 +80,6 @@ ICloudIo::ICloudResult ICloudIo::moveFileToCloud(
} }
} }
QString ICloudIo::copyFileFromCloud(const QString &cloudFilePath,
const QString &localFilePath)
{
// Test if file was downloaded from iCloud
if (!isDownloadedFromCloud(cloudFilePath)) {
NSLog(@"Local: File has not been downloaded yet from iCloud.");
return QString();
}
// Convert string path to URL
NSURL *fileCloudUrl = [NSURL URLWithString:cloudFilePath.toNSString()];
NSURL* localFileUrl = [NSURL fileURLWithPath:localFilePath.toNSString()];
NSString *fileName = [fileCloudUrl lastPathComponent];
// Create subdirectorues on Local
NSError *error = nil;
if (![[NSFileManager defaultManager] createDirectoryAtURL:localFileUrl
withIntermediateDirectories:YES attributes:nil error:&error]) {
NSLog(@"Local: Create message subdirectories error: %@", error.localizedDescription);
return QString();
}
NSURL *fileLocalUrl = [localFileUrl URLByAppendingPathComponent:fileName];
//NSLog(@"iCloud url: %@", fileCloudUrl);
//NSLog(@"Local file url: %@", fileLocalUrl);
// Remove file from local
[[NSFileManager defaultManager] removeItemAtURL:fileLocalUrl error:&error];
if ([[NSFileManager defaultManager] copyItemAtURL:fileCloudUrl toURL:fileLocalUrl error:&error]) {
NSLog(@"Local: File has copied to app sandbox.");
return QString::fromNSString(fileLocalUrl.absoluteString);
} else {
if (error.code == NSFileWriteFileExistsError) {
NSLog(@"Local: File with the same name already exists.");
} else if (error.code == NSFileReadNoSuchFileError) {
NSLog(@"Local: File has not downloaded yet from iCloud.");
} else {
NSLog(@"Local: Error code: %zd %@", error.code, error);
}
}
return QString();
}
bool ICloudIo::isDownloadedFromCloud(const QString &cloudFilePath)
{
NSURL *baseURL = getCloudBaseUrl();
if (!baseURL) {
NSLog(@"iCloud: Unable to access iCloud.");
return false;
}
NSError *error = nil;
NSString *downloadStatus = nil;
NSURL *fileCloudUrl = [NSURL URLWithString:cloudFilePath.toNSString()];
if ([fileCloudUrl getResourceValue:&downloadStatus forKey:NSURLUbiquitousItemDownloadingStatusKey error:&error] == YES) {
if ([downloadStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusNotDownloaded] == YES) {
NSLog(@"File missing and must be downloaded: %@", fileCloudUrl);
[[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:fileCloudUrl error:&error];
return false;
} else if ([downloadStatus isEqualToString:NSURLUbiquitousItemDownloadingStatusDownloaded] == YES) {
NSLog(@"Up-to-date version of file must be downloaded: %@", fileCloudUrl);
[[NSFileManager defaultManager] startDownloadingUbiquitousItemAtURL:fileCloudUrl error:&error];
return false;
} else {
NSLog(@"Up-to-date version of file is available: %@", fileCloudUrl);
return true;
}
}
return false;
}
bool ICloudIo::openDocumentPickerController(const QStringList &exportFilesPath) bool ICloudIo::openDocumentPickerController(const QStringList &exportFilesPath)
{ {
static DocumentPickerController* dpc = nil; static DocumentPickerController* dpc = nil;
......
...@@ -154,7 +154,6 @@ SOURCES += \ ...@@ -154,7 +154,6 @@ SOURCES += \
src/main.cpp \ src/main.cpp \
src/messages.cpp \ src/messages.cpp \
src/models/accountmodel.cpp \ src/models/accountmodel.cpp \
src/models/cloudmodel.cpp \
src/models/databoxmodel.cpp \ src/models/databoxmodel.cpp \
src/models/filemodel.cpp \ src/models/filemodel.cpp \
src/models/list_sort_filter_proxy_model.cpp \ src/models/list_sort_filter_proxy_model.cpp \
...@@ -280,7 +279,6 @@ HEADERS += \ ...@@ -280,7 +279,6 @@ HEADERS += \
src/log.h \ src/log.h \
src/messages.h \ src/messages.h \
src/models/accountmodel.h \ src/models/accountmodel.h \
src/models/cloudmodel.h \
src/models/databoxmodel.h \ src/models/databoxmodel.h \
src/models/filemodel.h \ src/models/filemodel.h \
src/models/list_sort_filter_proxy_model.h \ src/models/list_sort_filter_proxy_model.h \
......
/*
* Copyright (C) 2014-2018 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 QtQuick 2.7
import QtQuick.Controls 2.2
import QtQuick.Layouts 1.3
import cz.nic.mobileDatovka 1.0
import cz.nic.mobileDatovka.qmlInteraction 1.0
import cz.nic.mobileDatovka.models 1.0
Dialog {
id: root
focus: true
modal: true
title: qsTr("Select files")
footer: DialogButtonBox {
AccessibleButton {
text: qsTr("Cancel")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}
AccessibleButton {
text: qsTr("Add")
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
}
/* Place the dialogue in the centre. */
x: 2 * defaultMargin
y: 2 * defaultMargin
height: parent.height - 4 * defaultMargin
width: parent.width - 4 * defaultMargin
signal finished(variant pathListModel)
function raise(title, filters, showFiles, targetLocation) {
cloudFileListModel.clearAll()
pathListModel.clear()
filterBar.filterField.text = ""
iCloudHelper.getCloudHierarchyAsync()
root.open()
}
/* Holds cloud file list model */
CloudFileListModel {
id: cloudFileListModel
Component.onCompleted: {
}
}
ListSortFilterProxyModel {
id: proxyCloudFileListModel
Component.onCompleted: {
setFilterRoles([CloudFileListModel.ROLE_FILE_NAME,
CloudFileListModel.ROLE_FILE_SHORT_PATH])
proxyCloudFileListModel.setSourceModel(cloudFileListModel)
}
}
ListModel {
id: pathListModel
}
contentItem: ColumnLayout {
spacing: formItemVerticalSpacing
Connections {
target: iCloudHelper
onCloudContentSig: {
iCloudHelper.setCloudFileModel(cloudFileListModel, iCloudFileList);
if (cloudFileListModel.rowCount() > 0) {
cloudFileList.visible = true
emptyList.visible = !cloudFileList.visible
} else {
emptyList.text = qsTr("No files in the iCloud.")
cloudFileList.visible = false
emptyList.visible = !cloudFileList.visible
}
}
onCloudActivitySig: {
emptyList.text = txt
cloudFileList.visible = false
emptyList.visible = !cloudFileList.visible
}
}
Component {
id: attachmentDelegate
Rectangle {
id: attachmentItem
width: parent.width
height: cloudFileList.delegateHeight
color: rFileSelected ? datovkaPalette.midlight : datovkaPalette.base
Image {
id: imageAttachment
anchors.left: parent.left
anchors.verticalCenter: parent.verticalCenter
sourceSize.height: cloudFileList.delegateHeight * 0.8
source: files.getAttachmentFileIcon(rFileName)
}
Item {
anchors.left: imageAttachment.right
anchors.leftMargin: defaultMargin
height: parent.height
width: parent.width
Column {
width: parent.width
anchors.verticalCenter: parent.verticalCenter
spacing: defaultMargin
Text {
text: rFileName
color: datovkaPalette.text
font.bold: true
}
Text {
text: "iCloud:" + rFileShortPath
color: datovkaPalette.mid
font.pointSize: textFontSizeSmall
}
}
}
Rectangle {
anchors.top: parent.bottom
height: 1
width: parent.width
color: datovkaPalette.dark
}
MouseArea {
anchors.fill: parent
onClicked: {
if (!rFileSelected) {
iCloudHelper.downloadFileFromCloud(rFileCloudPath)
}
cloudFileListModel.setFileSelected(rFileCloudPath)
}
}
} // Rectangle
} // Component
FilterBar {
id: filterBar
visible: true
Layout.fillWidth: true
height: filterField.height
color: (filterField.text.length === 0) ? datovkaPalette.alternateBase :
(cloudFileList.count > 0) ? "#afffaf" : "#ffafaf"
border.color: filterField.activeFocus ? "#0066ff" : "#bdbebf"
placeholderText: qsTr("Set filter")
fontPointSize: defaultTextFont.font.pointSize
buttonImageHeight: imgHeight
buttonAccessibleName: qsTr("Clear and hide filter field")
onTextChanged: {
proxyCloudFileListModel.setFilterRegExpStr(text)
}
onClearClicked: {
filterField.text.clear
}
}
AccessibleText {
id: emptyList
visible: true
color: datovkaPalette.text
Layout.fillHeight: true
Layout.fillWidth: true
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
text: qsTr("No files in the iCloud.")
}
ScrollableListView {
id: cloudFileList
visible: false
delegateHeight: headerHeight
Layout.fillHeight: true
Layout.fillWidth: true
clip: true
spacing: 1
opacity: 1
interactive: true
model: proxyCloudFileListModel
delegate: attachmentDelegate
ScrollIndicator.vertical: ScrollIndicator {}
} // Listview
} // ColumnLayout
onAccepted: {
for (var i = 0; i < cloudFileListModel.rowCount(); ++i) {
if (cloudFileListModel.fileSelected(i)) {
var filePath = iCloudHelper.copyFileFromCloud(cloudFileListModel.fileCloudPathFromRow(i), cloudFileListModel.fileShortCloudPathFromRow(i))
if (filePath !== "") {
pathListModel.append({path: filePath})
}
}
}
finished(pathListModel)
}
onRejected: {
pathListModel.clear()
iCloudHelper.stopCloudHierarchyAsync()
}
}
...@@ -230,12 +230,6 @@ Item { ...@@ -230,12 +230,6 @@ Item {
onFinished: appendFilesToSendModel(pathListModel) onFinished: appendFilesToSendModel(pathListModel)
} }
/* File dialog for choose of files from iCloud */
FileDialogueIos {
id: fileDialogueIos
onFinished: appendFilesToSendModel(pathListModel)
}
/* Holds send message recipent list model */ /* Holds send message recipent list model */
DataboxListModel { DataboxListModel {
id: recipBoxModel id: recipBoxModel
...@@ -529,16 +523,6 @@ Item { ...@@ -529,16 +523,6 @@ Item {
fileDialogue.raise(qsTr("Select files"), ["*.*"], true, "", iOS) fileDialogue.raise(qsTr("Select files"), ["*.*"], true, "", iOS)
} }
} }
AccessibleButton {
id: icloud
visible: iOS
height: inputItemHeight
font.pointSize: defaultTextFont.font.pointSize
text: qsTr("iCloud")
onClicked: {
fileDialogueIos.raise(qsTr("Select files"), ["*.*"], true, "")
}
}
AccessibleButton { AccessibleButton {
id: storage id: storage
visible: iOS visible: iOS
......
...@@ -131,7 +131,6 @@ ...@@ -131,7 +131,6 @@
<file>../qml/components/ScrollableListView.qml</file> <file>../qml/components/ScrollableListView.qml</file>
<file>../qml/dialogues/CalendarDialogue.qml</file> <file>../qml/dialogues/CalendarDialogue.qml</file>
<file>../qml/dialogues/FileDialogue.qml</file> <file>../qml/dialogues/FileDialogue.qml</file>
<file>../qml/dialogues/FileDialogueIos.qml</file>
<file>../qml/dialogues/InputDialogue.qml</file> <file>../qml/dialogues/InputDialogue.qml</file>
<file>../qml/dialogues/MessageDialogue.qml</file> <file>../qml/dialogues/MessageDialogue.qml</file>
<file>../qml/dialogues/PasteInputDialogue.qml</file> <file>../qml/dialogues/PasteInputDialogue.qml</file>
......
...@@ -27,75 +27,19 @@ ...@@ -27,75 +27,19 @@
#include "src/auxiliaries/icloud_helper.h" #include "src/auxiliaries/icloud_helper.h"
#include "src/io/filesystem.h" #include "src/io/filesystem.h"
#include "src/models/cloudmodel.h"
#include "src/datovka_shared/log/log.h" #include "src/datovka_shared/log/log.h"
#ifdef Q_OS_IOS #ifdef Q_OS_IOS
#include "ios/src/icloud_io.h" #include "ios/src/icloud_io.h"
#define ICLOUD_DATOVKA_CONTAINER_NAME "Datovka" #define ICLOUD_DATOVKA_CONTAINER_NAME "Datovka"
#define ICLOUD_FILE_CONTAINER_ID "iCloud~cz~nic~mobile-datovka/Documents"
#define SEND_FILE_PATH_PREFIX "Documents/Datovka" #define SEND_FILE_PATH_PREFIX "Documents/Datovka"
#endif /* Q_OS_IOS */ #endif /* Q_OS_IOS */
#ifndef Q_OS_IOS
QStringList iCloudFileList;
bool isSearchRunning;
#endif /* Q_OS_IOS */
ICloudHelper::ICloudHelper(QObject *parent) ICloudHelper::ICloudHelper(QObject *parent)
: QObject(parent), : QObject(parent)
m_icloudTimer(new QTimer(this))
{ {
} }
void ICloudHelper::createCloudConteiner(void)
{
debugFuncCall();
#ifdef Q_OS_IOS
ICloudIo::createCloudConteiner();
#endif /* Q_OS_IOS */
}
void ICloudHelper::getCloudHierarchyAsync(void)
{
debugFuncCall();
#ifdef Q_OS_IOS
if (!ICloudIo::isCloudOn()) {
QMessageBox::critical(Q_NULLPTR, tr("iCloud error"),
tr("Unable to access iCloud Account. Open the Settings app and enter your Apple ID into iCloud settings."),
QMessageBox::Ok);
return;
}
iCloudFileList.clear();
isSearchRunning = ICloudIo::getCloudHierarchyAsync();
if (isSearchRunning) {
connect(m_icloudTimer, SIGNAL(timeout()), this, SLOT(receivedCloudHierarchy()));
m_icloudTimer->start(200);
}
#endif /* Q_OS_IOS */
}
void ICloudHelper::stopCloudHierarchyAsync(void)
{
debugFuncCall();
#ifdef Q_OS_IOS
m_icloudTimer->stop();