X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/74bf01c3fdb68cdb865ea700b89188ff2f9f2a73..e8686083b9de4e83a448ddfd36ea57de7b9e2cd8:/src/infosidebarpage.cpp
diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp
index 9c400b198..61a7b0643 100644
--- a/src/infosidebarpage.cpp
+++ b/src/infosidebarpage.cpp
@@ -325,7 +325,7 @@ void InfoSidebarPage::createMetaInfo()
for (QStringList::Iterator it = keys.begin(); it != keys.end(); ++it) {
if (showMetaInfo(*it)) {
KFileMetaInfoItem metaInfoItem = metaInfo.item(*it);
- addInfoLine(*it, metaInfoItem.string());
+ addInfoLine(*it, metaInfoItem.value().toString());
}
}
}
@@ -519,7 +519,7 @@ void InfoSidebarPage::insertActions()
void InfoSidebarPage::showAnnotation(const KUrl& file)
{
if(m_metadata->storageUp()) {
- QString text = m_metadata->getAnnotation(file);
+ QString text = m_metadata->annotation(file);
if (!text.isEmpty()) {
m_annotationLabel->show();
m_annotationLabel->setText(QString("%1 :
%2").arg(i18n("Annotation")).arg(text));
@@ -533,16 +533,16 @@ void InfoSidebarPage::showAnnotation(const KUrl& file)
void InfoSidebarPage::showAnnotations(const KUrl::List& files)
{
- static unsigned int maxShownAnnot = 3; //The maximum number of show annotations when selecting multiple files
if (m_metadata->storageUp()) {
bool hasAnnotation = false;
unsigned int annotateNum = 0;
QString firsts = QString("%1 :
").arg(i18n("Annotations"));
foreach (KUrl file, files) {
- QString annotation = m_metadata->getAnnotation(file);
+ QString annotation = m_metadata->annotation(file);
if (!annotation.isEmpty()) {
hasAnnotation = true;
- if(annotateNum < maxShownAnnot) {
+ if (annotateNum < 3) {
+ // don't show more than 3 annotations
firsts += m_annotationLabel->fontMetrics().elidedText(QString("%1 : %2
").arg(file.fileName()).arg(annotation), Qt::ElideRight, width());//FIXME not really the good method, does not handle resizing ...
annotateNum++;
}
@@ -551,7 +551,10 @@ void InfoSidebarPage::showAnnotations(const KUrl::List& files)
if (hasAnnotation) {
m_annotationLabel->show();
m_annotationLabel->setText(firsts);
- } else m_annotationLabel->hide();
+ }
+ else {
+ m_annotationLabel->hide();
+ }
m_annotationButton->setText(hasAnnotation ? i18n("Change annotations") : i18n("Annotate files"));
}
}
@@ -566,7 +569,7 @@ void InfoSidebarPage::changeAnnotation()
}
else if (files.count() == 1) {
name = files[0].url();
- old = m_metadata->getAnnotation(files[0]);
+ old = m_metadata->annotation(files[0]);
}
else {
name = QString("%1 files").arg(files.count());