Editing of ownCloud NEWS acc props works now.
This commit is contained in:
parent
3efd22491c
commit
8517f2b027
@ -99,6 +99,15 @@ QList<QAction*> ServiceRoot::serviceMenu() {
|
|||||||
return QList<QAction*>();
|
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) {
|
void ServiceRoot::removeOldFeedTree(bool including_messages) {
|
||||||
QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
|
QSqlDatabase database = qApp->database()->connection(metaObject()->className(), DatabaseFactory::FromSettings);
|
||||||
QSqlQuery query(database);
|
QSqlQuery query(database);
|
||||||
|
@ -149,6 +149,8 @@ class ServiceRoot : public RootItem {
|
|||||||
// Selected item is naturally recycle bin.
|
// Selected item is naturally recycle bin.
|
||||||
virtual bool onAfterMessagesRestoredFromBin(RootItem *selected_item, const QList<Message> &messages);
|
virtual bool onAfterMessagesRestoredFromBin(RootItem *selected_item, const QList<Message> &messages);
|
||||||
|
|
||||||
|
void completelyRemoveAllData();
|
||||||
|
|
||||||
// Obvious methods to wrap signals.
|
// Obvious methods to wrap signals.
|
||||||
void itemChanged(const QList<RootItem*> &items);
|
void itemChanged(const QList<RootItem*> &items);
|
||||||
void requestReloadMessageList(bool mark_selected_messages_read);
|
void requestReloadMessageList(bool mark_selected_messages_read);
|
||||||
|
@ -147,9 +147,8 @@ void FormEditOwnCloudAccount::onClickedOk() {
|
|||||||
accept();
|
accept();
|
||||||
|
|
||||||
if (editing_account) {
|
if (editing_account) {
|
||||||
// TODO: aktualizovat
|
m_editableRoot->completelyRemoveAllData();
|
||||||
//m_editableRoot->completelyRemoveAllData();
|
m_editableRoot->syncIn();
|
||||||
//m_editableRoot->syncIn();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,11 +22,13 @@
|
|||||||
#include "miscellaneous/application.h"
|
#include "miscellaneous/application.h"
|
||||||
#include "miscellaneous/textfactory.h"
|
#include "miscellaneous/textfactory.h"
|
||||||
#include "miscellaneous/iconfactory.h"
|
#include "miscellaneous/iconfactory.h"
|
||||||
|
#include "gui/dialogs/formmain.h"
|
||||||
#include "services/owncloud/owncloudserviceentrypoint.h"
|
#include "services/owncloud/owncloudserviceentrypoint.h"
|
||||||
#include "services/owncloud/owncloudrecyclebin.h"
|
#include "services/owncloud/owncloudrecyclebin.h"
|
||||||
#include "services/owncloud/owncloudfeed.h"
|
#include "services/owncloud/owncloudfeed.h"
|
||||||
#include "services/owncloud/owncloudcategory.h"
|
#include "services/owncloud/owncloudcategory.h"
|
||||||
#include "services/owncloud/network/owncloudnetworkfactory.h"
|
#include "services/owncloud/network/owncloudnetworkfactory.h"
|
||||||
|
#include "services/owncloud/gui/formeditowncloudaccount.h"
|
||||||
|
|
||||||
#include <QSqlQuery>
|
#include <QSqlQuery>
|
||||||
#include <QSqlError>
|
#include <QSqlError>
|
||||||
@ -51,7 +53,10 @@ bool OwnCloudServiceRoot::canBeDeleted() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool OwnCloudServiceRoot::editViaGui() {
|
bool OwnCloudServiceRoot::editViaGui() {
|
||||||
return false;
|
QScopedPointer<FormEditOwnCloudAccount> form_pointer(new FormEditOwnCloudAccount(qApp->mainForm()));
|
||||||
|
form_pointer.data()->execForEdit(this);
|
||||||
|
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool OwnCloudServiceRoot::deleteViaGui() {
|
bool OwnCloudServiceRoot::deleteViaGui() {
|
||||||
|
@ -72,7 +72,7 @@ bool TtRssServiceRoot::editViaGui() {
|
|||||||
QScopedPointer<FormEditAccount> form_pointer(new FormEditAccount(qApp->mainForm()));
|
QScopedPointer<FormEditAccount> form_pointer(new FormEditAccount(qApp->mainForm()));
|
||||||
form_pointer.data()->execForEdit(this);
|
form_pointer.data()->execForEdit(this);
|
||||||
|
|
||||||
return false;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool TtRssServiceRoot::deleteViaGui() {
|
bool TtRssServiceRoot::deleteViaGui() {
|
||||||
@ -450,15 +450,6 @@ void TtRssServiceRoot::updateTitle() {
|
|||||||
setTitle(m_network->username() + QL1S("@") + host);
|
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() {
|
void TtRssServiceRoot::syncIn() {
|
||||||
QIcon original_icon = icon();
|
QIcon original_icon = icon();
|
||||||
|
|
||||||
|
@ -61,7 +61,6 @@ class TtRssServiceRoot : public ServiceRoot {
|
|||||||
bool markFeedsReadUnread(QList<Feed*> items, ReadStatus read);
|
bool markFeedsReadUnread(QList<Feed*> items, ReadStatus read);
|
||||||
void saveAccountDataToDatabase();
|
void saveAccountDataToDatabase();
|
||||||
void updateTitle();
|
void updateTitle();
|
||||||
void completelyRemoveAllData();
|
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addNewFeed(const QString &url = QString());
|
void addNewFeed(const QString &url = QString());
|
||||||
|
Loading…
x
Reference in New Issue
Block a user