Editing of ownCloud NEWS acc props works now.

This commit is contained in:
Martin Rotter 2016-02-26 09:55:50 +01:00
parent 3efd22491c
commit 8517f2b027
6 changed files with 20 additions and 15 deletions

View File

@ -99,6 +99,15 @@ QList<QAction*> ServiceRoot::serviceMenu() {
return QList<QAction*>();
}
void ServiceRoot::completelyRemoveAllData() {
// Purge old data from SQL and clean all model items.
removeOldFeedTree(true);
cleanAllItems();
updateCounts(true);
itemChanged(QList<RootItem*>() << this);
requestReloadMessageList(true);
}
void ServiceRoot::removeOldFeedTree(bool including_messages) {
QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
QSqlQuery query(database);

View File

@ -149,6 +149,8 @@ class ServiceRoot : public RootItem {
// Selected item is naturally recycle bin.
virtual bool onAfterMessagesRestoredFromBin(RootItem *selected_item, const QList<Message> &messages);
void completelyRemoveAllData();
// Obvious methods to wrap signals.
void itemChanged(const QList<RootItem*> &items);
void requestReloadMessageList(bool mark_selected_messages_read);

View File

@ -147,9 +147,8 @@ void FormEditOwnCloudAccount::onClickedOk() {
accept();
if (editing_account) {
// TODO: aktualizovat
//m_editableRoot->completelyRemoveAllData();
//m_editableRoot->syncIn();
m_editableRoot->completelyRemoveAllData();
m_editableRoot->syncIn();
}
}

View File

@ -22,11 +22,13 @@
#include "miscellaneous/application.h"
#include "miscellaneous/textfactory.h"
#include "miscellaneous/iconfactory.h"
#include "gui/dialogs/formmain.h"
#include "services/owncloud/owncloudserviceentrypoint.h"
#include "services/owncloud/owncloudrecyclebin.h"
#include "services/owncloud/owncloudfeed.h"
#include "services/owncloud/owncloudcategory.h"
#include "services/owncloud/network/owncloudnetworkfactory.h"
#include "services/owncloud/gui/formeditowncloudaccount.h"
#include <QSqlQuery>
#include <QSqlError>
@ -51,7 +53,10 @@ bool OwnCloudServiceRoot::canBeDeleted() const {
}
bool OwnCloudServiceRoot::editViaGui() {
return false;
QScopedPointer<FormEditOwnCloudAccount> form_pointer(new FormEditOwnCloudAccount(qApp->mainForm()));
form_pointer.data()->execForEdit(this);
return true;
}
bool OwnCloudServiceRoot::deleteViaGui() {

View File

@ -72,7 +72,7 @@ bool TtRssServiceRoot::editViaGui() {
QScopedPointer<FormEditAccount> form_pointer(new FormEditAccount(qApp->mainForm()));
form_pointer.data()->execForEdit(this);
return false;
return true;
}
bool TtRssServiceRoot::deleteViaGui() {
@ -450,15 +450,6 @@ void TtRssServiceRoot::updateTitle() {
setTitle(m_network->username() + QL1S("@") + host);
}
void TtRssServiceRoot::completelyRemoveAllData() {
// Purge old data from SQL and clean all model items.
removeOldFeedTree(true);
cleanAllItems();
updateCounts(true);
itemChanged(QList<RootItem*>() << this);
requestReloadMessageList(true);
}
void TtRssServiceRoot::syncIn() {
QIcon original_icon = icon();

View File

@ -61,7 +61,6 @@ class TtRssServiceRoot : public ServiceRoot {
bool markFeedsReadUnread(QList<Feed*> items, ReadStatus read);
void saveAccountDataToDatabase();
void updateTitle();
void completelyRemoveAllData();
public slots:
void addNewFeed(const QString &url = QString());