]> cloud.milkyroute.net Git - dolphin.git/blobdiff - src/bookmarkssettingspage.cpp
Use a QLinkedList instead of Q3PtrList
[dolphin.git] / src / bookmarkssettingspage.cpp
index cab189a48f3c768e5b496fda62b51b6f1918abc2..43aa87c58a1e65b96b826dd4badeed19f57d10c5 100644 (file)
@@ -15,7 +15,7 @@
  *   You should have received a copy of the GNU General Public License     *
  *   along with this program; if not, write to the                         *
  *   Free Software Foundation, Inc.,                                       *
- *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
+ *   51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA            *
  ***************************************************************************/
 
 #include "bookmarkssettingspage.h"
@@ -25,7 +25,7 @@
 #include <qlayout.h>
 #include <qlabel.h>
 #include <qlineedit.h>
-#include <q3vbox.h>
+
 //Added by qt3to4:
 #include <QPixmap>
 #include <Q3VBoxLayout>
@@ -37,6 +37,7 @@
 #include <k3listview.h>
 #include <klocale.h>
 #include <kpushbutton.h>
+#include <kvbox.h>
 
 #include "dolphinsettings.h"
 #include "editbookmarkdialog.h"
@@ -48,11 +49,11 @@ BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) :
     m_moveUpButton(0),
     m_moveDownButton(0)
 {
-    Q3VBoxLayout* topLayout = new Q3VBoxLayout(parent, 2, KDialog::spacingHint());
+    Q3VBoxLayout* topLayout = new Q3VBoxLayout(this, 2, KDialog::spacingHint());
 
     const int spacing = KDialog::spacingHint();
 
-    Q3HBox* hBox = new Q3HBox(parent);
+    KHBox* hBox = new KHBox(this);
     hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
     hBox->setSpacing(spacing);
     hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
@@ -72,7 +73,7 @@ BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) :
     connect(m_listView, SIGNAL(doubleClicked(Q3ListViewItem*, const QPoint&, int)),
             this, SLOT(slotBookmarkDoubleClicked(Q3ListViewItem*, const QPoint&, int)));
 
-    Q3VBox* buttonBox = new Q3VBox(hBox);
+    KVBox* buttonBox = new KVBox(hBox);
     buttonBox->setSpacing(spacing);
 
     const QSizePolicy buttonSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
@@ -117,7 +118,7 @@ BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) :
         Q3ListViewItem* item = new Q3ListViewItem(m_listView);
         item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
         item->setText(NameIdx, bookmark.text());
-        item->setText(URLIdx, bookmark.url().prettyUrl());
+        item->setText(UrlIdx, bookmark.url().prettyUrl());
 
         // add hidden column to be able to retrieve the icon name again
         item->setText(IconIdx, bookmark.icon());
@@ -156,7 +157,7 @@ void BookmarksSettingsPage::applySettings()
     while (item != 0) {
         root.addBookmark(manager,
                          item->text(NameIdx),
-                         KUrl(item->text(URLIdx)),
+                         KUrl(item->text(UrlIdx)),
                          item->text(IconIdx)); // hidden column
         item = item->itemBelow();
     }
@@ -206,7 +207,7 @@ void BookmarksSettingsPage::slotAddButtonClicked()
         Q3ListViewItem* item = new Q3ListViewItem(m_listView);
         item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
         item->setText(NameIdx, bookmark.text());
-        item->setText(URLIdx, bookmark.url().prettyUrl());
+        item->setText(UrlIdx, bookmark.url().prettyUrl());
         item->setText(IconIdx, bookmark.icon());
         m_listView->insertItem(item);
 
@@ -227,12 +228,12 @@ void BookmarksSettingsPage::slotEditButtonClicked()
 
     KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Edit Bookmark"),
                                                          item->text(NameIdx),
-                                                         KUrl(item->text(URLIdx)),
+                                                         KUrl(item->text(UrlIdx)),
                                                          item->text(IconIdx));
     if (!bookmark.isNull()) {
         item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
         item->setText(NameIdx, bookmark.text());
-        item->setText(URLIdx, bookmark.url().prettyUrl());
+        item->setText(UrlIdx, bookmark.url().prettyUrl());
         item->setText(IconIdx, bookmark.icon());
     }
 }
@@ -297,19 +298,19 @@ void BookmarksSettingsPage::moveBookmark(int direction)
         pixmap = *(item->pixmap(0));
     }
     QString name(item->text(NameIdx));
-    QString url(item->text(URLIdx));
+    QString url(item->text(UrlIdx));
     QString icon(item->text(IconIdx));
 
     if (selectedItem->pixmap(0) != 0) {
         item->setPixmap(PixmapIdx, *(selectedItem->pixmap(0)));
     }
     item->setText(NameIdx, selectedItem->text(NameIdx));
-    item->setText(URLIdx, selectedItem->text(URLIdx));
+    item->setText(UrlIdx, selectedItem->text(UrlIdx));
     item->setText(IconIdx, selectedItem->text(IconIdx));
 
     selectedItem->setPixmap(PixmapIdx, pixmap);
     selectedItem->setText(NameIdx, name);
-    selectedItem->setText(URLIdx, url);
+    selectedItem->setText(UrlIdx, url);
     selectedItem->setText(IconIdx, icon);
 
     m_listView->setSelected(item, true);