mirror of
https://github.com/martinrotter/rssguard.git
synced 2025-01-10 23:23:52 +01:00
versions
This commit is contained in:
parent
3e24129bf1
commit
62bda35fc8
@ -98,7 +98,7 @@ IncludeCategories:
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
IncludeIsMainSourceRegex: ''
|
||||
IndentAccessModifiers: true
|
||||
IndentCaseLabels: false
|
||||
IndentCaseLabels: true
|
||||
IndentCaseBlocks: false
|
||||
IndentGotoLabels: true
|
||||
IndentPPDirectives: None
|
||||
|
@ -30,7 +30,7 @@
|
||||
# Other information:
|
||||
# - supports Windows, Linux, *BSD, macOS, OS/2, Android,
|
||||
# - Qt 5.12.0 or newer is required,
|
||||
# - Qt 6.2.3 or newer is required,
|
||||
# - Qt 6.3.0 or newer is required,
|
||||
# - cmake 3.9.0 or newer is required,
|
||||
# - if you wish to make packages for Windows, then you must initialize all submodules
|
||||
# within repository before compilation,
|
||||
@ -60,7 +60,7 @@ set(APP_AUTHOR "Martin Rotter")
|
||||
set(APP_COPYRIGHT "\\251 2011-2022 ${APP_AUTHOR}")
|
||||
set(APP_REVERSE_NAME "com.github.rssguard")
|
||||
set(APP_DONATE_URL "https://github.com/sponsors/martinrotter")
|
||||
set(APP_VERSION "4.2.1")
|
||||
set(APP_VERSION "4.3.1")
|
||||
|
||||
set(APP_URL "https://github.com/martinrotter/rssguard")
|
||||
set(APP_URL_DOCUMENTATION "https://github.com/martinrotter/rssguard/blob/master/resources/docs/Documentation.md")
|
||||
@ -108,7 +108,7 @@ option(FORCE_COLORED_OUTPUT "Always produce ANSI-colored output (GCC/Clang only)
|
||||
option(REVISION_FROM_GIT "Get revision using `git rev-parse`" ON)
|
||||
|
||||
# Import Qt libraries.
|
||||
set(QT6_MIN_VERSION 6.2.3)
|
||||
set(QT6_MIN_VERSION 6.3.0)
|
||||
set(QT5_MIN_VERSION 5.12.0)
|
||||
|
||||
set(QT_COMPONENTS
|
||||
|
@ -99,60 +99,61 @@ bool MessagesProxyModel::lessThan(const QModelIndex& left, const QModelIndex& ri
|
||||
return false;
|
||||
}
|
||||
|
||||
bool MessagesProxyModel::filterAcceptsMessage(Message currentMessage) const {
|
||||
bool MessagesProxyModel::filterAcceptsMessage(const Message& current_message) const {
|
||||
switch (m_filter) {
|
||||
case MessageListFilter::NoFiltering:
|
||||
return true;
|
||||
|
||||
case MessageListFilter::ShowUnread:
|
||||
return !currentMessage.m_isRead;
|
||||
return !current_message.m_isRead;
|
||||
|
||||
case MessageListFilter::ShowImportant:
|
||||
return currentMessage.m_isImportant;
|
||||
return current_message.m_isImportant;
|
||||
|
||||
case MessageListFilter::ShowToday: {
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
const QDate currentDate = currentDateTime.date();
|
||||
|
||||
return currentDate.startOfDay() <= currentMessage.m_created && currentMessage.m_created <= currentDate.endOfDay();
|
||||
return currentDate.startOfDay() <= current_message.m_created &&
|
||||
current_message.m_created <= currentDate.endOfDay();
|
||||
}
|
||||
|
||||
case MessageListFilter::ShowYesterday: {
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
const QDate currentDate = currentDateTime.date();
|
||||
|
||||
return currentDate.addDays(-1).startOfDay() <= currentMessage.m_created &&
|
||||
currentMessage.m_created <= currentDate.addDays(-1).endOfDay();
|
||||
return currentDate.addDays(-1).startOfDay() <= current_message.m_created &&
|
||||
current_message.m_created <= currentDate.addDays(-1).endOfDay();
|
||||
}
|
||||
|
||||
case MessageListFilter::ShowLast24Hours: {
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
|
||||
return currentDateTime.addSecs(-24 * 60 * 60) <= currentMessage.m_created &&
|
||||
currentMessage.m_created <= currentDateTime;
|
||||
return currentDateTime.addSecs(-24 * 60 * 60) <= current_message.m_created &&
|
||||
current_message.m_created <= currentDateTime;
|
||||
}
|
||||
|
||||
case MessageListFilter::ShowLast48Hours: {
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
|
||||
return currentDateTime.addSecs(-48 * 60 * 60) <= currentMessage.m_created &&
|
||||
currentMessage.m_created <= currentDateTime;
|
||||
return currentDateTime.addSecs(-48 * 60 * 60) <= current_message.m_created &&
|
||||
current_message.m_created <= currentDateTime;
|
||||
}
|
||||
|
||||
case MessageListFilter::ShowThisWeek: {
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
const QDate currentDate = currentDateTime.date();
|
||||
|
||||
return currentDate.year() == currentMessage.m_created.date().year() &&
|
||||
currentDate.weekNumber() == currentMessage.m_created.date().weekNumber();
|
||||
return currentDate.year() == current_message.m_created.date().year() &&
|
||||
currentDate.weekNumber() == current_message.m_created.date().weekNumber();
|
||||
}
|
||||
|
||||
case MessageListFilter::ShowLastWeek: {
|
||||
const QDateTime currentDateTime = QDateTime::currentDateTime();
|
||||
const QDate currentDate = currentDateTime.date();
|
||||
|
||||
return currentDate.addDays(-7).year() == currentMessage.m_created.date().year() &&
|
||||
currentDate.addDays(-7).weekNumber() == currentMessage.m_created.date().weekNumber();
|
||||
return currentDate.addDays(-7).year() == current_message.m_created.date().year() &&
|
||||
currentDate.addDays(-7).weekNumber() == current_message.m_created.date().weekNumber();
|
||||
}
|
||||
}
|
||||
|
||||
@ -171,7 +172,7 @@ bool MessagesProxyModel::filterAcceptsRow(int source_row, const QModelIndex& sou
|
||||
filterAcceptsMessage(m_sourceModel->messageAt(source_row)));
|
||||
}
|
||||
|
||||
void MessagesProxyModel::setFilter(MessageListFilter filter) {
|
||||
void MessagesProxyModel::setMessageListFilter(MessageListFilter filter) {
|
||||
m_filter = filter;
|
||||
}
|
||||
|
||||
|
@ -36,25 +36,26 @@ class MessagesProxyModel : public QSortFilterProxyModel {
|
||||
QModelIndexList mapListToSource(const QModelIndexList& indexes) const;
|
||||
QModelIndexList mapListFromSource(const QModelIndexList& indexes, bool deep = false) const;
|
||||
|
||||
void setMessageListFilter(MessageListFilter filter);
|
||||
|
||||
// Fix for matching indexes with respect to specifics of the message model.
|
||||
QModelIndexList match(const QModelIndex& start,
|
||||
virtual QModelIndexList match(const QModelIndex& start,
|
||||
int role,
|
||||
const QVariant& entered_value,
|
||||
int hits,
|
||||
Qt::MatchFlags flags) const;
|
||||
|
||||
// Performs sort of items.
|
||||
void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
|
||||
void setFilter(MessageListFilter filter);
|
||||
virtual void sort(int column, Qt::SortOrder order = Qt::AscendingOrder);
|
||||
|
||||
private:
|
||||
QModelIndex getNextImportantItemIndex(int default_row, int max_row) const;
|
||||
QModelIndex getNextUnreadItemIndex(int default_row, int max_row) const;
|
||||
|
||||
bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
|
||||
bool filterAcceptsMessage(Message currentMessage) const;
|
||||
bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
|
||||
bool filterAcceptsMessage(const Message& current_message) const;
|
||||
|
||||
virtual bool lessThan(const QModelIndex& left, const QModelIndex& right) const;
|
||||
virtual bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const;
|
||||
|
||||
// Source model pointer.
|
||||
MessagesModel* m_sourceModel;
|
||||
|
@ -500,7 +500,7 @@ void MessagesView::loadItem(RootItem* item) {
|
||||
}
|
||||
|
||||
void MessagesView::changeFilter(MessagesProxyModel::MessageListFilter filter) {
|
||||
m_proxyModel->setFilter(filter);
|
||||
m_proxyModel->setMessageListFilter(filter);
|
||||
reloadSelections();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user