insert the meta text information alphabetically sorted

svn path=/trunk/KDE/kdebase/apps/; revision=937920
This commit is contained in:
Peter Penz 2009-03-10 19:36:55 +00:00
parent 27a4b76871
commit 045fca17ef

View file

@ -51,7 +51,20 @@ void MetaTextLabel::add(const QString& labelText, const QString& infoText)
MetaInfo metaInfo; MetaInfo metaInfo;
metaInfo.label = labelText; metaInfo.label = labelText;
metaInfo.info = infoText; 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)); setMinimumHeight(minimumHeight() + requiredHeight(metaInfo));
update(); update();