Browse Source

Merge pull request #8087 from sledgehammer999/fix_flag_sorting

Fix sorting of country flags column in Peers tab.
adaptive-webui-19844
sledgehammer999 7 years ago committed by GitHub
parent
commit
0a35adbdba
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      src/gui/categoryfilterproxymodel.cpp
  2. 12
      src/gui/properties/peerlistsortmodel.h
  3. 12
      src/gui/search/searchsortmodel.cpp
  4. 5
      src/gui/tagfilterproxymodel.cpp
  5. 5
      src/gui/transferlistsortmodel.cpp

4
src/gui/categoryfilterproxymodel.cpp

@ -54,8 +54,6 @@ bool CategoryFilterProxyModel::lessThan(const QModelIndex &left, const QModelInd
int result = Utils::String::naturalCompare(left.data().toString(), right.data().toString() int result = Utils::String::naturalCompare(left.data().toString(), right.data().toString()
, Qt::CaseInsensitive); , Qt::CaseInsensitive);
if (result != 0)
return (result < 0);
return (left < right); return (result < 0);
} }

12
src/gui/properties/peerlistsortmodel.h

@ -53,17 +53,11 @@ protected:
const QString strL = left.data().toString(); const QString strL = left.data().toString();
const QString strR = right.data().toString(); const QString strR = right.data().toString();
const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive); const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive);
if (result != 0) return (result < 0);
return (result < 0); }
return (left < right);
}
break; break;
default: default:
if (left.data() != right.data()) return QSortFilterProxyModel::lessThan(left, right);
return QSortFilterProxyModel::lessThan(left, right);
return (left < right);
}; };
} }
}; };

12
src/gui/search/searchsortmodel.cpp

@ -113,17 +113,11 @@ bool SearchSortModel::lessThan(const QModelIndex &left, const QModelIndex &right
const QString strL = left.data().toString(); const QString strL = left.data().toString();
const QString strR = right.data().toString(); const QString strR = right.data().toString();
const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive); const int result = Utils::String::naturalCompare(strL, strR, Qt::CaseInsensitive);
if (result != 0) return (result < 0);
return (result < 0); }
return (left < right);
}
break; break;
default: default:
if (left.data() != right.data()) return base::lessThan(left, right);
return base::lessThan(left, right);
return (left < right);
}; };
} }

5
src/gui/tagfilterproxymodel.cpp

@ -54,8 +54,5 @@ bool TagFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &r
int result = Utils::String::naturalCompare(left.data().toString(), right.data().toString() int result = Utils::String::naturalCompare(left.data().toString(), right.data().toString()
, Qt::CaseInsensitive); , Qt::CaseInsensitive);
if (result != 0) return (result < 0);
return (result < 0);
return (left < right);
} }

5
src/gui/transferlistsortmodel.cpp

@ -95,10 +95,7 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex
return lowerPositionThan(left, right); return lowerPositionThan(left, right);
const int result = Utils::String::naturalCompare(vL.toString(), vR.toString(), Qt::CaseInsensitive); const int result = Utils::String::naturalCompare(vL.toString(), vR.toString(), Qt::CaseInsensitive);
if (result != 0) return (result < 0);
return (result < 0);
return (left < right);
} }
case TorrentModel::TR_ADD_DATE: case TorrentModel::TR_ADD_DATE:

Loading…
Cancel
Save