mirror of
https://invent.kde.org/system/dolphin
synced 2024-11-05 18:47:12 +00:00
insert the meta text information alphabetically sorted
svn path=/trunk/KDE/kdebase/apps/; revision=937920
This commit is contained in:
parent
27a4b76871
commit
045fca17ef
1 changed files with 14 additions and 1 deletions
|
@ -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();
|
||||||
|
|
Loading…
Reference in a new issue