Browse Source

Merge pull request #7958 from Chocobo1/fixsort

Fix crash in #7952
adaptive-webui-19844
sledgehammer999 7 years ago committed by GitHub
parent
commit
5ea100352e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/gui/categoryfilterproxymodel.cpp
  2. 4
      src/gui/properties/peerlistsortmodel.h
  3. 4
      src/gui/search/searchsortmodel.cpp
  4. 2
      src/gui/tagfilterproxymodel.cpp
  5. 2
      src/gui/transferlistsortmodel.cpp

2
src/gui/categoryfilterproxymodel.cpp

@ -57,5 +57,5 @@ bool CategoryFilterProxyModel::lessThan(const QModelIndex &left, const QModelInd
if (result != 0) if (result != 0)
return (result < 0); return (result < 0);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
} }

4
src/gui/properties/peerlistsortmodel.h

@ -56,14 +56,14 @@ protected:
if (result != 0) if (result != 0)
return (result < 0); return (result < 0);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
} }
break; break;
default: default:
if (left.data() != right.data()) if (left.data() != right.data())
return QSortFilterProxyModel::lessThan(left, right); return QSortFilterProxyModel::lessThan(left, right);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
}; };
} }
}; };

4
src/gui/search/searchsortmodel.cpp

@ -116,14 +116,14 @@ bool SearchSortModel::lessThan(const QModelIndex &left, const QModelIndex &right
if (result != 0) if (result != 0)
return (result < 0); return (result < 0);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
} }
break; break;
default: default:
if (left.data() != right.data()) if (left.data() != right.data())
return base::lessThan(left, right); return base::lessThan(left, right);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
}; };
} }

2
src/gui/tagfilterproxymodel.cpp

@ -57,5 +57,5 @@ bool TagFilterProxyModel::lessThan(const QModelIndex &left, const QModelIndex &r
if (result != 0) if (result != 0)
return (result < 0); return (result < 0);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
} }

2
src/gui/transferlistsortmodel.cpp

@ -98,7 +98,7 @@ bool TransferListSortModel::lessThan(const QModelIndex &left, const QModelIndex
if (result != 0) if (result != 0)
return (result < 0); return (result < 0);
return (mapFromSource(left) < mapFromSource(right)); return (left < right);
} }
case TorrentModel::TR_ADD_DATE: case TorrentModel::TR_ADD_DATE:

Loading…
Cancel
Save