Fixed #84 + properly display parent categories icon in "edit feed" dialog.
This commit is contained in:
parent
b4f3b2993a
commit
c5bd83e6af
@ -4,7 +4,7 @@
|
|||||||
Added:
|
Added:
|
||||||
▪ Gmail plugin is now able to send e-mail messages and also reply to them.
|
▪ Gmail plugin is now able to send e-mail messages and also reply to them.
|
||||||
▪ Branch arrows in feeds list can now be displayed.
|
▪ Branch arrows in feeds list can now be displayed.
|
||||||
▪ Changes if read/important field in a message from a message filter are now synced
|
▪ Changes of read/important field in a message from a message filter are now synced
|
||||||
back to online services. (#258)
|
back to online services. (#258)
|
||||||
▪ Filterin mechanism now accepts constants named "MSG_ACCEPT" and "MSG_IGNORE"
|
▪ Filterin mechanism now accepts constants named "MSG_ACCEPT" and "MSG_IGNORE"
|
||||||
which can be used instead of hardcoded values "1" and "2".
|
which can be used instead of hardcoded values "1" and "2".
|
||||||
|
@ -48,7 +48,7 @@ void DiscoverFeedsButton::linkTriggered(QAction* action) {
|
|||||||
ServiceRoot* root = static_cast<ServiceRoot*>(action->property("root").value<void*>());
|
ServiceRoot* root = static_cast<ServiceRoot*>(action->property("root").value<void*>());
|
||||||
|
|
||||||
if (root->supportsFeedAdding()) {
|
if (root->supportsFeedAdding()) {
|
||||||
root->addNewFeed(url);
|
root->addNewFeed(qApp->mainForm()->tabWidget()->feedMessageViewer()->feedsView()->selectedItem(), url);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qApp->showGuiMessage(tr("Not supported"),
|
qApp->showGuiMessage(tr("Not supported"),
|
||||||
|
@ -155,13 +155,13 @@ void FeedsView::sortByColumn(int column, Qt::SortOrder order) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FeedsView::addFeedIntoSelectedAccount() {
|
void FeedsView::addFeedIntoSelectedAccount() {
|
||||||
const RootItem* selected = selectedItem();
|
RootItem* selected = selectedItem();
|
||||||
|
|
||||||
if (selected != nullptr) {
|
if (selected != nullptr) {
|
||||||
ServiceRoot* root = selected->getParentServiceRoot();
|
ServiceRoot* root = selected->getParentServiceRoot();
|
||||||
|
|
||||||
if (root->supportsFeedAdding()) {
|
if (root->supportsFeedAdding()) {
|
||||||
root->addNewFeed();
|
root->addNewFeed(selected);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
qApp->showGuiMessage(tr("Not supported"),
|
qApp->showGuiMessage(tr("Not supported"),
|
||||||
|
@ -378,12 +378,12 @@ void FormFeedDetails::initialize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void FormFeedDetails::loadCategories(const QList<Category*>& categories, RootItem* root_item) {
|
void FormFeedDetails::loadCategories(const QList<Category*>& categories, RootItem* root_item) {
|
||||||
m_ui->m_cmbParentCategory->addItem(root_item->icon(),
|
m_ui->m_cmbParentCategory->addItem(root_item->fullIcon(),
|
||||||
root_item->title(),
|
root_item->title(),
|
||||||
QVariant::fromValue((void*) root_item));
|
QVariant::fromValue((void*) root_item));
|
||||||
|
|
||||||
for (Category* category : categories) {
|
for (Category* category : categories) {
|
||||||
m_ui->m_cmbParentCategory->addItem(category->icon(),
|
m_ui->m_cmbParentCategory->addItem(category->fullIcon(),
|
||||||
category->title(),
|
category->title(),
|
||||||
QVariant::fromValue((void*) category));
|
QVariant::fromValue((void*) category));
|
||||||
}
|
}
|
||||||
|
@ -171,18 +171,7 @@ QVariant RootItem::data(int column, int role) const {
|
|||||||
|
|
||||||
case Qt::DecorationRole:
|
case Qt::DecorationRole:
|
||||||
if (column == FDS_MODEL_TITLE_INDEX) {
|
if (column == FDS_MODEL_TITLE_INDEX) {
|
||||||
QIcon ico = icon();
|
return fullIcon();
|
||||||
|
|
||||||
if (ico.isNull()) {
|
|
||||||
if (kind() == RootItem::Kind::Feed) {
|
|
||||||
return qApp->icons()->fromTheme(QSL("application-rss+xml"));
|
|
||||||
}
|
|
||||||
else if (kind() == RootItem::Kind::Category) {
|
|
||||||
return qApp->icons()->fromTheme(QSL("folder"));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return ico;
|
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
return QVariant();
|
return QVariant();
|
||||||
@ -398,6 +387,21 @@ void RootItem::setIcon(const QIcon& icon) {
|
|||||||
m_icon = icon;
|
m_icon = icon;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QIcon RootItem::fullIcon() const {
|
||||||
|
QIcon ico = icon();
|
||||||
|
|
||||||
|
if (ico.isNull()) {
|
||||||
|
if (kind() == RootItem::Kind::Feed) {
|
||||||
|
return qApp->icons()->fromTheme(QSL("application-rss+xml"));
|
||||||
|
}
|
||||||
|
else if (kind() == RootItem::Kind::Category) {
|
||||||
|
return qApp->icons()->fromTheme(QSL("folder"));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return ico;
|
||||||
|
}
|
||||||
|
|
||||||
int RootItem::id() const {
|
int RootItem::id() const {
|
||||||
return m_id;
|
return m_id;
|
||||||
}
|
}
|
||||||
|
@ -172,6 +172,10 @@ class RSSGUARD_DLLSPEC RootItem : public QObject {
|
|||||||
QIcon icon() const;
|
QIcon icon() const;
|
||||||
void setIcon(const QIcon& icon);
|
void setIcon(const QIcon& icon);
|
||||||
|
|
||||||
|
// Returns icon, even if item has "default" icon set, then
|
||||||
|
// this icon is extra loaded and returned.
|
||||||
|
QIcon fullIcon() const;
|
||||||
|
|
||||||
// This ALWAYS represents primary column number/ID under which
|
// This ALWAYS represents primary column number/ID under which
|
||||||
// the item is stored in DB.
|
// the item is stored in DB.
|
||||||
int id() const;
|
int id() const;
|
||||||
|
@ -266,7 +266,8 @@ void ServiceRoot::requestItemRemoval(RootItem* item) {
|
|||||||
emit itemRemovalRequested(item);
|
emit itemRemovalRequested(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ServiceRoot::addNewFeed(const QString& url) {
|
void ServiceRoot::addNewFeed(RootItem* selected_item, const QString& url) {
|
||||||
|
Q_UNUSED(selected_item)
|
||||||
Q_UNUSED(url)
|
Q_UNUSED(url)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -158,7 +158,7 @@ class ServiceRoot : public RootItem {
|
|||||||
virtual bool onAfterMessagesRestoredFromBin(RootItem* selected_item, const QList<Message>& messages);
|
virtual bool onAfterMessagesRestoredFromBin(RootItem* selected_item, const QList<Message>& messages);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
virtual void addNewFeed(const QString& url = QString());
|
virtual void addNewFeed(RootItem* selected_item, const QString& url = QString());
|
||||||
virtual void addNewCategory();
|
virtual void addNewCategory();
|
||||||
virtual void syncIn();
|
virtual void syncIn();
|
||||||
|
|
||||||
|
@ -138,12 +138,6 @@ RootItem* InoreaderServiceRoot::obtainNewTreeForSyncIn() const {
|
|||||||
return m_network->feedsCategories(true);
|
return m_network->feedsCategories(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
void InoreaderServiceRoot::addNewFeed(const QString& url) {
|
|
||||||
Q_UNUSED(url)
|
|
||||||
}
|
|
||||||
|
|
||||||
void InoreaderServiceRoot::addNewCategory() {}
|
|
||||||
|
|
||||||
void InoreaderServiceRoot::saveAllCachedData(bool async) {
|
void InoreaderServiceRoot::saveAllCachedData(bool async) {
|
||||||
QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache();
|
QPair<QMap<RootItem::ReadStatus, QStringList>, QMap<RootItem::Importance, QList<Message>>> msgCache = takeMessageCache();
|
||||||
QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first);
|
QMapIterator<RootItem::ReadStatus, QStringList> i(msgCache.first);
|
||||||
|
@ -38,8 +38,6 @@ class InoreaderServiceRoot : public ServiceRoot, public CacheForServiceRoot {
|
|||||||
void saveAllCachedData(bool async = true);
|
void saveAllCachedData(bool async = true);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addNewFeed(const QString& url);
|
|
||||||
void addNewCategory();
|
|
||||||
void updateTitle();
|
void updateTitle();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@ -24,7 +24,7 @@ bool OwnCloudFeed::editViaGui() {
|
|||||||
QScopedPointer<FormOwnCloudFeedDetails> form_pointer(new FormOwnCloudFeedDetails(serviceRoot(),
|
QScopedPointer<FormOwnCloudFeedDetails> form_pointer(new FormOwnCloudFeedDetails(serviceRoot(),
|
||||||
qApp->mainFormWidget()));
|
qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer->addEditFeed(this, nullptr);
|
form_pointer->addEditFeed(this, this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -155,7 +155,9 @@ void OwnCloudServiceRoot::saveAccountDataToDatabase() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void OwnCloudServiceRoot::addNewFeed(const QString& url) {
|
void OwnCloudServiceRoot::addNewFeed(RootItem* selected_item, const QString& url) {
|
||||||
|
Q_UNUSED(selected_item)
|
||||||
|
|
||||||
if (!qApp->feedUpdateLock()->tryLock()) {
|
if (!qApp->feedUpdateLock()->tryLock()) {
|
||||||
// Lock was not obtained because
|
// Lock was not obtained because
|
||||||
// it is used probably by feed updater or application
|
// it is used probably by feed updater or application
|
||||||
@ -170,12 +172,10 @@ void OwnCloudServiceRoot::addNewFeed(const QString& url) {
|
|||||||
|
|
||||||
QScopedPointer<FormOwnCloudFeedDetails> form_pointer(new FormOwnCloudFeedDetails(this, qApp->mainFormWidget()));
|
QScopedPointer<FormOwnCloudFeedDetails> form_pointer(new FormOwnCloudFeedDetails(this, qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer->addEditFeed(nullptr, this, url);
|
form_pointer->addEditFeed(nullptr, selected_item, url);
|
||||||
qApp->feedUpdateLock()->unlock();
|
qApp->feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void OwnCloudServiceRoot::addNewCategory() {}
|
|
||||||
|
|
||||||
RootItem* OwnCloudServiceRoot::obtainNewTreeForSyncIn() const {
|
RootItem* OwnCloudServiceRoot::obtainNewTreeForSyncIn() const {
|
||||||
OwnCloudGetFeedsCategoriesResponse feed_cats_response = m_network->feedsCategories();
|
OwnCloudGetFeedsCategoriesResponse feed_cats_response = m_network->feedsCategories();
|
||||||
|
|
||||||
|
@ -37,8 +37,7 @@ class OwnCloudServiceRoot : public ServiceRoot, public CacheForServiceRoot {
|
|||||||
void saveAllCachedData(bool async = true);
|
void saveAllCachedData(bool async = true);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addNewFeed(const QString& url);
|
void addNewFeed(RootItem* selected_item, const QString& url);
|
||||||
void addNewCategory();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RootItem* obtainNewTreeForSyncIn() const;
|
RootItem* obtainNewTreeForSyncIn() const;
|
||||||
|
@ -76,9 +76,10 @@ StandardServiceRoot* StandardFeed::serviceRoot() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool StandardFeed::editViaGui() {
|
bool StandardFeed::editViaGui() {
|
||||||
QScopedPointer<FormStandardFeedDetails> form_pointer(new FormStandardFeedDetails(serviceRoot(), qApp->mainFormWidget()));
|
QScopedPointer<FormStandardFeedDetails> form_pointer(new FormStandardFeedDetails(serviceRoot(),
|
||||||
|
qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer.data()->addEditFeed(this, nullptr);
|
form_pointer->addEditFeed(this, this);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ bool StandardServiceRoot::supportsCategoryAdding() const {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void StandardServiceRoot::addNewFeed(const QString& url) {
|
void StandardServiceRoot::addNewFeed(RootItem* selected_item, const QString& url) {
|
||||||
if (!qApp->feedUpdateLock()->tryLock()) {
|
if (!qApp->feedUpdateLock()->tryLock()) {
|
||||||
// Lock was not obtained because
|
// Lock was not obtained because
|
||||||
// it is used probably by feed updater or application
|
// it is used probably by feed updater or application
|
||||||
@ -118,9 +118,10 @@ void StandardServiceRoot::addNewFeed(const QString& url) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
QScopedPointer<FormStandardFeedDetails> form_pointer(new FormStandardFeedDetails(this, qApp->mainFormWidget()));
|
QScopedPointer<FormStandardFeedDetails> form_pointer(new FormStandardFeedDetails(this,
|
||||||
|
qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer.data()->addEditFeed(nullptr, nullptr, url);
|
form_pointer->addEditFeed(nullptr, selected_item, url);
|
||||||
qApp->feedUpdateLock()->unlock();
|
qApp->feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -167,7 +168,7 @@ QString StandardServiceRoot::processFeedUrl(const QString& feed_url) {
|
|||||||
|
|
||||||
void StandardServiceRoot::checkArgumentForFeedAdding(const QString& argument) {
|
void StandardServiceRoot::checkArgumentForFeedAdding(const QString& argument) {
|
||||||
if (argument.startsWith(QL1S(URI_SCHEME_FEED_SHORT))) {
|
if (argument.startsWith(QL1S(URI_SCHEME_FEED_SHORT))) {
|
||||||
addNewFeed(processFeedUrl(argument));
|
addNewFeed(nullptr, processFeedUrl(argument));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class StandardServiceRoot : public ServiceRoot {
|
|||||||
void checkArgumentForFeedAdding(const QString& argument);
|
void checkArgumentForFeedAdding(const QString& argument);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addNewFeed(const QString& url = QString());
|
void addNewFeed(RootItem* selected_item, const QString& url = QString());
|
||||||
void addNewCategory();
|
void addNewCategory();
|
||||||
void importFeeds();
|
void importFeeds();
|
||||||
void exportFeeds();
|
void exportFeeds();
|
||||||
|
@ -31,7 +31,7 @@ bool TtRssFeed::canBeEdited() const {
|
|||||||
bool TtRssFeed::editViaGui() {
|
bool TtRssFeed::editViaGui() {
|
||||||
QPointer<FormTtRssFeedDetails> form_pointer = new FormTtRssFeedDetails(serviceRoot(), qApp->mainFormWidget());
|
QPointer<FormTtRssFeedDetails> form_pointer = new FormTtRssFeedDetails(serviceRoot(), qApp->mainFormWidget());
|
||||||
|
|
||||||
form_pointer.data()->addEditFeed(this, nullptr);
|
form_pointer.data()->addEditFeed(this, this);
|
||||||
delete form_pointer.data();
|
delete form_pointer.data();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -86,7 +86,9 @@ bool TtRssServiceRoot::supportsCategoryAdding() const {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
void TtRssServiceRoot::addNewFeed(const QString& url) {
|
void TtRssServiceRoot::addNewFeed(RootItem* selected_item, const QString& url) {
|
||||||
|
Q_UNUSED(selected_item)
|
||||||
|
|
||||||
if (!qApp->feedUpdateLock()->tryLock()) {
|
if (!qApp->feedUpdateLock()->tryLock()) {
|
||||||
// Lock was not obtained because
|
// Lock was not obtained because
|
||||||
// it is used probably by feed updater or application
|
// it is used probably by feed updater or application
|
||||||
@ -101,14 +103,10 @@ void TtRssServiceRoot::addNewFeed(const QString& url) {
|
|||||||
|
|
||||||
QScopedPointer<FormTtRssFeedDetails> form_pointer(new FormTtRssFeedDetails(this, qApp->mainFormWidget()));
|
QScopedPointer<FormTtRssFeedDetails> form_pointer(new FormTtRssFeedDetails(this, qApp->mainFormWidget()));
|
||||||
|
|
||||||
form_pointer->addEditFeed(nullptr, this, url);
|
form_pointer->addEditFeed(nullptr, selected_item, url);
|
||||||
qApp->feedUpdateLock()->unlock();
|
qApp->feedUpdateLock()->unlock();
|
||||||
}
|
}
|
||||||
|
|
||||||
void TtRssServiceRoot::addNewCategory() {
|
|
||||||
// NOTE: Do nothing.
|
|
||||||
}
|
|
||||||
|
|
||||||
bool TtRssServiceRoot::canBeEdited() const {
|
bool TtRssServiceRoot::canBeEdited() const {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -42,8 +42,7 @@ class TtRssServiceRoot : public ServiceRoot, public CacheForServiceRoot {
|
|||||||
void updateTitle();
|
void updateTitle();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void addNewFeed(const QString& url = QString());
|
void addNewFeed(RootItem* selected_item, const QString& url = QString());
|
||||||
void addNewCategory();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
RootItem* obtainNewTreeForSyncIn() const;
|
RootItem* obtainNewTreeForSyncIn() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user