mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-12-16 09:03:51 -05:00
fixed compilation for feed reader plugin
This commit is contained in:
parent
d3069e9b44
commit
28a5db7204
9 changed files with 57 additions and 49 deletions
|
|
@ -570,7 +570,7 @@ void FeedReaderDialog::feedChanged(uint32_t feedId, int type)
|
|||
}
|
||||
|
||||
FeedInfo feedInfo;
|
||||
if (type != NOTIFY_TYPE_DEL) {
|
||||
if (type != FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
if (!mFeedReader->getFeedInfo(feedId, feedInfo)) {
|
||||
return;
|
||||
}
|
||||
|
|
@ -580,12 +580,12 @@ void FeedReaderDialog::feedChanged(uint32_t feedId, int type)
|
|||
}
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_MOD || type == NOTIFY_TYPE_DEL) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD || type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
QTreeWidgetItemIterator it(ui->feedTreeWidget);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *it) != NULL) {
|
||||
if (item->data(COLUMN_FEED_DATA, ROLE_FEED_ID).toUInt() == feedId) {
|
||||
if (type == NOTIFY_TYPE_MOD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
|
||||
updateFeedItem(item, feedInfo);
|
||||
} else {
|
||||
delete(item);
|
||||
|
|
@ -596,7 +596,7 @@ void FeedReaderDialog::feedChanged(uint32_t feedId, int type)
|
|||
}
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_ADD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_ADD) {
|
||||
QTreeWidgetItemIterator it(ui->feedTreeWidget);
|
||||
QTreeWidgetItem *itemParent;
|
||||
while ((itemParent = *it) != NULL) {
|
||||
|
|
|
|||
|
|
@ -40,15 +40,15 @@ class FeedReaderDialog : public MainPage
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
||||
FeedReaderDialog(RsFeedReader *feedReader, FeedReaderNotify *notify, QWidget *parent = 0);
|
||||
~FeedReaderDialog();
|
||||
|
||||
static QIcon iconFromFeed(const FeedInfo &feedInfo);
|
||||
|
||||
protected:
|
||||
virtual UserNotify *createUserNotify(QObject *parent) override;
|
||||
virtual void showEvent(QShowEvent *event);
|
||||
bool eventFilter(QObject *obj, QEvent *ev);
|
||||
virtual void showEvent(QShowEvent *event) override;
|
||||
bool eventFilter(QObject *obj, QEvent *ev) override;
|
||||
|
||||
private slots:
|
||||
void settingsChanged();
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@ void FeedReaderFeedNotify::msgChanged(uint32_t feedId, const QString &msgId, int
|
|||
return;
|
||||
}
|
||||
|
||||
if (type != NOTIFY_TYPE_ADD) {
|
||||
if (type != FeedReaderNotify::NOTIFY_TYPE_ADD) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -515,12 +515,12 @@ void FeedReaderMessageWidget::feedChanged(uint32_t feedId, int type)
|
|||
return;
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_DEL) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
setFeedId(0);
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_MOD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
|
||||
if (!mFeedReader->getFeedInfo(mFeedId, mFeedInfo)) {
|
||||
setFeedId(0);
|
||||
return;
|
||||
|
|
@ -555,18 +555,18 @@ void FeedReaderMessageWidget::msgChanged(uint32_t feedId, const QString &msgId,
|
|||
}
|
||||
|
||||
FeedMsgInfo msgInfo;
|
||||
if (type != NOTIFY_TYPE_DEL) {
|
||||
if (type != FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
if (!mFeedReader->getMsgInfo(feedId, msgId.toStdString(), msgInfo)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_MOD || type == NOTIFY_TYPE_DEL) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD || type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
QTreeWidgetItemIterator it(ui->msgTreeWidget);
|
||||
QTreeWidgetItem *item;
|
||||
while ((item = *it) != NULL) {
|
||||
if (item->data(COLUMN_MSG_DATA, ROLE_MSG_ID).toString() == msgId) {
|
||||
if (type == NOTIFY_TYPE_MOD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
|
||||
updateMsgItem(item, msgInfo);
|
||||
filterItem(item);
|
||||
} else {
|
||||
|
|
@ -578,13 +578,13 @@ void FeedReaderMessageWidget::msgChanged(uint32_t feedId, const QString &msgId,
|
|||
}
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_MOD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
|
||||
if (msgId.toStdString() == currentMsgId()) {
|
||||
updateCurrentMessage();
|
||||
}
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_ADD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_ADD) {
|
||||
QTreeWidgetItem *item = new RSTreeWidgetItem(mMsgCompareRole);
|
||||
updateMsgItem(item, msgInfo);
|
||||
ui->msgTreeWidget->addTopLevelItem(item);
|
||||
|
|
|
|||
|
|
@ -29,6 +29,13 @@ class FeedReaderNotify : public QObject, public RsFeedReaderNotify
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
// These replace the variables from the old notify system. It's simpler than switching the entire
|
||||
// feedreader plugin to the new rsEvents system
|
||||
|
||||
static const int NOTIFY_TYPE_ADD = 0x01;
|
||||
static const int NOTIFY_TYPE_DEL = 0x02;
|
||||
static const int NOTIFY_TYPE_MOD = 0x03;
|
||||
|
||||
FeedReaderNotify();
|
||||
|
||||
/* RsFeedReaderNotify */
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ void FeedReaderUserNotify::iconClicked()
|
|||
|
||||
void FeedReaderUserNotify::feedChanged(uint32_t /*feedId*/, int type)
|
||||
{
|
||||
if (type == NOTIFY_TYPE_DEL) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
updateIcon();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -294,13 +294,13 @@ void PreviewFeedDialog::feedChanged(uint32_t feedId, int type)
|
|||
return;
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_DEL) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_DEL) {
|
||||
/* feed deleted */
|
||||
mFeedId = 0;
|
||||
return;
|
||||
}
|
||||
|
||||
if (type == NOTIFY_TYPE_ADD || type == NOTIFY_TYPE_MOD) {
|
||||
if (type == FeedReaderNotify::NOTIFY_TYPE_ADD || type == FeedReaderNotify::NOTIFY_TYPE_MOD) {
|
||||
FeedInfo feedInfo;
|
||||
if (!mFeedReader->getFeedInfo(mFeedId, feedInfo)) {
|
||||
return;
|
||||
|
|
@ -320,18 +320,18 @@ void PreviewFeedDialog::msgChanged(uint32_t feedId, const QString &msgId, int ty
|
|||
}
|
||||
|
||||
switch (type) {
|
||||
case NOTIFY_TYPE_ADD:
|
||||
case FeedReaderNotify::NOTIFY_TYPE_ADD:
|
||||
if (mMsgId.empty()) {
|
||||
mMsgId = msgId.toStdString();
|
||||
updateMsg();
|
||||
}
|
||||
break;
|
||||
case NOTIFY_TYPE_MOD:
|
||||
case FeedReaderNotify::NOTIFY_TYPE_MOD:
|
||||
if (mMsgId == msgId.toStdString()) {
|
||||
updateMsg();
|
||||
}
|
||||
break;
|
||||
case NOTIFY_TYPE_DEL:
|
||||
case FeedReaderNotify::NOTIFY_TYPE_DEL:
|
||||
if (mMsgId == msgId.toStdString()) {
|
||||
std::list<std::string>::iterator it = std::find(mMsgIds.begin(), mMsgIds.end(), mMsgId);
|
||||
if (it != mMsgIds.end()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue