Fix crash in notifications.
This commit is contained in:
parent
fa211e3ba1
commit
8bb9e96a3b
@ -4,7 +4,7 @@ RSS Guard
|
||||
[](https://somsubhra.github.io/github-release-stats/?username=martinrotter&repository=rssguard&search=0)
|
||||
[](https://raw.githubusercontent.com/martinrotter/rssguard/master/resources/text/CHANGELOG)
|
||||
[](https://repology.org/project/rssguard/versions)
|
||||
[](https://rssguard.readthedocs.io/en/latest/?badge=latest)
|
||||
[](https://rssguard.readthedocs.io)
|
||||
[](https://github.com/martinrotter/rssguard/issues)
|
||||
[](https://github.com/martinrotter/rssguard/blob/master/LICENSE.md)
|
||||
|
||||
|
@ -1,3 +1,7 @@
|
||||
.wy-nav-content {
|
||||
max-width: none !important;
|
||||
}
|
||||
|
||||
.wy-side-nav-search {
|
||||
background-color: rgb(250, 166, 136) !important;
|
||||
}
|
@ -1,4 +0,0 @@
|
||||
{% extends "!layout.html" %}
|
||||
{% block extrahead %}
|
||||
<link href="{{ pathto("_static/style.css", True) }}" rel="stylesheet" type="text/css">
|
||||
{% endblock %}
|
@ -35,6 +35,7 @@ html_theme_options = {
|
||||
|
||||
myst_enable_extensions = [
|
||||
"amsmath",
|
||||
"attrs_block",
|
||||
"attrs_inline",
|
||||
"colon_fence",
|
||||
"deflist",
|
||||
@ -50,4 +51,8 @@ myst_enable_extensions = [
|
||||
"tasklist",
|
||||
]
|
||||
|
||||
html_css_files = [
|
||||
'style.css',
|
||||
]
|
||||
|
||||
myst_heading_anchors = 4
|
@ -4,7 +4,7 @@ Official place to download RSS Guard is at [Github Releases page](https://github
|
||||
|
||||
RSS Guard is also available in [repositories of many Linux distributions](https://repology.org/project/rssguard/versions), and via [Flathub](https://flathub.org/about).
|
||||
|
||||
The are two different flavors:
|
||||
The are two different [flavors](#features/browseradblock):
|
||||
* [Regular](https://flathub.org/apps/details/io.github.martinrotter.rssguard): Includes an (almost) full-blown integrated web browser (built with `-DUSE_WEBENGINE=ON`).
|
||||
* [Lite](https://flathub.org/apps/details/io.github.martinrotter.rssguardlite): Includes simpler, safer (and less memory hungry integrated web browser (built with `-DUSE_WEBENGINE=OFF`).
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
RSS Guards documentation!
|
||||
RSS Guards Documentation!
|
||||
=========================
|
||||
|
||||
.. toctree::
|
||||
|
@ -1,3 +1,3 @@
|
||||
What is RSS Guard?
|
||||
==================
|
||||
RSS Guard is an [open-source](https://en.wikipedia.org/wiki/Open_source) cross-platform multi-protocol desktop feed reader. It is able to fetch feeds in RSS/RDF/ATOM/JSON formats and connect to multiple web-based feed readers. RSS Guard is developed on top of the [Qt library](http://qt-project.org).
|
||||
RSS Guard is an [open-source](https://en.wikipedia.org/wiki/Open_source) [cross-platform](#supported-os) [multi-protocol](#supported-readers) desktop feed reader. It is able to fetch feeds in RSS/RDF/ATOM/JSON formats and connect to multiple web-based feed readers. RSS Guard is developed on top of the [Qt library](http://qt-project.org).
|
@ -3,6 +3,7 @@
|
||||
#include "core/articlelistnotificationmodel.h"
|
||||
|
||||
#include "definitions/definitions.h"
|
||||
#include "exceptions/applicationexception.h"
|
||||
|
||||
ArticleListNotificationModel::ArticleListNotificationModel(QObject* parent)
|
||||
: QAbstractListModel(parent), m_currentPage(-1) {}
|
||||
@ -19,7 +20,13 @@ void ArticleListNotificationModel::setArticles(const QList<Message>& msgs) {
|
||||
}
|
||||
|
||||
Message ArticleListNotificationModel::message(const QModelIndex& idx) const {
|
||||
return m_articles.at((m_currentPage * NOTIFICATIONS_PAGE_SIZE) + idx.row());
|
||||
int list_position = (m_currentPage * NOTIFICATIONS_PAGE_SIZE) + idx.row();
|
||||
|
||||
if (list_position < 0 || list_position >= m_articles.size()) {
|
||||
throw ApplicationException(QSL("message cannot be loaded, wrong index"));
|
||||
}
|
||||
|
||||
return m_articles.at(list_position);
|
||||
}
|
||||
|
||||
void ArticleListNotificationModel::nextPage() {
|
||||
|
@ -113,6 +113,6 @@ Message ArticleListNotification::selectedMessage() const {
|
||||
return m_model->message(m_ui.m_treeArticles->currentIndex());
|
||||
}
|
||||
else {
|
||||
throw ApplicationException("message cannot be loaded, wrong index");
|
||||
throw ApplicationException(QSL("message cannot be loaded, wrong index"));
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user