Sort items in file system combo boxes case insensitively.

BUG: 191739

svn path=/trunk/extragear/sysadmin/partitionmanager/; revision=963992
This commit is contained in:
Volker Lanz 2009-05-05 19:33:55 +00:00
parent 4b3394d482
commit 3c0d91f9d9
4 changed files with 13 additions and 3 deletions

View File

@ -27,6 +27,7 @@
#include "fs/filesystemfactory.h"
#include "util/capacity.h"
#include "util/helpers.h"
#include <kdebug.h>
@ -65,7 +66,7 @@ void NewDialog::setupDialog()
if (fs->supportCreate() != FileSystem::SupportNone && fs->type() != FileSystem::Extended)
fsNames.append(fs->name());
qSort(fsNames);
qSort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
dialogWidget().comboFileSystem().addItems(fsNames);
QString selected = FileSystem::nameForType(FileSystem::defaultFileSystem());
dialogWidget().comboFileSystem().setCurrentIndex(dialogWidget().comboFileSystem().findText(selected));

View File

@ -24,7 +24,9 @@
#include "core/device.h"
#include "fs/filesystemfactory.h"
#include "util/capacity.h"
#include "util/helpers.h"
#include <kmessagebox.h>
#include <kdebug.h>
@ -279,7 +281,7 @@ void PartPropsDialog::setupFileSystemComboBox()
fsNames.append(name);
}
qSort(fsNames);
qSort(fsNames.begin(), fsNames.end(), caseInsensitiveLessThan);
dialogWidget().fileSystem().addItems(fsNames);
dialogWidget().fileSystem().setCurrentIndex(dialogWidget().fileSystem().findText(selected));

View File

@ -73,10 +73,14 @@ KAboutData* createPartitionManagerAboutData()
KAboutData::License_GPL,
ki18nc("@info:credit", "(c) 2008, 2009 Volker Lanz")
);
about->addAuthor(ki18nc("@info:credit", "Volker Lanz"), KLocalizedString(), "vl@fidra.de");
about->setHomepage("http://www.partitionmanager.org");
return about;
}
bool caseInsensitiveLessThan(const QString& s1, const QString& s2)
{
return s1.toLower() < s2.toLower();
}

View File

@ -24,6 +24,7 @@
#include "util/libpartitionmanagerexport.h"
class KAboutData;
class QString;
LIBPARTITIONMANAGERPRIVATE_EXPORT void registerMetaTypes();
LIBPARTITIONMANAGERPRIVATE_EXPORT void unblockSigChild();
@ -31,4 +32,6 @@ LIBPARTITIONMANAGERPRIVATE_EXPORT bool checkPermissions();
LIBPARTITIONMANAGERPRIVATE_EXPORT KAboutData* createPartitionManagerAboutData();
LIBPARTITIONMANAGERPRIVATE_EXPORT bool caseInsensitiveLessThan(const QString& s1, const QString& s2);
#endif