From ed7fdbcf6beb40960cf91555ae1d506278b852d8 Mon Sep 17 00:00:00 2001 From: Aaron Seigo Date: Tue, 16 Dec 2014 08:25:14 +0100 Subject: move client classes into akonadi2common and add the base class for resource plugins we can divide up libakonadi2common later once we have a full collection of classes this makes writing code a bit simpler now as we don't have to figuer out which libraries to link against or how class dependencies should look. when we have more infrastructure in place this will mostly become self-evident --- client/threadboundary.h | 47 ----------------------------------------------- 1 file changed, 47 deletions(-) delete mode 100644 client/threadboundary.h (limited to 'client/threadboundary.h') diff --git a/client/threadboundary.h b/client/threadboundary.h deleted file mode 100644 index 9881afa..0000000 --- a/client/threadboundary.h +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (C) 2014 Christian Mollekopf - * - * 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 . - */ - -#pragma once - -#include -#include - -namespace async { - /* - * A helper class to invoke a method in a different thread using the event loop. - * The ThreadBoundary object must live in the thread where the function should be called. - */ - class ThreadBoundary : public QObject { - Q_OBJECT - public: - ThreadBoundary(); - virtual ~ThreadBoundary(); - - //Call in worker thread - void callInMainThread(std::function f) { - QMetaObject::invokeMethod(this, "addValueInMainThread", Qt::QueuedConnection, QGenericReturnArgument(), Q_ARG(std::function, f)); - } - public slots: - //Get's called in main thread by it's eventloop - void addValueInMainThread(std::function f) { - f(); - } - }; -} -- cgit v1.2.3