summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2014-03-17 13:56:06 +0900
committerSlávek Banko <slavek.banko@axis.cz>2015-12-23 02:22:41 +0100
commitda960937c052f232d084ba30febe8503d25ddf4c (patch)
treebe9726a00183e059c28ac17c4ce9ff79990fc3bd
parentf855b39aea408e9d28c9834851144474a8d4da95 (diff)
downloadtdelibs-da960937c052f232d084ba30febe8503d25ddf4c.tar.gz
tdelibs-da960937c052f232d084ba30febe8503d25ddf4c.zip
The output of "tdecmshell --list" is now sorted by ascending module name.
This resolves bug 1893. (cherry picked from commit ee90275a69840647dccfcde9cec96121d38db13d)
-rw-r--r--kcmshell/main.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/kcmshell/main.cpp b/kcmshell/main.cpp
index 80abb405e..87e849e3b 100644
--- a/kcmshell/main.cpp
+++ b/kcmshell/main.cpp
@@ -231,22 +231,25 @@ extern "C" KDE_EXPORT int kdemain(int _argc, char *_argv[])
int maxLen=0;
- for( KService::List::ConstIterator it = m_modules.begin(); it != m_modules.end(); ++it)
+ for (KService::List::ConstIterator it = m_modules.begin(); it != m_modules.end(); ++it)
{
int len = (*it)->desktopEntryName().length();
if (len > maxLen)
maxLen = len;
}
- for( KService::List::ConstIterator it = m_modules.begin(); it != m_modules.end(); ++it)
+ TQStringList module_list;
+ for (KService::List::ConstIterator it = m_modules.begin(); it != m_modules.end(); ++it)
{
- TQString entry("%1 - %2");
-
- entry = entry.arg((*it)->desktopEntryName().leftJustify(maxLen, ' '))
- .arg(!(*it)->comment().isEmpty() ? (*it)->comment()
- : i18n("No description available"));
+ module_list.append(TQString("%1 - %2")
+ .arg((*it)->desktopEntryName().leftJustify(maxLen, ' '))
+ .arg(!(*it)->comment().isEmpty() ? (*it)->comment() : i18n("No description available")));
+ }
+ module_list.sort();
- cout << static_cast<const char *>(entry.local8Bit()) << endl;
+ for (TQStringList::Iterator it=module_list.begin(); it!=module_list.end(); ++it)
+ {
+ cout << static_cast<const char *>((*it).local8Bit()) << endl;
}
return 0;
}