mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-26 23:28:14 +03:00
Define basic FileProviderDomainSyncStatus private implementation
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
7a9a17a2f3
commit
62c85de35b
3 changed files with 65 additions and 21 deletions
|
@ -1,20 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2024 by Claudio Cambra <claudio.cambra@nextcloud.com>
|
||||
*
|
||||
* 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 2 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.
|
||||
*/
|
||||
|
||||
#include "fileproviderdomainsyncstatus.h"
|
||||
|
||||
namespace OCC::Mac
|
||||
{
|
||||
|
||||
} // OCC::Mac
|
|
@ -12,13 +12,23 @@
|
|||
* for more details.
|
||||
*/
|
||||
|
||||
#include <QObject>
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace OCC::Mac
|
||||
{
|
||||
|
||||
class FileProviderDomainSyncStatus
|
||||
class FileProviderDomainSyncStatus : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit FileProviderDomainSyncStatus(const QString &domainIdentifier, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
class MacImplementation;
|
||||
std::unique_ptr<MacImplementation> d;
|
||||
};
|
||||
|
||||
} // OCC::Mac
|
||||
|
|
54
src/gui/macOS/fileproviderdomainsyncstatus_mac.mm
Normal file
54
src/gui/macOS/fileproviderdomainsyncstatus_mac.mm
Normal file
|
@ -0,0 +1,54 @@
|
|||
/*
|
||||
* Copyright (C) 2024 by Claudio Cambra <claudio.cambra@nextcloud.com>
|
||||
*
|
||||
* 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 2 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.
|
||||
*/
|
||||
|
||||
#include "fileproviderdomainsyncstatus.h"
|
||||
|
||||
#include <QLoggingCategory>
|
||||
|
||||
#include "gui/macOS/fileproviderutils.h"
|
||||
|
||||
#import <FileProvider/FileProvider.h>
|
||||
|
||||
namespace OCC::Mac
|
||||
{
|
||||
|
||||
Q_LOGGING_CATEGORY(lcMacFileProviderDomainSyncStatus, "nextcloud.gui.macfileproviderdomainsyncstatus", QtInfoMsg)
|
||||
|
||||
class FileProviderDomainSyncStatus::MacImplementation
|
||||
{
|
||||
public:
|
||||
explicit MacImplementation(const QString &domainIdentifier)
|
||||
{
|
||||
_domain = FileProviderUtils::domainForIdentifier(domainIdentifier);
|
||||
_manager = [NSFileProviderManager managerForDomain:_domain];
|
||||
|
||||
if (_manager == nil) {
|
||||
qCWarning(lcMacFileProviderDomainSyncStatus) << "Could not get manager for domain" << domainIdentifier;
|
||||
}
|
||||
}
|
||||
|
||||
~MacImplementation() = default;
|
||||
|
||||
private:
|
||||
NSFileProviderDomain *_domain;
|
||||
NSFileProviderManager *_manager;
|
||||
};
|
||||
|
||||
FileProviderDomainSyncStatus::FileProviderDomainSyncStatus(const QString &domainIdentifier, QObject *parent)
|
||||
: QObject(parent)
|
||||
, d(std::make_unique<MacImplementation>(domainIdentifier))
|
||||
{
|
||||
}
|
||||
|
||||
} // OCC::Mac
|
Loading…
Reference in a new issue