summaryrefslogtreecommitdiffstats
path: root/src/bookmarkssettingspage.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-27 00:40:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-04-27 00:40:29 +0000
commit7a741e43ff09e70396a918956219b8316c48e522 (patch)
tree3d0f60eccd59786cea7236db2d5c4c1f25874515 /src/bookmarkssettingspage.cpp
parenta48487ef0c329434b58b6f920111bb0999f1109e (diff)
downloaddolphin-7a741e43ff09e70396a918956219b8316c48e522.tar.gz
dolphin-7a741e43ff09e70396a918956219b8316c48e522.zip
TQt4 port Dolphin
This enables compilation under Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/dolphin@1229359 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/bookmarkssettingspage.cpp')
-rw-r--r--src/bookmarkssettingspage.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/src/bookmarkssettingspage.cpp b/src/bookmarkssettingspage.cpp
index 5b615f8..379f186 100644
--- a/src/bookmarkssettingspage.cpp
+++ b/src/bookmarkssettingspage.cpp
@@ -22,10 +22,10 @@
#include <assert.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qvbox.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqvbox.h>
#include <kbookmark.h>
#include <kbookmarkmanager.h>
@@ -37,70 +37,70 @@
#include "dolphinsettings.h"
#include "editbookmarkdialog.h"
-BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) :
- SettingsPageBase(parent),
+BookmarksSettingsPage::BookmarksSettingsPage(TQWidget*tqparent) :
+ SettingsPageBase(tqparent),
m_addButton(0),
m_removeButton(0),
m_moveUpButton(0),
m_moveDownButton(0)
{
- QVBoxLayout* topLayout = new QVBoxLayout(parent, 2, KDialog::spacingHint());
+ TQVBoxLayout* topLayout = new TQVBoxLayout(tqparent, 2, KDialog::spacingHint());
const int spacing = KDialog::spacingHint();
- QHBox* hBox = new QHBox(parent);
- hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed);
+ TQHBox* hBox = new TQHBox(tqparent);
+ hBox->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed);
hBox->setSpacing(spacing);
- hBox->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Ignored);
+ hBox->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Ignored);
m_listView = new KListView(hBox);
m_listView->addColumn(i18n("Icon"));
m_listView->addColumn(i18n("Name"));
m_listView->addColumn(i18n("Location"));
- m_listView->setResizeMode(QListView::LastColumn);
- m_listView->setColumnAlignment(0, Qt::AlignHCenter);
+ m_listView->setResizeMode(TQListView::LastColumn);
+ m_listView->setColumnAlignment(0, TQt::AlignHCenter);
m_listView->setAllColumnsShowFocus(true);
m_listView->setSorting(-1);
- connect(m_listView, SIGNAL(selectionChanged()),
- this, SLOT(updateButtons()));
- connect(m_listView, SIGNAL(pressed(QListViewItem*)),
- this, SLOT(slotBookmarkPressed(QListViewItem*)));
- connect(m_listView, SIGNAL(doubleClicked(QListViewItem*, const QPoint&, int)),
- this, SLOT(slotBookmarkDoubleClicked(QListViewItem*, const QPoint&, int)));
-
- QVBox* buttonBox = new QVBox(hBox);
+ connect(m_listView, TQT_SIGNAL(selectionChanged()),
+ this, TQT_SLOT(updateButtons()));
+ connect(m_listView, TQT_SIGNAL(pressed(TQListViewItem*)),
+ this, TQT_SLOT(slotBookmarkPressed(TQListViewItem*)));
+ connect(m_listView, TQT_SIGNAL(doubleClicked(TQListViewItem*, const TQPoint&, int)),
+ this, TQT_SLOT(slotBookmarkDoubleClicked(TQListViewItem*, const TQPoint&, int)));
+
+ TQVBox* buttonBox = new TQVBox(hBox);
buttonBox->setSpacing(spacing);
- const QSizePolicy buttonSizePolicy(QSizePolicy::Preferred, QSizePolicy::Maximum);
+ const TQSizePolicy buttonSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Maximum);
m_addButton = new KPushButton(i18n("Add..."), buttonBox);
- connect(m_addButton, SIGNAL(clicked()),
- this, SLOT(slotAddButtonClicked()));
- m_addButton->setSizePolicy(buttonSizePolicy);
+ connect(m_addButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotAddButtonClicked()));
+ m_addButton->tqsetSizePolicy(buttonSizePolicy);
m_editButton = new KPushButton(i18n("Edit..."), buttonBox);
- connect(m_editButton, SIGNAL(clicked()),
- this, SLOT(slotEditButtonClicked()));
- m_editButton->setSizePolicy(buttonSizePolicy);
+ connect(m_editButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotEditButtonClicked()));
+ m_editButton->tqsetSizePolicy(buttonSizePolicy);
m_removeButton = new KPushButton(i18n("Remove"), buttonBox);
- connect(m_removeButton, SIGNAL(clicked()),
- this, SLOT(slotRemoveButtonClicked()));
- m_removeButton->setSizePolicy(buttonSizePolicy);
+ connect(m_removeButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotRemoveButtonClicked()));
+ m_removeButton->tqsetSizePolicy(buttonSizePolicy);
m_moveUpButton = new KPushButton(i18n("Move Up"), buttonBox);
- connect(m_moveUpButton, SIGNAL(clicked()),
- this, SLOT(slotMoveUpButtonClicked()));
- m_moveUpButton->setSizePolicy(buttonSizePolicy);
+ connect(m_moveUpButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotMoveUpButtonClicked()));
+ m_moveUpButton->tqsetSizePolicy(buttonSizePolicy);
m_moveDownButton = new KPushButton(i18n("Move Down"), buttonBox);
- connect(m_moveDownButton, SIGNAL(clicked()),
- this, SLOT(slotMoveDownButtonClicked()));
- m_moveDownButton->setSizePolicy(buttonSizePolicy);
+ connect(m_moveDownButton, TQT_SIGNAL(clicked()),
+ this, TQT_SLOT(slotMoveDownButtonClicked()));
+ m_moveDownButton->tqsetSizePolicy(buttonSizePolicy);
// Add a dummy widget with no restriction regarding a vertical resizing.
// This assures that the spacing between the buttons is not increased.
- new QWidget(buttonBox);
+ new TQWidget(buttonBox);
topLayout->addWidget(hBox);
@@ -108,9 +108,9 @@ BookmarksSettingsPage::BookmarksSettingsPage(QWidget*parent) :
KBookmarkGroup root = DolphinSettings::instance().bookmarkManager()->root();
KBookmark bookmark = root.first();
- QListViewItem* prev = 0;
+ TQListViewItem* prev = 0;
while (!bookmark.isNull()) {
- QListViewItem* item = new QListViewItem(m_listView);
+ TQListViewItem* item = new TQListViewItem(m_listView);
item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
item->setText(NameIdx, bookmark.text());
item->setText(URLIdx, bookmark.url().prettyURL());
@@ -148,7 +148,7 @@ void BookmarksSettingsPage::applySettings()
}
// add all items as bookmarks
- QListViewItem* item = m_listView->firstChild();
+ TQListViewItem* item = m_listView->firstChild();
while (item != 0) {
root.addBookmark(manager,
item->text(NameIdx),
@@ -162,7 +162,7 @@ void BookmarksSettingsPage::applySettings()
void BookmarksSettingsPage::updateButtons()
{
- const QListViewItem* selectedItem = m_listView->selectedItem();
+ const TQListViewItem* selectedItem = m_listView->selectedItem();
const bool hasSelection = (selectedItem != 0);
m_editButton->setEnabled(hasSelection);
@@ -177,14 +177,14 @@ void BookmarksSettingsPage::updateButtons()
m_moveDownButton->setEnabled(enableMoveDown);
}
-void BookmarksSettingsPage::slotBookmarkDoubleClicked(QListViewItem*,
- const QPoint&,
+void BookmarksSettingsPage::slotBookmarkDoubleClicked(TQListViewItem*,
+ const TQPoint&,
int)
{
slotEditButtonClicked();
}
-void BookmarksSettingsPage::slotBookmarkPressed(QListViewItem* item)
+void BookmarksSettingsPage::slotBookmarkPressed(TQListViewItem* item)
{
if (item == 0) {
m_listView->setSelected(m_listView->currentItem(), true);
@@ -199,14 +199,14 @@ void BookmarksSettingsPage::slotAddButtonClicked()
"bookmark");
if (!bookmark.isNull()) {
// insert bookmark into listview
- QListViewItem* item = new QListViewItem(m_listView);
+ TQListViewItem* item = new TQListViewItem(m_listView);
item->setPixmap(PixmapIdx, SmallIcon(bookmark.icon()));
item->setText(NameIdx, bookmark.text());
item->setText(URLIdx, bookmark.url().prettyURL());
item->setText(IconIdx, bookmark.icon());
m_listView->insertItem(item);
- QListViewItem* lastItem = m_listView->lastChild();
+ TQListViewItem* lastItem = m_listView->lastChild();
if (lastItem != 0) {
item->moveItem(lastItem);
}
@@ -218,7 +218,7 @@ void BookmarksSettingsPage::slotAddButtonClicked()
void BookmarksSettingsPage::slotEditButtonClicked()
{
- QListViewItem* item = m_listView->selectedItem();
+ TQListViewItem* item = m_listView->selectedItem();
assert(item != 0); // 'edit' may not get invoked when having no items
KBookmark bookmark = EditBookmarkDialog::getBookmark(i18n("Edit Bookmark"),
@@ -235,9 +235,9 @@ void BookmarksSettingsPage::slotEditButtonClicked()
void BookmarksSettingsPage::slotRemoveButtonClicked()
{
- QListViewItem* selectedItem = m_listView->selectedItem();
+ TQListViewItem* selectedItem = m_listView->selectedItem();
assert(selectedItem != 0);
- QListViewItem* nextItem = selectedItem->itemBelow();
+ TQListViewItem* nextItem = selectedItem->itemBelow();
if (nextItem == 0) {
nextItem = selectedItem->itemAbove();
}
@@ -262,10 +262,10 @@ int BookmarksSettingsPage::selectedBookmarkIndex() const
{
int index = -1;
- QListViewItem* selectedItem = m_listView->selectedItem();
+ TQListViewItem* selectedItem = m_listView->selectedItem();
if (selectedItem != 0) {
index = 0;
- QListViewItem* item = m_listView->firstChild();
+ TQListViewItem* item = m_listView->firstChild();
while (item != selectedItem) {
item = item->nextSibling();
++index;
@@ -282,19 +282,19 @@ void BookmarksSettingsPage::moveBookmark(int direction)
assert((direction >= -1) && (direction <= +1));
// swap bookmarks in listview
- QListViewItem* selectedItem = m_listView->selectedItem();
+ TQListViewItem* selectedItem = m_listView->selectedItem();
assert(selectedItem != 0);
- QListViewItem* item = (direction < 0) ? selectedItem->itemAbove() :
+ TQListViewItem* item = (direction < 0) ? selectedItem->itemAbove() :
selectedItem->itemBelow();
assert(item != 0);
- QPixmap pixmap;
+ TQPixmap pixmap;
if (item->pixmap(0) != 0) {
pixmap = *(item->pixmap(0));
}
- QString name(item->text(NameIdx));
- QString url(item->text(URLIdx));
- QString icon(item->text(IconIdx));
+ TQString name(item->text(NameIdx));
+ TQString url(item->text(URLIdx));
+ TQString icon(item->text(IconIdx));
if (selectedItem->pixmap(0) != 0) {
item->setPixmap(PixmapIdx, *(selectedItem->pixmap(0)));