diff options
| author | Peter Penz <[email protected]> | 2009-03-10 19:36:55 +0000 |
|---|---|---|
| committer | Peter Penz <[email protected]> | 2009-03-10 19:36:55 +0000 |
| commit | 045fca17eff062b6937ace1e1d07f926b6b6bc39 (patch) | |
| tree | c20e0127a439e32ac485590e2fd40fcaf4d8d7ed | |
| parent | 27a4b768714efb8a2b78f4fcb155e267cc1da05a (diff) | |
insert the meta text information alphabetically sorted
svn path=/trunk/KDE/kdebase/apps/; revision=937920
| -rw-r--r-- | src/panels/information/metatextlabel.cpp | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/panels/information/metatextlabel.cpp b/src/panels/information/metatextlabel.cpp index 94ed22666..baa4d0327 100644 --- a/src/panels/information/metatextlabel.cpp +++ b/src/panels/information/metatextlabel.cpp @@ -51,7 +51,20 @@ void MetaTextLabel::add(const QString& labelText, const QString& infoText) MetaInfo metaInfo; metaInfo.label = labelText; metaInfo.info = infoText; - m_metaInfos.append(metaInfo); + + // add the meta information alphabetically sorted + bool inserted = false; + const int count = m_metaInfos.size(); + for (int i = 0; i < count; ++i) { + if (m_metaInfos[i].label > labelText) { + m_metaInfos.insert(i, metaInfo); + inserted = true; + break; + } + } + if (!inserted) { + m_metaInfos.append(metaInfo); + } setMinimumHeight(minimumHeight() + requiredHeight(metaInfo)); update(); |
