Work on ownCloud News plugin.

This commit is contained in:
Martin Rotter 2016-02-18 13:05:42 +01:00
parent 424403924f
commit 358675bb0c
5 changed files with 78 additions and 2 deletions

View File

@ -0,0 +1,41 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2016 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#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);
//}
}

View File

@ -0,0 +1,32 @@
// This file is part of RSS Guard.
//
// Copyright (C) 2011-2016 by Martin Rotter <rotter.martinos@gmail.com>
//
// 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 <http://www.gnu.org/licenses/>.
#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

View File

@ -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 <QSqlQuery>
@ -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());
}

View File

@ -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;
};

View File

@ -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();