Fix coding style

This commit is contained in:
thalieht
2018-05-31 12:19:07 +03:00
parent 93d4f2d595
commit 356d6a6589
28 changed files with 195 additions and 223 deletions

View File

@@ -1,6 +1,6 @@
/*
* Bittorrent Client using Qt and libtorrent.
* Copyright (C) 2013 sledgehammer999 <hammered999@gmail.com>
* Copyright (C) 2013 sledgehammer999 <sledgehammer999@qbittorrent.org>
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@@ -123,10 +123,10 @@ bool SearchSortModel::lessThan(const QModelIndex &left, const QModelIndex &right
bool SearchSortModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceParent) const
{
const QAbstractItemModel* const sourceModel = this->sourceModel();
const QAbstractItemModel *const sourceModel = this->sourceModel();
if (m_isNameFilterEnabled && !m_searchTerm.isEmpty()) {
QString name = sourceModel->data(sourceModel->index(sourceRow, NAME, sourceParent)).toString();
for (const QString& word: m_searchTermWords) {
for (const QString &word: m_searchTermWords) {
int i = name.indexOf(word, 0, Qt::CaseInsensitive);
if (i == -1) {
return false;
@@ -134,26 +134,26 @@ bool SearchSortModel::filterAcceptsRow(int sourceRow, const QModelIndex &sourceP
}
}
if (m_minSize > 0 || m_maxSize >= 0) {
if ((m_minSize > 0) || (m_maxSize >= 0)) {
qlonglong size = sourceModel->data(sourceModel->index(sourceRow, SIZE, sourceParent)).toLongLong();
if ((m_minSize > 0 && size < m_minSize)
|| (m_maxSize > 0 && size > m_maxSize)) {
if (((m_minSize > 0) && (size < m_minSize))
|| ((m_maxSize > 0) && (size > m_maxSize))) {
return false;
}
}
if (m_minSeeds > 0 || m_maxSeeds >= 0) {
if ((m_minSeeds > 0) || (m_maxSeeds >= 0)) {
int seeds = sourceModel->data(sourceModel->index(sourceRow, SEEDS, sourceParent)).toInt();
if ((m_minSeeds > 0 && seeds < m_minSeeds)
|| (m_maxSeeds > 0 && seeds > m_maxSeeds)) {
if (((m_minSeeds > 0) && (seeds < m_minSeeds))
|| ((m_maxSeeds > 0) && (seeds > m_maxSeeds))) {
return false;
}
}
if (m_minLeeches > 0 || m_maxLeeches >= 0) {
if ((m_minLeeches > 0) || (m_maxLeeches >= 0)) {
int leeches = sourceModel->data(sourceModel->index(sourceRow, LEECHES, sourceParent)).toInt();
if ((m_minLeeches > 0 && leeches < m_minLeeches)
|| (m_maxLeeches > 0 && leeches > m_maxLeeches)) {
if (((m_minLeeches > 0) && (leeches < m_minLeeches))
|| ((m_maxLeeches > 0) && (leeches > m_maxLeeches))) {
return false;
}
}