Commit 200c3528 authored by Laurent Montel's avatar Laurent Montel 😁

Fix some cppcheck

parent 15b4c727
Pipeline #36185 passed with stage
in 17 minutes and 2 seconds
......@@ -42,8 +42,8 @@ static QString stripHtml(const QString &html)
}
ArticleModel::ArticleModel(const QVector<Article> &articles, QObject *parent) : QAbstractTableModel(parent)
, m_articles(articles)
{
m_articles = articles;
const int articlesCount(articles.count());
m_titleCache.resize(articlesCount);
for (int i = 0; i < articlesCount; ++i) {
......
......@@ -334,7 +334,7 @@ void ArticleViewerWidget::slotArticlesListed(KJob *job)
m_articles = m_listJob->articles();
std::sort(m_articles.begin(), m_articles.end());
if (node && !m_articles.isEmpty()) {
if (!m_articles.isEmpty()) {
m_link = m_articles.first().link();
} else {
m_link = QUrl();
......
......@@ -19,11 +19,6 @@ Frame::Frame(QWidget *parent)
: QWidget(parent)
{
m_title = i18n("Untitled");
m_state = Idle;
m_progress = -1;
m_progressItem = nullptr;
m_isRemovable = true;
m_loading = false;
m_id = m_idCounter++;
}
......
......@@ -119,12 +119,12 @@ protected:
QIcon m_icon;
QString m_title;
QString m_caption;
State m_state;
int m_progress;
State m_state = Idle;
int m_progress = -1;
QString m_statusText;
QString m_progressId;
KPIM::ProgressItem *m_progressItem = nullptr;
bool m_isRemovable = false;
bool m_isRemovable = true;
bool m_loading = false;
int m_id;
static int m_idCounter;
......
......@@ -227,9 +227,7 @@ void SelectionController::articleHeadersAvailable(KJob *job)
disconnect(m_articleLister->articleSelectionModel(), &QItemSelectionModel::selectionChanged, this, &SelectionController::articleSelectionChanged);
connect(m_articleLister->articleSelectionModel(), &QItemSelectionModel::selectionChanged, this, &SelectionController::articleSelectionChanged);
if (node) {
m_articleLister->setScrollBarPositions(node->listViewScrollBarPositions());
}
m_articleLister->setScrollBarPositions(node->listViewScrollBarPositions());
}
void SelectionController::subscriptionDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment