From 34f9a1e827e37f7172d9ebea3e511e1349da1f7e Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Tue, 16 Dec 2014 08:33:37 +0100 Subject: split out the resource bits into their own file --- common/CMakeLists.txt | 1 + common/clientapi.cpp | 45 ----------------------------------------- common/clientapi.h | 26 ------------------------ common/resource.cpp | 49 +++++++++++++++++++++++++++++++++++++++++++++ common/resource.h | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 105 insertions(+), 71 deletions(-) delete mode 100644 common/clientapi.cpp create mode 100644 common/resource.cpp create mode 100644 common/resource.h diff --git a/common/CMakeLists.txt b/common/CMakeLists.txt index fab7708..3431756 100644 --- a/common/CMakeLists.txt +++ b/common/CMakeLists.txt @@ -13,6 +13,7 @@ endif (STORAGE_unqlite) set(command_SRCS commands.cpp console.cpp + resource.cpp resourceaccess.cpp storage_common.cpp threadboundary.cpp diff --git a/common/clientapi.cpp b/common/clientapi.cpp deleted file mode 100644 index 88797cc..0000000 --- a/common/clientapi.cpp +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (C) 2014 Aaron Seigo - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) version 3, or any - * later version accepted by the membership of KDE e.V. (or its - * successor approved by the membership of KDE e.V.), which shall - * act as a proxy defined in Section 6 of version 3 of the license. - * - * This library 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 - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library. If not, see . - */ - -#include "clientapi.h" - -Resource::Resource() - : d(0) -{ - -} - -Resource::~Resource() -{ - //delete d; -} - -ResourceFactory::ResourceFactory(QObject *parent) - : QObject(parent), - d(0) -{ - -} - -ResourceFactory::~ResourceFactory() -{ - //delete d; -} - diff --git a/common/clientapi.h b/common/clientapi.h index 3531462..88cdfcb 100644 --- a/common/clientapi.h +++ b/common/clientapi.h @@ -435,31 +435,5 @@ public: } }; -class Resource -{ -public: - Resource(); - virtual ~Resource(); - -private: - class Private; - Private * const d; -}; - -class ResourceFactory : public QObject -{ -public: - ResourceFactory(QObject *parent); - virtual ~ResourceFactory(); - - virtual Resource *createResource() = 0; - virtual void registerFacade(FacadeFactory &factory) = 0; - -private: - class Private; - Private * const d; -}; } -Q_DECLARE_INTERFACE(Akonadi2::ResourceFactory, "org.kde.akonadi2.resourcefactory") - diff --git a/common/resource.cpp b/common/resource.cpp new file mode 100644 index 0000000..26d57d5 --- /dev/null +++ b/common/resource.cpp @@ -0,0 +1,49 @@ +/* + * Copyright (C) 2014 Aaron Seigo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#include "resource.h" + +namespace Akonadi2 +{ + +Resource::Resource() + : d(0) +{ + +} + +Resource::~Resource() +{ + //delete d; +} + +ResourceFactory::ResourceFactory(QObject *parent) + : QObject(parent), + d(0) +{ + +} + +ResourceFactory::~ResourceFactory() +{ + //delete d; +} + +} // namespace Akonadi2 diff --git a/common/resource.h b/common/resource.h new file mode 100644 index 0000000..49ef50b --- /dev/null +++ b/common/resource.h @@ -0,0 +1,55 @@ +/* + * Copyright (C) 2014 Aaron Seigo + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) version 3, or any + * later version accepted by the membership of KDE e.V. (or its + * successor approved by the membership of KDE e.V.), which shall + * act as a proxy defined in Section 6 of version 3 of the license. + * + * This library 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 + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library. If not, see . + */ + +#include "clientapi.h" + +namespace Akonadi2 +{ + +class Resource +{ +public: + Resource(); + virtual ~Resource(); + +private: + class Private; + Private * const d; +}; + +class ResourceFactory : public QObject +{ +public: + ResourceFactory(QObject *parent); + virtual ~ResourceFactory(); + + virtual Resource *createResource() = 0; + virtual void registerFacade(FacadeFactory &factory) = 0; + +private: + class Private; + Private * const d; +}; + +} // namespace Akonadi2 + +Q_DECLARE_INTERFACE(Akonadi2::ResourceFactory, "org.kde.akonadi2.resourcefactory") + + -- cgit v1.2.3