From e9350e66f01273fe35dac6a5fe5c7cdf6356b71e Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sun, 15 Nov 2009 14:56:25 +0000 Subject: [PATCH] - FEATURE: Make sure torrent files are always sorted by name --- Changelog | 1 + src/TorrentFilesModel.h | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Changelog b/Changelog index af5a693e7..c0b102217 100644 --- a/Changelog +++ b/Changelog @@ -19,6 +19,7 @@ - FEATURE: Folder scanning now works with CIFS and NFS mounted folders - FEATURE: Speed up qBittorrent startup - FEATURE: Display per-torrent peer list + - FEATURE: Make sure torrent files are always sorted by name - COSMETIC: Merged download / upload lists - COSMETIC: Torrents can be filtered based on their status - COSMETIC: Torrent properties are now displayed in main window diff --git a/src/TorrentFilesModel.h b/src/TorrentFilesModel.h index 3809232a6..cfed8a414 100644 --- a/src/TorrentFilesModel.h +++ b/src/TorrentFilesModel.h @@ -200,7 +200,13 @@ public: Q_ASSERT(item); //Q_ASSERT(!childWithName(item->getName())); Q_ASSERT(type != TFILE); - childItems.append(item); + int i=0; + for(i=0; igetName(); + if(QString::localeAwareCompare(newchild_name, childItems.at(i)->getName()) < 0) break; + } + childItems.insert(i, item); + //childItems.append(item); //Q_ASSERT(type != ROOT || childItems.size() == 1); }