[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdebase/konqueror/keditbookmarks
From:       Alexander Kellett <lypanov () kde ! org>
Date:       2003-10-18 10:48:54
[Download RAW message or body]

CVS commit by lypanov: 

fillin the missing bookmarkinfo fields


  M +12 -3     bookmarkinfo.cpp   1.5
  M +12 -5     commands.cpp   1.85
  M +1 -1      commands.h   1.40


--- kdebase/konqueror/keditbookmarks/bookmarkinfo.cpp  #1.4:1.5
@@ -20,4 +20,5 @@
 
 #include "bookmarkinfo.h"
+#include "commands.h"
 
 #include <stdlib.h>
@@ -49,7 +50,15 @@ void BookmarkInfoWidget::showBookmark(co
     m_title_le->setText(bk.text());
     m_url_le->setText(bk.url().url());
-    m_comment_le->setText("a comment");
-    m_moddate_le->setText("the modification date");
-    m_credate_le->setText("the creation date");
+
+    m_comment_le->setText(
+            NodeEditCommand::getNodeText(bk, QStringList() << "desc"));
+    m_moddate_le->setText(
+            NodeEditCommand::getNodeText(bk, QStringList() << "info"
+                                                           << "metadata"
+                                                           << "time_added" ));
+    m_credate_le->setText(
+            NodeEditCommand::getNodeText(bk, QStringList() << "info" 
+                                                           << "metadata"
+                                                           << "time_added" ));
 }
 

--- kdebase/konqueror/keditbookmarks/commands.cpp  #1.84:1.85
@@ -172,7 +172,14 @@ QString NodeEditCommand::name() const {
 }
 
-QString NodeEditCommand::getNodeText(KBookmark bk, const QString &nodename) {
-    QDomNode subnode = bk.internalElement().namedItem(nodename);
-    return subnode.isNull() || subnode.firstChild().isNull() 
+QString NodeEditCommand::getNodeText(KBookmark bk, const QStringList &nodehier) {
+    QDomNode subnode = bk.internalElement();
+    for (QStringList::ConstIterator it = nodehier.begin(); 
+            it != nodehier.end(); ++it)
+    {
+        subnode = subnode.namedItem((*it));
+        if (subnode.isNull())
+            return QString::null;
+    }
+    return (subnode.firstChild().isNull())
         ? QString::null
         : subnode.firstChild().toText().data();

--- kdebase/konqueror/keditbookmarks/commands.h  #1.39:1.40
@@ -124,5 +124,5 @@ public:
    virtual void unexecute();
    virtual QString name() const;
-   static QString getNodeText(KBookmark, const QString &);
+   static QString getNodeText(KBookmark bk, const QStringList &nodehier);
 private:
    QString m_address;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic