Unified hashCode() implementation.
This commit is contained in:
parent
d76e5eb345
commit
57110063d6
@ -44,7 +44,13 @@ RootItem::~RootItem() {
|
||||
}
|
||||
|
||||
QString RootItem::hashCode() const {
|
||||
return QString::number(kind()) + QL1S("-") + QString::number(id());
|
||||
ServiceRoot *root = getParentServiceRoot();
|
||||
int acc_id = root == NULL ? 0 : root->accountId();
|
||||
|
||||
return
|
||||
QString::number(acc_id) + QL1S("-") +
|
||||
QString::number(kind()) + QL1S("-") +
|
||||
QString::number(id());
|
||||
}
|
||||
|
||||
QList<QAction*> RootItem::contextMenu() {
|
||||
|
@ -41,13 +41,6 @@ TtRssCategory::TtRssCategory(const QSqlRecord &record) : Category(NULL) {
|
||||
TtRssCategory::~TtRssCategory() {
|
||||
}
|
||||
|
||||
QString TtRssCategory::hashCode() const {
|
||||
return
|
||||
QString::number(kind()) + QL1S("-") +
|
||||
QString::number(getParentServiceRoot()->accountId()) + QL1S("-") +
|
||||
QString::number(customId());
|
||||
}
|
||||
|
||||
TtRssServiceRoot *TtRssCategory::serviceRoot() const {
|
||||
return qobject_cast<TtRssServiceRoot*>(getParentServiceRoot());
|
||||
}
|
||||
|
@ -33,10 +33,7 @@ class TtRssCategory : public Category {
|
||||
explicit TtRssCategory(const QSqlRecord &record);
|
||||
virtual ~TtRssCategory();
|
||||
|
||||
QString hashCode() const;
|
||||
|
||||
TtRssServiceRoot *serviceRoot() const;
|
||||
|
||||
bool markAsReadUnread(ReadStatus status);
|
||||
bool cleanMessages(bool clear_only_read);
|
||||
|
||||
|
@ -50,13 +50,6 @@ TtRssFeed::TtRssFeed(const QSqlRecord &record) : Feed(NULL) {
|
||||
TtRssFeed::~TtRssFeed() {
|
||||
}
|
||||
|
||||
QString TtRssFeed::hashCode() const {
|
||||
return
|
||||
QString::number(kind()) + QL1S("-") +
|
||||
QString::number(getParentServiceRoot()->accountId()) + QL1S("-") +
|
||||
QString::number(customId());
|
||||
}
|
||||
|
||||
int TtRssFeed::messageForeignKeyId() const {
|
||||
return customId();
|
||||
}
|
||||
|
@ -33,25 +33,17 @@ class TtRssFeed : public Feed {
|
||||
explicit TtRssFeed(const QSqlRecord &record);
|
||||
virtual ~TtRssFeed();
|
||||
|
||||
QString hashCode() const;
|
||||
|
||||
int messageForeignKeyId() const;
|
||||
|
||||
TtRssServiceRoot *serviceRoot() const;
|
||||
|
||||
QVariant data(int column, int role) const;
|
||||
|
||||
void updateCounts(bool including_total_count);
|
||||
|
||||
bool canBeEdited() const;
|
||||
bool editViaGui();
|
||||
|
||||
bool canBeDeleted() const;
|
||||
bool deleteViaGui();
|
||||
|
||||
int update();
|
||||
QList<Message> undeletedMessages() const;
|
||||
|
||||
bool markAsReadUnread(ReadStatus status);
|
||||
bool cleanMessages(bool clear_only_read);
|
||||
bool editItself(TtRssFeed *new_feed_data);
|
||||
|
Loading…
x
Reference in New Issue
Block a user