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

List:       kde-commits
Subject:    kdevelop/parts/bookmarks
From:       Jens Dagerbo <jens.dagerbo () swipnet ! se>
Date:       2004-03-12 1:04:56
Message-ID: 20040312010456.AC49299A8 () office ! kde ! org
[Download RAW message or body]

CVS commit by dagerbo: 

Added collapse/expand all


  M +27 -1     bookmarks_widget.cpp   1.9
  M +2 -0      bookmarks_widget.h   1.6


--- kdevelop/parts/bookmarks/bookmarks_widget.cpp  #1.8:1.9
@@ -122,5 +122,5 @@ public:
                 else
                 {
-                        return _url.path();
+                        return _url.prettyURL();
                 }
         }
@@ -276,4 +276,10 @@ void BookmarksWidget::popupMenu( QListVi
                         popup.insertItem( i18n("Remove These Bookmarks"), this, \
SLOT( doEmitRemoveBookMark() ) );  }
+                
+                popup.insertSeparator();
+                
+                popup.insertItem( i18n( "Collapse All" ), this, SLOT(collapseAll()) \
); +                popup.insertItem( i18n( "Expand All" ), this, SLOT(expandAll()) \
); +                
                 popup.exec(p);
         }
@@ -303,4 +309,24 @@ QStringList BookmarksWidget::getContext(
 }
 
+void BookmarksWidget::collapseAll( )
+{
+        QListViewItem * it = firstChild();
+        while( it )
+        {
+                it->setOpen( false );
+                it = it->nextSibling();
+        }
+}
+
+void BookmarksWidget::expandAll( )
+{
+        QListViewItem * it = firstChild();
+        while( it )
+        {
+                it->setOpen( true );
+                it = it->nextSibling();
+        }
+}
+
 
 #include "bookmarks_widget.moc"

--- kdevelop/parts/bookmarks/bookmarks_widget.h  #1.5:1.6
@@ -52,4 +52,6 @@ private slots:
         void itemClicked( QListViewItem * );
         void popupMenu( QListViewItem * , const QPoint & , int );
+        void collapseAll();
+        void expandAll();
         void doEmitRemoveBookMark();
 


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

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