┌   ┐
54
└   ┘

summaryrefslogtreecommitdiff
path: root/src/infosidebarpage.cpp
diff options
context:
space:
mode:
authorPeter Penz <[email protected]>2007-03-14 21:11:48 +0000
committerPeter Penz <[email protected]>2007-03-14 21:11:48 +0000
commit8a7f84326d6d454a207247757d00c04d4c9f27c1 (patch)
treeaa68e42cda3dec886c2809b492ce1da70f4defbf /src/infosidebarpage.cpp
parent4dcb9b7a487ff1280fa4fd7a0d6566331ba31637 (diff)
Fixed some minor coding guidelines issues (getFoo() -> foo(), ...) to be aligned with the kdelibs coding style (http://techbase.kde.org/Policies/Kdelibs_Coding_Style). The infosidebar code will be rewritten anyway, but copy/paste often is faster than light ;-)
svn path=/trunk/KDE/kdebase/apps/; revision=642613
Diffstat (limited to 'src/infosidebarpage.cpp')
-rw-r--r--src/infosidebarpage.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/infosidebarpage.cpp b/src/infosidebarpage.cpp
index 185ba7b8e..61a7b0643 100644
--- a/src/infosidebarpage.cpp
+++ b/src/infosidebarpage.cpp
@@ -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("<b>%1</b> :<br/>%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("<b>%1 :</b><br/>").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("<b>%1</b> : %2<br/>").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());