]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Fixed some minor coding guidelines issues (getFoo() -> foo(), ...) to be aligned...
authorPeter Penz <peter.penz19@gmail.com>
Wed, 14 Mar 2007 21:11:48 +0000 (21:11 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Wed, 14 Mar 2007 21:11:48 +0000 (21:11 +0000)
svn path=/trunk/KDE/kdebase/apps/; revision=642613

src/infosidebarpage.cpp
src/metadataloader.cpp
src/metadataloader.h

index 185ba7b8e0294a8d06b8f2b81ebba83f2fbc4f33..61a7b06438560694b2a6a3f377d2b6c6a7a95a4a 100644 (file)
@@ -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());
index 9b6ebc4fcda9dd4f385036f906f35b9c9f1ecf0c..2914720a8c0534c597b244710584ede0b044a542 100644 (file)
@@ -35,7 +35,8 @@ MetadataLoader::MetadataLoader()
     if (Nepomuk::KMetaData::ResourceManager::instance()->init()) {
         m_up = false;
         Nepomuk::KMetaData::ResourceManager::instance()->setAutoSync(false);
-    } else {
+    }
+    else {
         m_up = true;
     }
 #else
@@ -51,7 +52,7 @@ bool MetadataLoader::storageUp() {
     return m_up;
 }
 
-QString MetadataLoader::getAnnotation(const KUrl& file)
+QString MetadataLoader::annotation(const KUrl& file)
 {
 #ifdef HAVE_KMETADATA
     if(m_up)
@@ -64,8 +65,9 @@ QString MetadataLoader::getAnnotation(const KUrl& file)
 void MetadataLoader::setAnnotation(const KUrl& file, const QString& annotation)
 {
 #ifdef HAVE_KMETADATA
-    if(m_up)
+    if (m_up) {
         Nepomuk::KMetaData::File(file.url()).setComment(annotation);
+    }
 #endif
 }
 
index 98cf7187a95eebca30b657a944ed8079949adff5..5bc2686ce8cc9dddb1cb8e985848da379932e9d1 100644 (file)
 #ifndef METADATALOADER_H
 #define METADATALOADER_H
 
-namespace Nempomuk {
-namespace Backbone {
-    class Registry;
-}
-}
 class KUrl;
 class QString;
 
@@ -39,15 +34,15 @@ class MetadataLoader
 {
 friend class DolphinApplication;
 public:
-        ~MetadataLoader();
-        bool storageUp();
+    ~MetadataLoader();
+    bool storageUp();
 
-        QString getAnnotation(const KUrl& file);
-        void setAnnotation(const KUrl& file, const QString& annotation);
+    QString annotation(const KUrl& file);
+    void setAnnotation(const KUrl& file, const QString& annotation);
 
 private:
-        MetadataLoader();
-        bool m_up;
+    MetadataLoader();
+    bool m_up;
 };