summaryrefslogtreecommitdiffstats
path: root/src/bookmarkssidebarpage.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/bookmarkssidebarpage.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/bookmarkssidebarpage.cpp')
-rw-r--r--src/bookmarkssidebarpage.cpp84
1 files changed, 42 insertions, 42 deletions
diff --git a/src/bookmarkssidebarpage.cpp b/src/bookmarkssidebarpage.cpp
index 4c32540..7ffa321 100644
--- a/src/bookmarkssidebarpage.cpp
+++ b/src/bookmarkssidebarpage.cpp
@@ -19,11 +19,11 @@
#include "bookmarkssidebarpage.h"
-#include <qlistbox.h>
-#include <qlayout.h>
-#include <qpainter.h>
+#include <tqlistbox.h>
+#include <tqlayout.h>
+#include <tqpainter.h>
#include <assert.h>
-#include <qpopupmenu.h>
+#include <tqpopupmenu.h>
#include <kbookmarkmanager.h>
#include <kmessagebox.h>
@@ -35,22 +35,22 @@
#include "dolphinview.h"
#include "editbookmarkdialog.h"
-BookmarksSidebarPage::BookmarksSidebarPage(QWidget* parent) :
- SidebarPage(parent)
+BookmarksSidebarPage::BookmarksSidebarPage(TQWidget* tqparent) :
+ SidebarPage(tqparent)
{
- QVBoxLayout* layout = new QVBoxLayout(this);
+ TQVBoxLayout* tqlayout = new TQVBoxLayout(this);
m_bookmarksList = new BookmarksListBox(this);
- m_bookmarksList->setPaletteBackgroundColor(colorGroup().background());
+ m_bookmarksList->setPaletteBackgroundColor(tqcolorGroup().background());
- layout->addWidget(m_bookmarksList);
- connect(m_bookmarksList, SIGNAL(mouseButtonClicked(int, QListBoxItem*, const QPoint&)),
- this, SLOT(slotMouseButtonClicked(int, QListBoxItem*)));
- connect(m_bookmarksList, SIGNAL(contextMenuRequested(QListBoxItem*, const QPoint&)),
- this, SLOT(slotContextMenuRequested(QListBoxItem*, const QPoint&)));
+ tqlayout->addWidget(m_bookmarksList);
+ connect(m_bookmarksList, TQT_SIGNAL(mouseButtonClicked(int, TQListBoxItem*, const TQPoint&)),
+ this, TQT_SLOT(slotMouseButtonClicked(int, TQListBoxItem*)));
+ connect(m_bookmarksList, TQT_SIGNAL(contextMenuRequested(TQListBoxItem*, const TQPoint&)),
+ this, TQT_SLOT(slotContextMenuRequested(TQListBoxItem*, const TQPoint&)));
KBookmarkManager* manager = DolphinSettings::instance().bookmarkManager();
- connect(manager, SIGNAL(changed(const QString&, const QString&)),
- this, SLOT(updateBookmarks()));
+ connect(manager, TQT_SIGNAL(changed(const TQString&, const TQString&)),
+ this, TQT_SLOT(updateBookmarks()));
updateBookmarks();
}
@@ -81,7 +81,7 @@ void BookmarksSidebarPage::updateBookmarks()
connectToActiveView();
}
-void BookmarksSidebarPage::slotMouseButtonClicked(int button, QListBoxItem* item)
+void BookmarksSidebarPage::slotMouseButtonClicked(int button, TQListBoxItem* item)
{
if ((button != Qt::LeftButton) || (item == 0)) {
return;
@@ -92,15 +92,15 @@ void BookmarksSidebarPage::slotMouseButtonClicked(int button, QListBoxItem* item
Dolphin::mainWin().activeView()->setURL(bookmark.url());
}
-void BookmarksSidebarPage::slotContextMenuRequested(QListBoxItem* item,
- const QPoint& pos)
+void BookmarksSidebarPage::slotContextMenuRequested(TQListBoxItem* item,
+ const TQPoint& pos)
{
const int insertID = 1;
const int editID = 2;
const int deleteID = 3;
const int addID = 4;
- QPopupMenu* popup = new QPopupMenu();
+ TQPopupMenu* popup = new TQPopupMenu();
if (item == 0) {
popup->insertItem(SmallIcon("filenew"), i18n("Add Bookmark..."), addID);
}
@@ -194,8 +194,8 @@ void BookmarksSidebarPage::adjustSelection(const KURL& url)
int maxLength = 0;
int selectedIndex = -1;
- // Search the bookmark which is equal to the URL or at least is a parent URL.
- // If there are more than one possible parent URL candidates, choose the bookmark
+ // Search the bookmark which is equal to the URL or at least is a tqparent URL.
+ // If there are more than one possible tqparent URL candidates, choose the bookmark
// which covers the bigger range of the URL.
int i = 0;
while (!bookmark.isNull()) {
@@ -234,12 +234,12 @@ void BookmarksSidebarPage::connectToActiveView()
{
DolphinView* view = Dolphin::mainWin().activeView();
adjustSelection(view->url());
- connect(view, SIGNAL(signalURLChanged(const KURL&)),
- this, SLOT(slotURLChanged(const KURL&)));
+ connect(view, TQT_SIGNAL(signalURLChanged(const KURL&)),
+ this, TQT_SLOT(slotURLChanged(const KURL&)));
}
-BookmarksListBox::BookmarksListBox(QWidget* parent) :
- QListBox(parent)
+BookmarksListBox::BookmarksListBox(TQWidget* tqparent) :
+ TQListBox(tqparent)
{
setAcceptDrops(true);
}
@@ -247,32 +247,32 @@ BookmarksListBox::~BookmarksListBox()
{
}
-void BookmarksListBox::paintEvent(QPaintEvent* /* event */)
+void BookmarksListBox::paintEvent(TQPaintEvent* /* event */)
{
- // don't invoke QListBox::paintEvent(event) to prevent
+ // don't invoke TQListBox::paintEvent(event) to prevent
// that any kind of frame is drawn
}
-void BookmarksListBox::contentsMousePressEvent(QMouseEvent *event)
+void BookmarksListBox::contentsMousePressEvent(TQMouseEvent *event)
{
- if (event->button() == LeftButton)
+ if (event->button() == Qt::LeftButton)
dragPos = event->pos();
- QListBox::contentsMousePressEvent(event);
+ TQListBox::contentsMousePressEvent(event);
}
-void BookmarksListBox::contentsMouseMoveEvent(QMouseEvent *event)
+void BookmarksListBox::contentsMouseMoveEvent(TQMouseEvent *event)
{
- if (event->state() & LeftButton) {
+ if (event->state() & Qt::LeftButton) {
int distance = (event->pos() - dragPos).manhattanLength();
- if (distance > QApplication::startDragDistance())
+ if (distance > TQApplication::startDragDistance())
startDrag();
}
- QListBox::contentsMouseMoveEvent(event);
+ TQListBox::contentsMouseMoveEvent(event);
}
void BookmarksListBox::startDrag()
{
- int currentItem = QListBox::currentItem();
+ int currentItem = TQListBox::currentItem();
if (currentItem != -1) {
BookmarkItem* bookmark = (BookmarkItem*)item(currentItem);
if (bookmark!=0){
@@ -284,12 +284,12 @@ void BookmarksListBox::startDrag()
}
}
-void BookmarksListBox::dragEnterEvent( QDragEnterEvent *event )
+void BookmarksListBox::dragEnterEvent( TQDragEnterEvent *event )
{
event->accept(KURLDrag::canDecode(event));
}
-void BookmarksListBox::dropEvent( QDropEvent *event )
+void BookmarksListBox::dropEvent( TQDropEvent *event )
{
KURL::List urls;
if (KURLDrag::decode(event, urls) && !urls.isEmpty()) {
@@ -304,8 +304,8 @@ void BookmarksListBox::dropEvent( QDropEvent *event )
}
}
-BookmarkItem::BookmarkItem(const QPixmap& pixmap, const QString& text, const KURL& url) :
- QListBoxPixmap(pixmap, text),
+BookmarkItem::BookmarkItem(const TQPixmap& pixmap, const TQString& text, const KURL& url) :
+ TQListBoxPixmap(pixmap, text),
m_url(url)
{
}
@@ -314,9 +314,9 @@ BookmarkItem::~BookmarkItem()
{
}
-int BookmarkItem::height(const QListBox* listBox) const
+int BookmarkItem::height(const TQListBox* listBox) const
{
- return QListBoxPixmap::height(listBox) + 8;
+ return TQListBoxPixmap::height(listBox) + 8;
}
const KURL& BookmarkItem::url() const
@@ -326,7 +326,7 @@ const KURL& BookmarkItem::url() const
BookmarkItem* BookmarkItem::fromKbookmark(const KBookmark& bookmark, const KIconLoader& iconLoader)
{
- QPixmap icon(iconLoader.loadIcon(bookmark.icon(), KIcon::NoGroup, KIcon::SizeMedium));
+ TQPixmap icon(iconLoader.loadIcon(bookmark.icon(), KIcon::NoGroup, KIcon::SizeMedium));
return new BookmarkItem(icon, bookmark.text(), bookmark.url());
}