diff --git a/src/services/owncloud/owncloudrecyclebin.cpp b/src/services/owncloud/owncloudrecyclebin.cpp new file mode 100755 index 000000000..532f71199 --- /dev/null +++ b/src/services/owncloud/owncloudrecyclebin.cpp @@ -0,0 +1,41 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2016 by Martin Rotter +// +// RSS Guard 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. +// +// RSS Guard 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 RSS Guard. If not, see . + +#include "services/owncloud/owncloudrecyclebin.h" + + +OwnCloudRecycleBin::OwnCloudRecycleBin(RootItem *parent) : RecycleBin(parent) { +} + +OwnCloudRecycleBin::~OwnCloudRecycleBin() { +} + +bool OwnCloudRecycleBin::markAsReadUnread(RootItem::ReadStatus status) { + // TODO: proved zmenu online. + /*QStringList ids = serviceRoot()->customIDSOfMessagesForItem(this); + TtRssUpdateArticleResponse response = serviceRoot()->network()->updateArticles(ids, UpdateArticle::Unread, + status == RootItem::Unread ? + UpdateArticle::SetToTrue : + UpdateArticle::SetToFalse); + + if (serviceRoot()->network()->lastError() != QNetworkReply::NoError || response.updateStatus() != STATUS_OK) { + return false; + } + else {*/ + return RecycleBin::markAsReadUnread(status); + //} +} diff --git a/src/services/owncloud/owncloudrecyclebin.h b/src/services/owncloud/owncloudrecyclebin.h new file mode 100755 index 000000000..53ca369b2 --- /dev/null +++ b/src/services/owncloud/owncloudrecyclebin.h @@ -0,0 +1,32 @@ +// This file is part of RSS Guard. +// +// Copyright (C) 2011-2016 by Martin Rotter +// +// RSS Guard 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. +// +// RSS Guard 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 RSS Guard. If not, see . + +#ifndef OWNCLOUDRECYCLEBIN_H +#define OWNCLOUDRECYCLEBIN_H + +#include "services/abstract/recyclebin.h" + + +class OwnCloudRecycleBin : public RecycleBin { + public: + explicit OwnCloudRecycleBin(RootItem *parent = NULL); + virtual ~OwnCloudRecycleBin(); + + bool markAsReadUnread(ReadStatus status); +}; + +#endif // OWNCLOUDRECYCLEBIN_H diff --git a/src/services/owncloud/owncloudserviceroot.cpp b/src/services/owncloud/owncloudserviceroot.cpp index 11650e536..25989d532 100755 --- a/src/services/owncloud/owncloudserviceroot.cpp +++ b/src/services/owncloud/owncloudserviceroot.cpp @@ -23,6 +23,7 @@ #include "miscellaneous/textfactory.h" #include "miscellaneous/iconfactory.h" #include "services/owncloud/owncloudserviceentrypoint.h" +#include "services/owncloud/owncloudrecyclebin.h" #include "services/owncloud/network/owncloudnetworkfactory.h" #include @@ -30,7 +31,7 @@ OwnCloudServiceRoot::OwnCloudServiceRoot(RootItem *parent) - : ServiceRoot(parent), m_network(new OwnCloudNetworkFactory()) { + : ServiceRoot(parent), m_recycleBin(new OwnCloudRecycleBin(this)), m_network(new OwnCloudNetworkFactory()) { setIcon(OwnCloudServiceEntryPoint().icon()); } diff --git a/src/services/owncloud/owncloudserviceroot.h b/src/services/owncloud/owncloudserviceroot.h index 8705d4ae2..fa81d073f 100755 --- a/src/services/owncloud/owncloudserviceroot.h +++ b/src/services/owncloud/owncloudserviceroot.h @@ -22,6 +22,7 @@ class OwnCloudNetworkFactory; +class OwnCloudRecycleBin; class OwnCloudServiceRoot : public ServiceRoot { Q_OBJECT @@ -61,6 +62,7 @@ class OwnCloudServiceRoot : public ServiceRoot { void syncIn(); private: + OwnCloudRecycleBin *m_recycleBin; OwnCloudNetworkFactory *m_network; }; diff --git a/src/services/tt-rss/ttrssrecyclebin.h b/src/services/tt-rss/ttrssrecyclebin.h index fd648c8c0..c3e2c53b4 100755 --- a/src/services/tt-rss/ttrssrecyclebin.h +++ b/src/services/tt-rss/ttrssrecyclebin.h @@ -27,7 +27,7 @@ class TtRssRecycleBin : public RecycleBin { Q_OBJECT public: - explicit TtRssRecycleBin(RootItem *parent = 0); + explicit TtRssRecycleBin(RootItem *parent = NULL); virtual ~TtRssRecycleBin(); TtRssServiceRoot *serviceRoot();