diff --git a/src/services/abstract/serviceroot.cpp b/src/services/abstract/serviceroot.cpp index 74a3988a2..5cb47e7b3 100755 --- a/src/services/abstract/serviceroot.cpp +++ b/src/services/abstract/serviceroot.cpp @@ -99,6 +99,15 @@ QList ServiceRoot::serviceMenu() { return QList(); } +void ServiceRoot::completelyRemoveAllData() { + // Purge old data from SQL and clean all model items. + removeOldFeedTree(true); + cleanAllItems(); + updateCounts(true); + itemChanged(QList() << this); + requestReloadMessageList(true); +} + void ServiceRoot::removeOldFeedTree(bool including_messages) { QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings); QSqlQuery query(database); diff --git a/src/services/abstract/serviceroot.h b/src/services/abstract/serviceroot.h index c759144ce..9426f3a5b 100755 --- a/src/services/abstract/serviceroot.h +++ b/src/services/abstract/serviceroot.h @@ -149,6 +149,8 @@ class ServiceRoot : public RootItem { // Selected item is naturally recycle bin. virtual bool onAfterMessagesRestoredFromBin(RootItem *selected_item, const QList &messages); + void completelyRemoveAllData(); + // Obvious methods to wrap signals. void itemChanged(const QList &items); void requestReloadMessageList(bool mark_selected_messages_read); diff --git a/src/services/owncloud/gui/formeditowncloudaccount.cpp b/src/services/owncloud/gui/formeditowncloudaccount.cpp index aa44fe2a4..d11ffb55f 100755 --- a/src/services/owncloud/gui/formeditowncloudaccount.cpp +++ b/src/services/owncloud/gui/formeditowncloudaccount.cpp @@ -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(); } } diff --git a/src/services/owncloud/owncloudserviceroot.cpp b/src/services/owncloud/owncloudserviceroot.cpp index d4d8386ff..0c296c822 100755 --- a/src/services/owncloud/owncloudserviceroot.cpp +++ b/src/services/owncloud/owncloudserviceroot.cpp @@ -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 #include @@ -51,7 +53,10 @@ bool OwnCloudServiceRoot::canBeDeleted() const { } bool OwnCloudServiceRoot::editViaGui() { - return false; + QScopedPointer form_pointer(new FormEditOwnCloudAccount(qApp->mainForm())); + form_pointer.data()->execForEdit(this); + + return true; } bool OwnCloudServiceRoot::deleteViaGui() { diff --git a/src/services/tt-rss/ttrssserviceroot.cpp b/src/services/tt-rss/ttrssserviceroot.cpp index 98a8ef47a..6e2db1597 100755 --- a/src/services/tt-rss/ttrssserviceroot.cpp +++ b/src/services/tt-rss/ttrssserviceroot.cpp @@ -72,7 +72,7 @@ bool TtRssServiceRoot::editViaGui() { QScopedPointer 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() << this); - requestReloadMessageList(true); -} - void TtRssServiceRoot::syncIn() { QIcon original_icon = icon(); diff --git a/src/services/tt-rss/ttrssserviceroot.h b/src/services/tt-rss/ttrssserviceroot.h index 9e121f501..128363762 100755 --- a/src/services/tt-rss/ttrssserviceroot.h +++ b/src/services/tt-rss/ttrssserviceroot.h @@ -61,7 +61,6 @@ class TtRssServiceRoot : public ServiceRoot { bool markFeedsReadUnread(QList items, ReadStatus read); void saveAccountDataToDatabase(); void updateTitle(); - void completelyRemoveAllData(); public slots: void addNewFeed(const QString &url = QString());