Sort labels in RSS Downloader dialog, closes #3140.

This commit is contained in:
Chocobo1
2015-06-16 01:23:33 +08:00
parent 1da29a450c
commit 176dd0bee8
3 changed files with 99 additions and 6 deletions

View File

@@ -41,6 +41,9 @@
#include <QUrl>
#ifndef DISABLE_GUI
#include <QIcon>
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
#include <QCollator>
#endif
#endif
#include <libtorrent/version.hpp>
@@ -104,7 +107,19 @@ namespace misc
QString accurateDoubleToString(const double &n, const int &precision);
#ifndef DISABLE_GUI
bool naturalSort(QString left, QString right, bool& result);
bool naturalSort(const QString &left, const QString &right, bool &result);
class NaturalCompare
{
public:
NaturalCompare();
bool operator()(const QString &l, const QString &r);
bool lessThan(const QString &left, const QString &right);
#if (QT_VERSION >= QT_VERSION_CHECK(5, 2, 0))
private:
QCollator m_collator;
#endif
};
#endif
// Implements constant-time comparison to protect against timing attacks