Rename all the URL navigator related classes to prepare their migration

in kdelibs.

svn path=/trunk/KDE/kdebase/apps/; revision=649514
This commit is contained in:
Kevin Ottens 2007-04-02 19:20:07 +00:00
parent 78c312a0f3
commit 03713b0ab4
14 changed files with 186 additions and 181 deletions

View file

@ -40,7 +40,7 @@ set(dolphin_SRCS
kfileplacesmodel.cpp kfileplacesmodel.cpp
kfileplacesitem.cpp kfileplacesitem.cpp
kfileplacesview.cpp kfileplacesview.cpp
bookmarkselector.cpp kfileplacesselector.cpp
bookmarkssettingspage.cpp bookmarkssettingspage.cpp
bookmarkssidebarpage.cpp bookmarkssidebarpage.cpp
columnviewsettingspage.cpp columnviewsettingspage.cpp
@ -63,7 +63,7 @@ set(dolphin_SRCS
infosidebarpage.cpp infosidebarpage.cpp
main.cpp main.cpp
metadatawidget.cpp metadatawidget.cpp
protocolcombo.cpp kprotocolcombo.cpp
pixmapviewer.cpp pixmapviewer.cpp
renamedialog.cpp renamedialog.cpp
settingspagebase.cpp settingspagebase.cpp
@ -73,9 +73,9 @@ set(dolphin_SRCS
treeviewcontextmenu.cpp treeviewcontextmenu.cpp
treeviewsidebarpage.cpp treeviewsidebarpage.cpp
sidebartreeview.cpp sidebartreeview.cpp
urlbutton.cpp kurlbutton.cpp
urlnavigator.cpp kurlnavigator.cpp
urlnavigatorbutton.cpp kurlnavigatorbutton.cpp
viewpropertiesdialog.cpp viewpropertiesdialog.cpp
viewsettingspage.cpp viewsettingspage.cpp
viewpropsprogressinfo.cpp ) viewpropsprogressinfo.cpp )

View file

@ -32,7 +32,7 @@
#include "metadatawidget.h" #include "metadatawidget.h"
#include "mainwindowadaptor.h" #include "mainwindowadaptor.h"
#include "treeviewsidebarpage.h" #include "treeviewsidebarpage.h"
#include "urlnavigator.h" #include "kurlnavigator.h"
#include "viewpropertiesdialog.h" #include "viewpropertiesdialog.h"
#include "viewproperties.h" #include "viewproperties.h"
#include "kfileplacesmodel.h" #include "kfileplacesmodel.h"
@ -1506,7 +1506,7 @@ void DolphinMainWindow::connectViewSignals(int viewIndex)
connect(view, SIGNAL(urlChanged(KUrl)), connect(view, SIGNAL(urlChanged(KUrl)),
this, SLOT(changeUrl(KUrl))); this, SLOT(changeUrl(KUrl)));
const UrlNavigator* navigator = view->urlNavigator(); const KUrlNavigator* navigator = view->urlNavigator();
connect(navigator, SIGNAL(urlChanged(const KUrl&)), connect(navigator, SIGNAL(urlChanged(const KUrl&)),
this, SLOT(changeUrl(const KUrl&))); this, SLOT(changeUrl(const KUrl&)));
connect(navigator, SIGNAL(historyChanged()), connect(navigator, SIGNAL(historyChanged()),

View file

@ -53,7 +53,7 @@
#include "dolphincontextmenu.h" #include "dolphincontextmenu.h"
#include "filterbar.h" #include "filterbar.h"
#include "renamedialog.h" #include "renamedialog.h"
#include "urlnavigator.h" #include "kurlnavigator.h"
#include "viewproperties.h" #include "viewproperties.h"
#include "dolphinsettings.h" #include "dolphinsettings.h"
#include "dolphin_generalsettings.h" #include "dolphin_generalsettings.h"
@ -97,7 +97,7 @@ DolphinView::DolphinView(DolphinMainWindow* mainWindow,
connect(clipboard, SIGNAL(dataChanged()), connect(clipboard, SIGNAL(dataChanged()),
this, SLOT(updateCutItems())); this, SLOT(updateCutItems()));
m_urlNavigator = new UrlNavigator(new KFilePlacesModel(this), url, this); m_urlNavigator = new KUrlNavigator(new KFilePlacesModel(this), url, this);
m_urlNavigator->setUrlEditable(DolphinSettings::instance().generalSettings()->editableUrl()); m_urlNavigator->setUrlEditable(DolphinSettings::instance().generalSettings()->editableUrl());
m_urlNavigator->setHomeUrl(DolphinSettings::instance().generalSettings()->homeUrl()); m_urlNavigator->setHomeUrl(DolphinSettings::instance().generalSettings()->homeUrl());
m_urlNavigator->setShowHiddenFiles(showHiddenFiles); m_urlNavigator->setShowHiddenFiles(showHiddenFiles);

View file

@ -27,7 +27,7 @@
#include <kfileitemdelegate.h> #include <kfileitemdelegate.h>
#include <kio/job.h> #include <kio/job.h>
#include <urlnavigator.h> #include <kurlnavigator.h>
#include <QDropEvent> #include <QDropEvent>
#include <QLinkedList> #include <QLinkedList>
@ -41,7 +41,7 @@ class FilterBar;
class KFileItemDelegate; class KFileItemDelegate;
class KUrl; class KUrl;
class KDirModel; class KDirModel;
class UrlNavigator; class KUrlNavigator;
class DolphinColumnView; class DolphinColumnView;
class DolphinDetailsView; class DolphinDetailsView;
class DolphinDirLister; class DolphinDirLister;
@ -64,7 +64,7 @@ class ViewProperties;
* @see DolphinIconsView * @see DolphinIconsView
* @see DolphinDetailsView * @see DolphinDetailsView
* @see DolphinColumnView * @see DolphinColumnView
* @see UrlNavigator * @see KUrlNavigator
* @see DolphinStatusBar * @see DolphinStatusBar
*/ */
class DolphinView : public QWidget class DolphinView : public QWidget
@ -121,7 +121,7 @@ public:
/** /**
* Sets the current active URL. * Sets the current active URL.
* The signals UrlNavigator::urlChanged() and UrlNavigator::historyChanged() * The signals KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are emitted. * are emitted.
*/ */
void setUrl(const KUrl& url); void setUrl(const KUrl& url);
@ -185,28 +185,28 @@ public:
/** /**
* Goes back one step in the URL history. The signals * Goes back one step in the URL history. The signals
* UrlNavigator::urlChanged() and UrlNavigator::historyChanged() * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are submitted. * are submitted.
*/ */
void goBack(); void goBack();
/** /**
* Goes forward one step in the Url history. The signals * Goes forward one step in the Url history. The signals
* UrlNavigator::urlChanged() and UrlNavigator::historyChanged() * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are submitted. * are submitted.
*/ */
void goForward(); void goForward();
/** /**
* Goes up one step of the Url path. The signals * Goes up one step of the Url path. The signals
* UrlNavigator::urlChanged() and UrlNavigator::historyChanged() * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are submitted. * are submitted.
*/ */
void goUp(); void goUp();
/** /**
* Goes to the home URL. The signals UrlNavigator::urlChanged() * Goes to the home URL. The signals KUrlNavigator::urlChanged()
* and UrlNavigator::historyChanged() are submitted. * and KUrlNavigator::historyChanged() are submitted.
*/ */
void goHome(); void goHome();
@ -266,7 +266,7 @@ public:
/** /**
* Returns true, if the URL shown by the navigation bar is editable. * Returns true, if the URL shown by the navigation bar is editable.
* @see UrlNavigator * @see KUrlNavigator
*/ */
bool isUrlEditable() const; bool isUrlEditable() const;
@ -306,8 +306,8 @@ public:
/** Returns the additional information which should be shown for the items. */ /** Returns the additional information which should be shown for the items. */
KFileItemDelegate::AdditionalInformation additionalInfo() const; KFileItemDelegate::AdditionalInformation additionalInfo() const;
/** Returns the UrlNavigator of the view for read access. */ /** Returns the KUrlNavigator of the view for read access. */
const UrlNavigator* urlNavigator() const { return m_urlNavigator; } const KUrlNavigator* urlNavigator() const { return m_urlNavigator; }
/** /**
* Triggers to request user information for the item given * Triggers to request user information for the item given
@ -572,7 +572,7 @@ private:
DolphinMainWindow* m_mainWindow; DolphinMainWindow* m_mainWindow;
QVBoxLayout* m_topLayout; QVBoxLayout* m_topLayout;
UrlNavigator* m_urlNavigator; KUrlNavigator* m_urlNavigator;
DolphinController* m_controller; DolphinController* m_controller;
DolphinIconsView* m_iconsView; DolphinIconsView* m_iconsView;

View file

@ -1,5 +1,6 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) *
* Copyright (C) 2007 by Kevin Ottens (ervin@kde.org) *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -17,9 +18,9 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#include "bookmarkselector.h" #include "kfileplacesselector_p.h"
#include "urlnavigator.h" #include "kurlnavigator.h"
#include <assert.h> #include <assert.h>
@ -33,8 +34,8 @@
#include <QPixmap> #include <QPixmap>
#include <kicon.h> #include <kicon.h>
BookmarkSelector::BookmarkSelector(UrlNavigator* parent, KFilePlacesModel* placesModel) : KFilePlacesSelector::KFilePlacesSelector(KUrlNavigator* parent, KFilePlacesModel* placesModel) :
UrlButton(parent), KUrlButton(parent),
m_selectedItem(-1), m_selectedItem(-1),
m_urlNavigator(parent), m_urlNavigator(parent),
m_placesModel(placesModel) m_placesModel(placesModel)
@ -55,11 +56,11 @@ BookmarkSelector::BookmarkSelector(UrlNavigator* parent, KFilePlacesModel* place
setMenu(m_placesMenu); setMenu(m_placesMenu);
} }
BookmarkSelector::~BookmarkSelector() KFilePlacesSelector::~KFilePlacesSelector()
{ {
} }
void BookmarkSelector::updateMenu() void KFilePlacesSelector::updateMenu()
{ {
m_placesMenu->clear(); m_placesMenu->clear();
@ -81,7 +82,7 @@ void BookmarkSelector::updateMenu()
} }
} }
void BookmarkSelector::updateSelection(const KUrl& url) void KFilePlacesSelector::updateSelection(const KUrl& url)
{ {
QModelIndex index = m_placesModel->closestItem(url); QModelIndex index = m_placesModel->closestItem(url);
@ -97,7 +98,7 @@ void BookmarkSelector::updateSelection(const KUrl& url)
} }
} }
KUrl BookmarkSelector::selectedPlaceUrl() const KUrl KFilePlacesSelector::selectedPlaceUrl() const
{ {
QModelIndex index = m_placesModel->index(m_selectedItem, 0); QModelIndex index = m_placesModel->index(m_selectedItem, 0);
@ -107,7 +108,7 @@ KUrl BookmarkSelector::selectedPlaceUrl() const
return KUrl(); return KUrl();
} }
QString BookmarkSelector::selectedPlaceText() const QString KFilePlacesSelector::selectedPlaceText() const
{ {
QModelIndex index = m_placesModel->index(m_selectedItem, 0); QModelIndex index = m_placesModel->index(m_selectedItem, 0);
@ -117,13 +118,13 @@ QString BookmarkSelector::selectedPlaceText() const
return QString(); return QString();
} }
QSize BookmarkSelector::sizeHint() const QSize KFilePlacesSelector::sizeHint() const
{ {
const int height = UrlButton::sizeHint().height(); const int height = KUrlButton::sizeHint().height();
return QSize(height, height); return QSize(height, height);
} }
void BookmarkSelector::paintEvent(QPaintEvent* /*event*/) void KFilePlacesSelector::paintEvent(QPaintEvent* /*event*/)
{ {
QPainter painter(this); QPainter painter(this);
@ -171,7 +172,7 @@ void BookmarkSelector::paintEvent(QPaintEvent* /*event*/)
painter.drawPixmap(x, y, pixmap); painter.drawPixmap(x, y, pixmap);
} }
void BookmarkSelector::activatePlace(QAction* action) void KFilePlacesSelector::activatePlace(QAction* action)
{ {
assert(action != 0); assert(action != 0);
m_selectedItem = action->data().toInt(); m_selectedItem = action->data().toInt();
@ -184,5 +185,5 @@ void BookmarkSelector::activatePlace(QAction* action)
} }
} }
#include "bookmarkselector.moc" #include "kfileplacesselector_p.moc"

View file

@ -1,5 +1,6 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) * * Copyright (C) 2006 by Peter Penz (peter.penz@gmx.at) *
* Copyright (C) 2007 by Kevin Ottens (ervin@kde.org) *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -17,14 +18,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#ifndef BOOKMARKSELECTOR_H #ifndef KFILEPLACESSELECTOR_P_H
#define BOOKMARKSELECTOR_H #define KFILEPLACESSELECTOR_P_H
#include <urlbutton.h> #include "kurlbutton_p.h"
#include <kurl.h> #include <kurl.h>
class KFilePlacesModel; class KFilePlacesModel;
class UrlNavigator; class KUrlNavigator;
class KMenu; class KMenu;
/** /**
@ -35,7 +36,7 @@ class KMenu;
* *
* @see UrlNavigator * @see UrlNavigator
*/ */
class BookmarkSelector : public UrlButton class KFilePlacesSelector : public KUrlButton
{ {
Q_OBJECT Q_OBJECT
@ -44,9 +45,9 @@ public:
* @param parent Parent widget where the bookmark selector * @param parent Parent widget where the bookmark selector
* is embedded into. * is embedded into.
*/ */
BookmarkSelector(UrlNavigator* parent, KFilePlacesModel* placesModel); KFilePlacesSelector(KUrlNavigator* parent, KFilePlacesModel* placesModel);
virtual ~BookmarkSelector(); virtual ~KFilePlacesSelector();
/** /**
* Updates the selection dependent from the given URL \a url. The * Updates the selection dependent from the given URL \a url. The
@ -90,7 +91,7 @@ private slots:
private: private:
int m_selectedItem; int m_selectedItem;
UrlNavigator* m_urlNavigator; KUrlNavigator* m_urlNavigator;
KMenu* m_placesMenu; KMenu* m_placesMenu;
KFilePlacesModel* m_placesModel; KFilePlacesModel* m_placesModel;
}; };

View file

@ -23,12 +23,12 @@
#include <kprotocolinfo.h> #include <kprotocolinfo.h>
#include <kprotocolmanager.h> #include <kprotocolmanager.h>
#include "protocolcombo.h" #include "kprotocolcombo_p.h"
const static int customProtocolIndex = 0; const static int customProtocolIndex = 0;
ProtocolCombo::ProtocolCombo(const QString& protocol, UrlNavigator* parent) KProtocolCombo::KProtocolCombo(const QString& protocol, KUrlNavigator* parent)
: UrlNavigatorButton(-1, parent), : KUrlNavigatorButton(-1, parent),
m_protocols(KProtocolInfo::protocols()) m_protocols(KProtocolInfo::protocols())
{ {
qSort(m_protocols); qSort(m_protocols);
@ -80,7 +80,7 @@ ProtocolCombo::ProtocolCombo(const QString& protocol, UrlNavigator* parent)
// #include <kurl.h> // #include <kurl.h>
// #include "urlnavigator.h" // #include "urlnavigator.h"
void ProtocolCombo::setProtocol(const QString& protocol) void KProtocolCombo::setProtocol(const QString& protocol)
{ {
setText(protocol); setText(protocol);
// if (KProtocolInfo::isKnownProtocol(protocol)) // if (KProtocolInfo::isKnownProtocol(protocol))
@ -96,7 +96,7 @@ void ProtocolCombo::setProtocol(const QString& protocol)
// } // }
} }
void ProtocolCombo::setProtocol(int index) void KProtocolCombo::setProtocol(int index)
{ {
if (index < 0 || index > m_protocols.count()) if (index < 0 || index > m_protocols.count())
{ {
@ -110,9 +110,9 @@ kDebug() << "setProtocol " << index << " " << protocol << endl;
/* */ /* */
} }
QString ProtocolCombo::currentProtocol() const QString KProtocolCombo::currentProtocol() const
{ {
return text(); //currentText(); return text(); //currentText();
} }
#include "protocolcombo.moc" #include "kprotocolcombo_p.moc"

View file

@ -16,22 +16,22 @@
* Free Software Foundation, Inc., * * Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#ifndef PROTOCOLCOMBO_H #ifndef KPROTOCOLCOMBO_P_H
#define PROTOCOLCOMBO_H #define KPROTOCOLCOMBO_P_H
#include "urlnavigatorbutton.h" #include "kurlnavigatorbutton_p.h"
class UrlNavigator; class KUrlNavigator;
/** /**
* A combobox listing available protocols * A combobox listing available protocols
*/ */
class ProtocolCombo : public UrlNavigatorButton class KProtocolCombo : public KUrlNavigatorButton
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit ProtocolCombo(const QString& protocol, UrlNavigator* parent = 0); explicit KProtocolCombo(const QString& protocol, KUrlNavigator* parent = 0);
QString currentProtocol() const; QString currentProtocol() const;

View file

@ -18,10 +18,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#include "urlnavigatorbutton.h" #include "kurlbutton_p.h"
#include "urlnavigator.h"
UrlButton::UrlButton(UrlNavigator* parent) : #include "kurlnavigator.h"
KUrlButton::KUrlButton(KUrlNavigator* parent) :
QPushButton(parent), QPushButton(parent),
m_displayHint(0), m_displayHint(0),
m_urlNavigator(parent) m_urlNavigator(parent)
@ -33,11 +34,11 @@ UrlButton::UrlButton(UrlNavigator* parent) :
connect(this, SIGNAL(clicked()), parent, SLOT(requestActivation())); connect(this, SIGNAL(clicked()), parent, SLOT(requestActivation()));
} }
UrlButton::~UrlButton() KUrlButton::~KUrlButton()
{ {
} }
void UrlButton::setDisplayHintEnabled(DisplayHint hint, void KUrlButton::setDisplayHintEnabled(DisplayHint hint,
bool enable) bool enable)
{ {
if (enable) { if (enable) {
@ -49,26 +50,26 @@ void UrlButton::setDisplayHintEnabled(DisplayHint hint,
update(); update();
} }
bool UrlButton::isDisplayHintEnabled(DisplayHint hint) const bool KUrlButton::isDisplayHintEnabled(DisplayHint hint) const
{ {
return (m_displayHint & hint) > 0; return (m_displayHint & hint) > 0;
} }
void UrlButton::enterEvent(QEvent* event) void KUrlButton::enterEvent(QEvent* event)
{ {
QPushButton::enterEvent(event); QPushButton::enterEvent(event);
setDisplayHintEnabled(EnteredHint, true); setDisplayHintEnabled(EnteredHint, true);
update(); update();
} }
void UrlButton::leaveEvent(QEvent* event) void KUrlButton::leaveEvent(QEvent* event)
{ {
QPushButton::leaveEvent(event); QPushButton::leaveEvent(event);
setDisplayHintEnabled(EnteredHint, false); setDisplayHintEnabled(EnteredHint, false);
update(); update();
} }
QColor UrlButton::mixColors(const QColor& c1, QColor KUrlButton::mixColors(const QColor& c1,
const QColor& c2) const const QColor& c2) const
{ {
const int red = (c1.red() + c2.red()) / 2; const int red = (c1.red() + c2.red()) / 2;
@ -77,4 +78,4 @@ QColor UrlButton::mixColors(const QColor& c1,
return QColor(red, green, blue); return QColor(red, green, blue);
} }
#include "urlbutton.moc" #include "kurlbutton_p.moc"

View file

@ -18,14 +18,14 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#ifndef URLBUTTON_H #ifndef KURLBUTTON_P_H
#define URLBUTTON_H #define KURLBUTTON_P_H
#include <QPushButton> #include <QPushButton>
class KUrl; class KUrl;
class QEvent; class QEvent;
class UrlNavigator; class KUrlNavigator;
/** /**
* @brief Base class for buttons of the URL navigator. * @brief Base class for buttons of the URL navigator.
@ -33,15 +33,15 @@ class UrlNavigator;
* Each button of the URL navigator contains an URL, which * Each button of the URL navigator contains an URL, which
* is set as soon as the button has been clicked. * is set as soon as the button has been clicked.
*/ */
class UrlButton : public QPushButton class KUrlButton : public QPushButton
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit UrlButton(UrlNavigator* parent); explicit KUrlButton(KUrlNavigator* parent);
virtual ~UrlButton(); virtual ~KUrlButton();
UrlNavigator* urlNavigator() const { return m_urlNavigator; } KUrlNavigator* urlNavigator() const { return m_urlNavigator; }
protected: protected:
enum DisplayHint { enum DisplayHint {
@ -61,7 +61,7 @@ protected:
private: private:
int m_displayHint; int m_displayHint;
UrlNavigator* m_urlNavigator; KUrlNavigator* m_urlNavigator;
}; };
#endif #endif

View file

@ -2,6 +2,7 @@
* Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>) * * Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>) *
* Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) * * Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) *
* Copyright (C) 2006 by Patrice Tremblay * * Copyright (C) 2006 by Patrice Tremblay *
* Copyright (C) 2007 by Kevin Ottens (ervin@kde.org) *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -19,11 +20,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#include "urlnavigator.h" #include "kurlnavigator.h"
#include "bookmarkselector.h" #include "kfileplacesselector_p.h"
#include "protocolcombo.h" #include "kprotocolcombo_p.h"
#include "urlnavigatorbutton.h" #include "kurlnavigatorbutton_p.h"
#include <assert.h> #include <assert.h>
@ -95,10 +96,10 @@ HistoryElem::~HistoryElem()
{ {
} }
class UrlNavigator::Private class KUrlNavigator::Private
{ {
public: public:
Private(UrlNavigator* q, KFilePlacesModel* placesModel); Private(KUrlNavigator* q, KFilePlacesModel* placesModel);
void slotReturnPressed(const QString&); void slotReturnPressed(const QString&);
void slotRemoteHostActivated(); void slotRemoteHostActivated();
@ -150,19 +151,19 @@ public:
QList<HistoryElem> m_history; QList<HistoryElem> m_history;
QToolButton* m_toggleButton; QToolButton* m_toggleButton;
BookmarkSelector* m_bookmarkSelector; KFilePlacesSelector* m_placesSelector;
KUrlComboBox* m_pathBox; KUrlComboBox* m_pathBox;
ProtocolCombo* m_protocols; KProtocolCombo* m_protocols;
QLabel* m_protocolSeparator; QLabel* m_protocolSeparator;
QLineEdit* m_host; QLineEdit* m_host;
QLinkedList<UrlNavigatorButton*> m_navButtons; QLinkedList<KUrlNavigatorButton*> m_navButtons;
QWidget* m_filler; QWidget* m_filler;
QString m_homeUrl; QString m_homeUrl;
UrlNavigator* q; KUrlNavigator* q;
}; };
UrlNavigator::Private::Private(UrlNavigator* q, KFilePlacesModel* placesModel) KUrlNavigator::Private::Private(KUrlNavigator* q, KFilePlacesModel* placesModel)
: :
m_active(true), m_active(true),
m_showHiddenFiles(false), m_showHiddenFiles(false),
@ -188,9 +189,9 @@ UrlNavigator::Private::Private(UrlNavigator* q, KFilePlacesModel* placesModel)
connect(m_toggleButton, SIGNAL(clicked()), connect(m_toggleButton, SIGNAL(clicked()),
q, SLOT(switchView())); q, SLOT(switchView()));
// initialize the bookmark selector // initialize the places selector
m_bookmarkSelector = new BookmarkSelector(q, placesModel); m_placesSelector = new KFilePlacesSelector(q, placesModel);
connect(m_bookmarkSelector, SIGNAL(placeActivated(const KUrl&)), connect(m_placesSelector, SIGNAL(placeActivated(const KUrl&)),
q, SLOT(setUrl(const KUrl&))); q, SLOT(setUrl(const KUrl&)));
// initialize the path box of the traditional view // initialize the path box of the traditional view
@ -212,17 +213,17 @@ UrlNavigator::Private::Private(UrlNavigator* q, KFilePlacesModel* placesModel)
m_filler->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred); m_filler->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_layout->addWidget(m_toggleButton); m_layout->addWidget(m_toggleButton);
m_layout->addWidget(m_bookmarkSelector); m_layout->addWidget(m_placesSelector);
m_layout->addWidget(m_pathBox); m_layout->addWidget(m_pathBox);
m_layout->addWidget(m_filler); m_layout->addWidget(m_filler);
} }
void UrlNavigator::Private::appendWidget(QWidget* widget) void KUrlNavigator::Private::appendWidget(QWidget* widget)
{ {
m_layout->insertWidget(m_layout->count() - 1, widget); m_layout->insertWidget(m_layout->count() - 1, widget);
} }
void UrlNavigator::Private::slotReturnPressed(const QString& text) void KUrlNavigator::Private::slotReturnPressed(const QString& text)
{ {
// Parts of the following code have been taken // Parts of the following code have been taken
// from the class KateFileSelector located in // from the class KateFileSelector located in
@ -242,12 +243,12 @@ void UrlNavigator::Private::slotReturnPressed(const QString& text)
m_pathBox->setUrls(urls, KUrlComboBox::RemoveBottom); m_pathBox->setUrls(urls, KUrlComboBox::RemoveBottom);
q->setUrl(typedUrl); q->setUrl(typedUrl);
// The URL might have been adjusted by UrlNavigator::setUrl(), hence // The URL might have been adjusted by KUrlNavigator::setUrl(), hence
// synchronize the result in the path box. // synchronize the result in the path box.
m_pathBox->setUrl(q->url()); m_pathBox->setUrl(q->url());
} }
void UrlNavigator::Private::slotRemoteHostActivated() void KUrlNavigator::Private::slotRemoteHostActivated()
{ {
KUrl u = q->url(); KUrl u = q->url();
@ -294,14 +295,14 @@ void UrlNavigator::Private::slotRemoteHostActivated()
} }
} }
void UrlNavigator::Private::slotProtocolChanged(const QString& protocol) void KUrlNavigator::Private::slotProtocolChanged(const QString& protocol)
{ {
KUrl url; KUrl url;
url.setProtocol(protocol); url.setProtocol(protocol);
//url.setPath(KProtocolInfo::protocolClass(protocol) == ":local" ? "/" : ""); //url.setPath(KProtocolInfo::protocolClass(protocol) == ":local" ? "/" : "");
url.setPath("/"); url.setPath("/");
QLinkedList<UrlNavigatorButton*>::const_iterator it = m_navButtons.begin(); QLinkedList<KUrlNavigatorButton*>::const_iterator it = m_navButtons.begin();
const QLinkedList<UrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end(); const QLinkedList<KUrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end();
while (it != itEnd) { while (it != itEnd) {
(*it)->close(); (*it)->close();
(*it)->deleteLater(); (*it)->deleteLater();
@ -334,7 +335,7 @@ void UrlNavigator::Private::slotProtocolChanged(const QString& protocol)
} }
#if 0 #if 0
void UrlNavigator::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl) void KUrlNavigator::slotRedirection(const KUrl& oldUrl, const KUrl& newUrl)
{ {
// kDebug() << "received redirection to " << newUrl << endl; // kDebug() << "received redirection to " << newUrl << endl;
kDebug() << "received redirection from " << oldUrl << " to " << newUrl << endl; kDebug() << "received redirection from " << oldUrl << " to " << newUrl << endl;
@ -348,7 +349,7 @@ kDebug() << "received redirection from " << oldUrl << " to " << newUrl << endl;
} }
#endif #endif
void UrlNavigator::Private::switchView() void KUrlNavigator::Private::switchView()
{ {
updateContent(); updateContent();
if (q->isUrlEditable()) { if (q->isUrlEditable()) {
@ -359,7 +360,7 @@ void UrlNavigator::Private::switchView()
emit q->requestActivation(); emit q->requestActivation();
} }
void UrlNavigator::Private::updateHistoryElem() void KUrlNavigator::Private::updateHistoryElem()
{ {
assert(m_historyIndex >= 0); assert(m_historyIndex >= 0);
const KFileItem* item = 0; // TODO: m_dolphinView->currentFileItem(); const KFileItem* item = 0; // TODO: m_dolphinView->currentFileItem();
@ -369,9 +370,9 @@ void UrlNavigator::Private::updateHistoryElem()
} }
} }
void UrlNavigator::Private::updateContent() void KUrlNavigator::Private::updateContent()
{ {
m_bookmarkSelector->updateSelection(q->url()); m_placesSelector->updateSelection(q->url());
m_toggleButton->setToolTip(QString()); m_toggleButton->setToolTip(QString());
QString path(q->url().pathOrUrl()); QString path(q->url().pathOrUrl());
@ -402,8 +403,8 @@ void UrlNavigator::Private::updateContent()
m_pathBox->hide(); m_pathBox->hide();
m_filler->show(); m_filler->show();
// get the data from the currently selected bookmark // get the data from the currently selected place
KUrl placeUrl = m_bookmarkSelector->selectedPlaceUrl(); KUrl placeUrl = m_placesSelector->selectedPlaceUrl();
QString placePath; QString placePath;
if (!placeUrl.isValid()) { if (!placeUrl.isValid()) {
@ -439,7 +440,7 @@ void UrlNavigator::Private::updateContent()
QString protocol = currentUrl.protocol(); QString protocol = currentUrl.protocol();
if (!m_protocols) { if (!m_protocols) {
deleteButtons(); deleteButtons();
m_protocols = new ProtocolCombo(protocol, q); m_protocols = new KProtocolCombo(protocol, q);
appendWidget(m_protocols); appendWidget(m_protocols);
connect(m_protocols, SIGNAL(activated(QString)), connect(m_protocols, SIGNAL(activated(QString)),
q, SLOT(slotProtocolChanged(QString))); q, SLOT(slotProtocolChanged(QString)));
@ -492,10 +493,10 @@ void UrlNavigator::Private::updateContent()
} }
} }
void UrlNavigator::Private::updateButtons(const QString& path, int startIndex) void KUrlNavigator::Private::updateButtons(const QString& path, int startIndex)
{ {
QLinkedList<UrlNavigatorButton*>::iterator it = m_navButtons.begin(); QLinkedList<KUrlNavigatorButton*>::iterator it = m_navButtons.begin();
const QLinkedList<UrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end(); const QLinkedList<KUrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end();
bool createButton = false; bool createButton = false;
const KUrl currentUrl = q->url(); const KUrl currentUrl = q->url();
@ -512,8 +513,8 @@ void UrlNavigator::Private::updateButtons(const QString& path, int startIndex)
if (isFirstButton) { if (isFirstButton) {
// the first URL navigator button should get the name of the // the first URL navigator button should get the name of the
// place instead of the directory name // place instead of the directory name
const KUrl placeUrl = m_bookmarkSelector->selectedPlaceUrl(); const KUrl placeUrl = m_placesSelector->selectedPlaceUrl();
text = m_bookmarkSelector->selectedPlaceText(); text = m_placesSelector->selectedPlaceText();
if (text.isEmpty()) { if (text.isEmpty()) {
if (currentUrl.isLocalFile()) { if (currentUrl.isLocalFile()) {
text = i18n("Custom Path"); text = i18n("Custom Path");
@ -525,9 +526,9 @@ void UrlNavigator::Private::updateButtons(const QString& path, int startIndex)
} }
} }
UrlNavigatorButton* button = 0; KUrlNavigatorButton* button = 0;
if (createButton) { if (createButton) {
button = new UrlNavigatorButton(idx, q); button = new KUrlNavigatorButton(idx, q);
appendWidget(button); appendWidget(button);
} }
else { else {
@ -551,7 +552,7 @@ void UrlNavigator::Private::updateButtons(const QString& path, int startIndex)
} while (hasNext); } while (hasNext);
// delete buttons which are not used anymore // delete buttons which are not used anymore
QLinkedList<UrlNavigatorButton*>::iterator itBegin = it; QLinkedList<KUrlNavigatorButton*>::iterator itBegin = it;
while (it != itEnd) { while (it != itEnd) {
(*it)->close(); (*it)->close();
(*it)->deleteLater(); (*it)->deleteLater();
@ -560,11 +561,11 @@ void UrlNavigator::Private::updateButtons(const QString& path, int startIndex)
m_navButtons.erase(itBegin, m_navButtons.end()); m_navButtons.erase(itBegin, m_navButtons.end());
} }
void UrlNavigator::Private::deleteButtons() void KUrlNavigator::Private::deleteButtons()
{ {
QLinkedList<UrlNavigatorButton*>::iterator itBegin = m_navButtons.begin(); QLinkedList<KUrlNavigatorButton*>::iterator itBegin = m_navButtons.begin();
QLinkedList<UrlNavigatorButton*>::iterator itEnd = m_navButtons.end(); QLinkedList<KUrlNavigatorButton*>::iterator itEnd = m_navButtons.end();
QLinkedList<UrlNavigatorButton*>::iterator it = itBegin; QLinkedList<KUrlNavigatorButton*>::iterator it = itBegin;
while (it != itEnd) { while (it != itEnd) {
(*it)->close(); (*it)->close();
(*it)->deleteLater(); (*it)->deleteLater();
@ -576,7 +577,7 @@ void UrlNavigator::Private::deleteButtons()
//// ////
UrlNavigator::UrlNavigator(KFilePlacesModel* placesModel, KUrlNavigator::KUrlNavigator(KFilePlacesModel* placesModel,
const KUrl& url, const KUrl& url,
QWidget* parent) : QWidget* parent) :
QWidget(parent), QWidget(parent),
@ -592,18 +593,18 @@ UrlNavigator::UrlNavigator(KFilePlacesModel* placesModel,
d->updateContent(); d->updateContent();
} }
UrlNavigator::~UrlNavigator() KUrlNavigator::~KUrlNavigator()
{ {
delete d; delete d;
} }
const KUrl& UrlNavigator::url() const const KUrl& KUrlNavigator::url() const
{ {
assert(!d->m_history.empty()); assert(!d->m_history.empty());
return d->m_history[d->m_historyIndex].url(); return d->m_history[d->m_historyIndex].url();
} }
KUrl UrlNavigator::url(int index) const KUrl KUrlNavigator::url(int index) const
{ {
assert(index >= 0); assert(index >= 0);
// keep scheme, hostname etc. maybe we will need this in the future // keep scheme, hostname etc. maybe we will need this in the future
@ -623,18 +624,18 @@ KUrl UrlNavigator::url(int index) const
return newurl; return newurl;
} }
QPoint UrlNavigator::savedPosition() const QPoint KUrlNavigator::savedPosition() const
{ {
const HistoryElem& histElem = d->m_history[d->m_historyIndex]; const HistoryElem& histElem = d->m_history[d->m_historyIndex];
return QPoint( histElem.contentsX(), histElem.contentsY() ); return QPoint( histElem.contentsX(), histElem.contentsY() );
} }
int UrlNavigator::historySize() const int KUrlNavigator::historySize() const
{ {
return d->m_history.count(); return d->m_history.count();
} }
void UrlNavigator::goBack() void KUrlNavigator::goBack()
{ {
d->updateHistoryElem(); d->updateHistoryElem();
@ -647,7 +648,7 @@ void UrlNavigator::goBack()
} }
} }
void UrlNavigator::goForward() void KUrlNavigator::goForward()
{ {
if (d->m_historyIndex > 0) { if (d->m_historyIndex > 0) {
--d->m_historyIndex; --d->m_historyIndex;
@ -657,12 +658,12 @@ void UrlNavigator::goForward()
} }
} }
void UrlNavigator::goUp() void KUrlNavigator::goUp()
{ {
setUrl(url().upUrl()); setUrl(url().upUrl());
} }
void UrlNavigator::goHome() void KUrlNavigator::goHome()
{ {
if (d->m_homeUrl.isEmpty()) if (d->m_homeUrl.isEmpty())
setUrl(QDir::homePath()); setUrl(QDir::homePath());
@ -670,12 +671,12 @@ void UrlNavigator::goHome()
setUrl(d->m_homeUrl); setUrl(d->m_homeUrl);
} }
bool UrlNavigator::isUrlEditable() const bool KUrlNavigator::isUrlEditable() const
{ {
return d->m_toggleButton->isChecked(); return d->m_toggleButton->isChecked();
} }
void UrlNavigator::setUrlEditable(bool editable) void KUrlNavigator::setUrlEditable(bool editable)
{ {
if (isUrlEditable() != editable) { if (isUrlEditable() != editable) {
d->m_toggleButton->toggle(); d->m_toggleButton->toggle();
@ -683,7 +684,7 @@ void UrlNavigator::setUrlEditable(bool editable)
} }
} }
void UrlNavigator::setActive(bool active) void KUrlNavigator::setActive(bool active)
{ {
if (active != d->m_active) { if (active != d->m_active) {
d->m_active = active; d->m_active = active;
@ -694,18 +695,18 @@ void UrlNavigator::setActive(bool active)
} }
} }
void UrlNavigator::setShowHiddenFiles( bool show ) void KUrlNavigator::setShowHiddenFiles( bool show )
{ {
d->m_showHiddenFiles = show; d->m_showHiddenFiles = show;
} }
void UrlNavigator::dropUrls(const KUrl::List& urls, void KUrlNavigator::dropUrls(const KUrl::List& urls,
const KUrl& destination) const KUrl& destination)
{ {
emit urlsDropped(urls, destination); emit urlsDropped(urls, destination);
} }
void UrlNavigator::setUrl(const KUrl& url) void KUrlNavigator::setUrl(const KUrl& url)
{ {
QString urlStr(url.pathOrUrl()); QString urlStr(url.pathOrUrl());
@ -760,7 +761,7 @@ void UrlNavigator::setUrl(const KUrl& url)
/* kDebug() << "history starting ====================" << endl; /* kDebug() << "history starting ====================" << endl;
int i = 0; int i = 0;
for (QValueListIterator<UrlNavigator::HistoryElem> it = d->m_history.begin(); for (QValueListIterator<KUrlNavigator::HistoryElem> it = d->m_history.begin();
it != d->m_history.end(); it != d->m_history.end();
++it, ++i) ++it, ++i)
{ {
@ -771,19 +772,19 @@ void UrlNavigator::setUrl(const KUrl& url)
requestActivation(); requestActivation();
} }
void UrlNavigator::requestActivation() void KUrlNavigator::requestActivation()
{ {
setActive(true); setActive(true);
} }
void UrlNavigator::storeContentsPosition(int x, int y) void KUrlNavigator::storeContentsPosition(int x, int y)
{ {
HistoryElem& hist = d->m_history[d->m_historyIndex]; HistoryElem& hist = d->m_history[d->m_historyIndex];
hist.setContentsX(x); hist.setContentsX(x);
hist.setContentsY(y); hist.setContentsY(y);
} }
void UrlNavigator::keyReleaseEvent(QKeyEvent* event) void KUrlNavigator::keyReleaseEvent(QKeyEvent* event)
{ {
QWidget::keyReleaseEvent(event); QWidget::keyReleaseEvent(event);
if (isUrlEditable() && (event->key() == Qt::Key_Escape)) { if (isUrlEditable() && (event->key() == Qt::Key_Escape)) {
@ -791,7 +792,7 @@ void UrlNavigator::keyReleaseEvent(QKeyEvent* event)
} }
} }
void UrlNavigator::mouseReleaseEvent(QMouseEvent* event) void KUrlNavigator::mouseReleaseEvent(QMouseEvent* event)
{ {
if (event->button() == Qt::MidButton) { if (event->button() == Qt::MidButton) {
QClipboard* clipboard = QApplication::clipboard(); QClipboard* clipboard = QApplication::clipboard();
@ -804,19 +805,19 @@ void UrlNavigator::mouseReleaseEvent(QMouseEvent* event)
QWidget::mouseReleaseEvent(event); QWidget::mouseReleaseEvent(event);
} }
bool UrlNavigator::isActive() const bool KUrlNavigator::isActive() const
{ {
return d->m_active; return d->m_active;
} }
bool UrlNavigator::showHiddenFiles() const bool KUrlNavigator::showHiddenFiles() const
{ {
return d->m_showHiddenFiles; return d->m_showHiddenFiles;
} }
void UrlNavigator::setHomeUrl(const QString& homeUrl) void KUrlNavigator::setHomeUrl(const QString& homeUrl)
{ {
d->m_homeUrl = homeUrl; d->m_homeUrl = homeUrl;
} }
#include "urlnavigator.moc" #include "kurlnavigator.moc"

View file

@ -2,6 +2,7 @@
* Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>) * * Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>) *
* Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) * * Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) *
* Copyright (C) 2006 by Patrice Tremblay * * Copyright (C) 2006 by Patrice Tremblay *
* Copyright (C) 2007 by Kevin Ottens (ervin@kde.org) *
* * * *
* This program is free software; you can redistribute it and/or modify * * This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -19,8 +20,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#ifndef URLNAVIGATOR_H #ifndef KURLNAVIGATOR_H
#define URLNAVIGATOR_H #define KURLNAVIGATOR_H
#include <kurl.h> #include <kurl.h>
#include <QWidget> #include <QWidget>
@ -45,13 +46,13 @@ class QMouseEvent;
* The URL navigator also remembers the URL history and allows to go * The URL navigator also remembers the URL history and allows to go
* back and forward within this history. * back and forward within this history.
*/ */
class UrlNavigator : public QWidget class KUrlNavigator : public QWidget
{ {
Q_OBJECT Q_OBJECT
public: public:
UrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent); KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
virtual ~UrlNavigator(); virtual ~KUrlNavigator();
/** Returns the current active URL. */ /** Returns the current active URL. */
const KUrl& url() const; const KUrl& url() const;
@ -215,7 +216,7 @@ private:
class Private; class Private;
Private* const d; Private* const d;
Q_DISABLE_COPY( UrlNavigator ) Q_DISABLE_COPY( KUrlNavigator )
}; };
#endif #endif

View file

@ -18,11 +18,11 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#include "urlnavigatorbutton.h" #include "kurlnavigatorbutton_p.h"
#include <assert.h> #include <assert.h>
#include "urlnavigator.h" #include "kurlnavigator.h"
#include <kio/job.h> #include <kio/job.h>
#include <kio/jobclasses.h> #include <kio/jobclasses.h>
@ -33,8 +33,8 @@
#include <QPaintEvent> #include <QPaintEvent>
#include <QTimer> #include <QTimer>
UrlNavigatorButton::UrlNavigatorButton(int index, UrlNavigator* parent) : KUrlNavigatorButton::KUrlNavigatorButton(int index, KUrlNavigator* parent) :
UrlButton(parent), KUrlButton(parent),
m_index(-1), m_index(-1),
m_popupDelay(0), m_popupDelay(0),
m_listJob(0) m_listJob(0)
@ -50,11 +50,11 @@ UrlNavigatorButton::UrlNavigatorButton(int index, UrlNavigator* parent) :
connect(this, SIGNAL(pressed()), this, SLOT(startPopupDelay())); connect(this, SIGNAL(pressed()), this, SLOT(startPopupDelay()));
} }
UrlNavigatorButton::~UrlNavigatorButton() KUrlNavigatorButton::~KUrlNavigatorButton()
{ {
} }
void UrlNavigatorButton::setIndex(int index) void KUrlNavigatorButton::setIndex(int index)
{ {
m_index = index; m_index = index;
@ -82,13 +82,13 @@ void UrlNavigatorButton::setIndex(int index)
update(); update();
} }
QSize UrlNavigatorButton::sizeHint() const QSize KUrlNavigatorButton::sizeHint() const
{ {
const int width = fontMetrics().width(text()) + (arrowWidth() * 4); const int width = fontMetrics().width(text()) + (arrowWidth() * 4);
return QSize(width, UrlButton::sizeHint().height()); return QSize(width, KUrlButton::sizeHint().height());
} }
void UrlNavigatorButton::paintEvent(QPaintEvent* event) void KUrlNavigatorButton::paintEvent(QPaintEvent* event)
{ {
QPainter painter(this); QPainter painter(this);
painter.setClipRect(event->rect()); painter.setClipRect(event->rect());
@ -168,9 +168,9 @@ void UrlNavigatorButton::paintEvent(QPaintEvent* event)
} }
} }
void UrlNavigatorButton::enterEvent(QEvent* event) void KUrlNavigatorButton::enterEvent(QEvent* event)
{ {
UrlButton::enterEvent(event); KUrlButton::enterEvent(event);
// if the text is clipped due to a small window width, the text should // if the text is clipped due to a small window width, the text should
// be shown as tooltip // be shown as tooltip
@ -179,13 +179,13 @@ void UrlNavigatorButton::enterEvent(QEvent* event)
} }
} }
void UrlNavigatorButton::leaveEvent(QEvent* event) void KUrlNavigatorButton::leaveEvent(QEvent* event)
{ {
UrlButton::leaveEvent(event); KUrlButton::leaveEvent(event);
setToolTip(QString()); setToolTip(QString());
} }
void UrlNavigatorButton::dropEvent(QDropEvent* event) void KUrlNavigatorButton::dropEvent(QDropEvent* event)
{ {
if (m_index < 0) { if (m_index < 0) {
return; return;
@ -207,7 +207,7 @@ void UrlNavigatorButton::dropEvent(QDropEvent* event)
} }
} }
void UrlNavigatorButton::dragEnterEvent(QDragEnterEvent* event) void KUrlNavigatorButton::dragEnterEvent(QDragEnterEvent* event)
{ {
if (event->mimeData()->hasUrls()) { if (event->mimeData()->hasUrls()) {
setDisplayHintEnabled(DraggedHint, true); setDisplayHintEnabled(DraggedHint, true);
@ -217,16 +217,16 @@ void UrlNavigatorButton::dragEnterEvent(QDragEnterEvent* event)
} }
} }
void UrlNavigatorButton::dragLeaveEvent(QDragLeaveEvent* event) void KUrlNavigatorButton::dragLeaveEvent(QDragLeaveEvent* event)
{ {
UrlButton::dragLeaveEvent(event); KUrlButton::dragLeaveEvent(event);
setDisplayHintEnabled(DraggedHint, false); setDisplayHintEnabled(DraggedHint, false);
update(); update();
} }
void UrlNavigatorButton::updateNavigatorUrl() void KUrlNavigatorButton::updateNavigatorUrl()
{ {
stopPopupDelay(); stopPopupDelay();
@ -237,7 +237,7 @@ void UrlNavigatorButton::updateNavigatorUrl()
urlNavigator()->setUrl(urlNavigator()->url(m_index)); urlNavigator()->setUrl(urlNavigator()->url(m_index));
} }
void UrlNavigatorButton::startPopupDelay() void KUrlNavigatorButton::startPopupDelay()
{ {
if (m_popupDelay->isActive() || (m_listJob != 0) || (m_index < 0)) { if (m_popupDelay->isActive() || (m_listJob != 0) || (m_index < 0)) {
return; return;
@ -246,7 +246,7 @@ void UrlNavigatorButton::startPopupDelay()
m_popupDelay->start(300); m_popupDelay->start(300);
} }
void UrlNavigatorButton::stopPopupDelay() void KUrlNavigatorButton::stopPopupDelay()
{ {
m_popupDelay->stop(); m_popupDelay->stop();
if (m_listJob != 0) { if (m_listJob != 0) {
@ -255,7 +255,7 @@ void UrlNavigatorButton::stopPopupDelay()
} }
} }
void UrlNavigatorButton::startListJob() void KUrlNavigatorButton::startListJob()
{ {
if (m_listJob != 0) { if (m_listJob != 0) {
return; return;
@ -270,7 +270,7 @@ void UrlNavigatorButton::startListJob()
connect(m_listJob, SIGNAL(result(KJob*)), this, SLOT(listJobFinished(KJob*))); connect(m_listJob, SIGNAL(result(KJob*)), this, SLOT(listJobFinished(KJob*)));
} }
void UrlNavigatorButton::entriesList(KIO::Job* job, const KIO::UDSEntryList& entries) void KUrlNavigatorButton::entriesList(KIO::Job* job, const KIO::UDSEntryList& entries)
{ {
if (job != m_listJob) { if (job != m_listJob) {
return; return;
@ -296,7 +296,7 @@ void UrlNavigatorButton::entriesList(KIO::Job* job, const KIO::UDSEntryList& ent
m_subdirs.sort(); m_subdirs.sort();
} }
void UrlNavigatorButton::listJobFinished(KJob* job) void KUrlNavigatorButton::listJobFinished(KJob* job)
{ {
if (job != m_listJob) { if (job != m_listJob) {
return; return;
@ -338,7 +338,7 @@ void UrlNavigatorButton::listJobFinished(KJob* job)
setDisplayHintEnabled(PopupActiveHint, false); setDisplayHintEnabled(PopupActiveHint, false);
} }
int UrlNavigatorButton::arrowWidth() const int KUrlNavigatorButton::arrowWidth() const
{ {
int width = (height() / 2) - 7; int width = (height() / 2) - 7;
if (width < 4) { if (width < 4) {
@ -347,7 +347,7 @@ int UrlNavigatorButton::arrowWidth() const
return width; return width;
} }
bool UrlNavigatorButton::isTextClipped() const bool KUrlNavigatorButton::isTextClipped() const
{ {
int availableWidth = width(); int availableWidth = width();
if (!isDisplayHintEnabled(ActivatedHint)) { if (!isDisplayHintEnabled(ActivatedHint)) {
@ -358,4 +358,4 @@ bool UrlNavigatorButton::isTextClipped() const
return fontMetrics.width(text()) >= availableWidth; return fontMetrics.width(text()) >= availableWidth;
} }
#include "urlnavigatorbutton.moc" #include "kurlnavigatorbutton_p.moc"

View file

@ -18,15 +18,15 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/ ***************************************************************************/
#ifndef URLNAVIGATORBUTTON_H #ifndef KURLNAVIGATORBUTTON_P_H
#define URLNAVIGATORBUTTON_H #define KURLNAVIGATORBUTTON_P_H
#include <kio/global.h> #include <kio/global.h>
#include "urlbutton.h" #include "kurlbutton_p.h"
class KJob; class KJob;
class KUrl; class KUrl;
class UrlNavigator; class KUrlNavigator;
class QPainter; class QPainter;
class QPaintEvent; class QPaintEvent;
@ -43,13 +43,13 @@ namespace KIO
* to copy, move or link the dropped items to the URL part indicated by * to copy, move or link the dropped items to the URL part indicated by
* the button. * the button.
*/ */
class UrlNavigatorButton : public UrlButton class KUrlNavigatorButton : public KUrlButton
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit UrlNavigatorButton(int index, UrlNavigator* parent); explicit KUrlNavigatorButton(int index, KUrlNavigator* parent);
virtual ~UrlNavigatorButton(); virtual ~KUrlNavigatorButton();
void setIndex(int index); void setIndex(int index);
int index() const { return m_index; } int index() const { return m_index; }