Skip to content

Commit

Permalink
Refactor ActivityListModel population mechanisms
Browse files Browse the repository at this point in the history
Signed-off-by: Claudio Cambra <claudio.cambra@gmail.com>
  • Loading branch information
claucambra committed Jul 26, 2022
1 parent 9cb255f commit 57a5fc8
Show file tree
Hide file tree
Showing 7 changed files with 405 additions and 304 deletions.
2 changes: 1 addition & 1 deletion src/gui/fileactivitylistmodel.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FileActivityListModel : public ActivityListModel
public slots:
void load(AccountState *accountState, const int objectId);

protected:
protected slots:
void startFetchJob() override;

private:
Expand Down
10 changes: 10 additions & 0 deletions src/gui/tray/activitydata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,21 @@ bool operator<(const Activity &rhs, const Activity &lhs)
return rhs._dateTime > lhs._dateTime;
}

bool operator>(const Activity &rhs, const Activity &lhs)
{
return rhs._dateTime < lhs._dateTime;
}

bool operator==(const Activity &rhs, const Activity &lhs)
{
return (rhs._type == lhs._type && rhs._id == lhs._id && rhs._accName == lhs._accName);
}

bool operator!=(const Activity &rhs, const Activity &lhs)
{
return !(rhs == lhs);
}

Activity::Identifier Activity::ident() const
{
return Identifier(_id, _accName);
Expand Down
3 changes: 3 additions & 0 deletions src/gui/tray/activitydata.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,9 @@ class Activity
};

bool operator==(const Activity &rhs, const Activity &lhs);
bool operator!=(const Activity &rhs, const Activity &lhs);
bool operator<(const Activity &rhs, const Activity &lhs);
bool operator>(const Activity &rhs, const Activity &lhs);

/* ==================================================================== */
/**
Expand All @@ -168,6 +170,7 @@ bool operator<(const Activity &rhs, const Activity &lhs);
using ActivityList = QList<Activity>;
}

Q_DECLARE_METATYPE(OCC::Activity)
Q_DECLARE_METATYPE(OCC::Activity::Type)
Q_DECLARE_METATYPE(OCC::ActivityLink)
Q_DECLARE_METATYPE(OCC::PreviewData)
Expand Down
Loading

0 comments on commit 57a5fc8

Please sign in to comment.