in kdelibs.
svn path=/trunk/KDE/kdebase/apps/; revision=649514
kfileplacesmodel.cpp
kfileplacesitem.cpp
kfileplacesview.cpp
- bookmarkselector.cpp
+ kfileplacesselector.cpp
bookmarkssettingspage.cpp
bookmarkssidebarpage.cpp
columnviewsettingspage.cpp
infosidebarpage.cpp
main.cpp
metadatawidget.cpp
- protocolcombo.cpp
+ kprotocolcombo.cpp
pixmapviewer.cpp
renamedialog.cpp
settingspagebase.cpp
treeviewcontextmenu.cpp
treeviewsidebarpage.cpp
sidebartreeview.cpp
- urlbutton.cpp
- urlnavigator.cpp
- urlnavigatorbutton.cpp
+ kurlbutton.cpp
+ kurlnavigator.cpp
+ kurlnavigatorbutton.cpp
viewpropertiesdialog.cpp
viewsettingspage.cpp
viewpropsprogressinfo.cpp )
#include "metadatawidget.h"
#include "mainwindowadaptor.h"
#include "treeviewsidebarpage.h"
-#include "urlnavigator.h"
+#include "kurlnavigator.h"
#include "viewpropertiesdialog.h"
#include "viewproperties.h"
#include "kfileplacesmodel.h"
connect(view, SIGNAL(urlChanged(KUrl)),
this, SLOT(changeUrl(KUrl)));
- const UrlNavigator* navigator = view->urlNavigator();
+ const KUrlNavigator* navigator = view->urlNavigator();
connect(navigator, SIGNAL(urlChanged(const KUrl&)),
this, SLOT(changeUrl(const KUrl&)));
connect(navigator, SIGNAL(historyChanged()),
#include "dolphincontextmenu.h"
#include "filterbar.h"
#include "renamedialog.h"
-#include "urlnavigator.h"
+#include "kurlnavigator.h"
#include "viewproperties.h"
#include "dolphinsettings.h"
#include "dolphin_generalsettings.h"
connect(clipboard, SIGNAL(dataChanged()),
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->setHomeUrl(DolphinSettings::instance().generalSettings()->homeUrl());
m_urlNavigator->setShowHiddenFiles(showHiddenFiles);
#include <kfileitemdelegate.h>
#include <kio/job.h>
-#include <urlnavigator.h>
+#include <kurlnavigator.h>
#include <QDropEvent>
#include <QLinkedList>
class KFileItemDelegate;
class KUrl;
class KDirModel;
-class UrlNavigator;
+class KUrlNavigator;
class DolphinColumnView;
class DolphinDetailsView;
class DolphinDirLister;
* @see DolphinIconsView
* @see DolphinDetailsView
* @see DolphinColumnView
- * @see UrlNavigator
+ * @see KUrlNavigator
* @see DolphinStatusBar
*/
class DolphinView : public QWidget
/**
* Sets the current active URL.
- * The signals UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+ * The signals KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are emitted.
*/
void setUrl(const KUrl& url);
/**
* Goes back one step in the URL history. The signals
- * UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+ * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are submitted.
*/
void goBack();
/**
* Goes forward one step in the Url history. The signals
- * UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+ * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are submitted.
*/
void goForward();
/**
* Goes up one step of the Url path. The signals
- * UrlNavigator::urlChanged() and UrlNavigator::historyChanged()
+ * KUrlNavigator::urlChanged() and KUrlNavigator::historyChanged()
* are submitted.
*/
void goUp();
/**
- * Goes to the home URL. The signals UrlNavigator::urlChanged()
- * and UrlNavigator::historyChanged() are submitted.
+ * Goes to the home URL. The signals KUrlNavigator::urlChanged()
+ * and KUrlNavigator::historyChanged() are submitted.
*/
void goHome();
/**
* Returns true, if the URL shown by the navigation bar is editable.
- * @see UrlNavigator
+ * @see KUrlNavigator
*/
bool isUrlEditable() const;
/** Returns the additional information which should be shown for the items. */
KFileItemDelegate::AdditionalInformation additionalInfo() const;
- /** Returns the UrlNavigator of the view for read access. */
- const UrlNavigator* urlNavigator() const { return m_urlNavigator; }
+ /** Returns the KUrlNavigator of the view for read access. */
+ const KUrlNavigator* urlNavigator() const { return m_urlNavigator; }
/**
* Triggers to request user information for the item given
DolphinMainWindow* m_mainWindow;
QVBoxLayout* m_topLayout;
- UrlNavigator* m_urlNavigator;
+ KUrlNavigator* m_urlNavigator;
DolphinController* m_controller;
DolphinIconsView* m_iconsView;
/***************************************************************************
* 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 *
* it under the terms of the GNU General Public License as published by *
* 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 <QPixmap>
#include <kicon.h>
-BookmarkSelector::BookmarkSelector(UrlNavigator* parent, KFilePlacesModel* placesModel) :
- UrlButton(parent),
+KFilePlacesSelector::KFilePlacesSelector(KUrlNavigator* parent, KFilePlacesModel* placesModel) :
+ KUrlButton(parent),
m_selectedItem(-1),
m_urlNavigator(parent),
m_placesModel(placesModel)
setMenu(m_placesMenu);
}
-BookmarkSelector::~BookmarkSelector()
+KFilePlacesSelector::~KFilePlacesSelector()
{
}
-void BookmarkSelector::updateMenu()
+void KFilePlacesSelector::updateMenu()
{
m_placesMenu->clear();
}
}
-void BookmarkSelector::updateSelection(const KUrl& url)
+void KFilePlacesSelector::updateSelection(const KUrl& url)
{
QModelIndex index = m_placesModel->closestItem(url);
}
}
-KUrl BookmarkSelector::selectedPlaceUrl() const
+KUrl KFilePlacesSelector::selectedPlaceUrl() const
{
QModelIndex index = m_placesModel->index(m_selectedItem, 0);
return KUrl();
}
-QString BookmarkSelector::selectedPlaceText() const
+QString KFilePlacesSelector::selectedPlaceText() const
{
QModelIndex index = m_placesModel->index(m_selectedItem, 0);
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);
}
-void BookmarkSelector::paintEvent(QPaintEvent* /*event*/)
+void KFilePlacesSelector::paintEvent(QPaintEvent* /*event*/)
{
QPainter painter(this);
painter.drawPixmap(x, y, pixmap);
}
-void BookmarkSelector::activatePlace(QAction* action)
+void KFilePlacesSelector::activatePlace(QAction* action)
{
assert(action != 0);
m_selectedItem = action->data().toInt();
}
}
-#include "bookmarkselector.moc"
+#include "kfileplacesselector_p.moc"
/***************************************************************************
* 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 *
* it under the terms of the GNU General Public License as published by *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef BOOKMARKSELECTOR_H
-#define BOOKMARKSELECTOR_H
+#ifndef KFILEPLACESSELECTOR_P_H
+#define KFILEPLACESSELECTOR_P_H
-#include <urlbutton.h>
+#include "kurlbutton_p.h"
#include <kurl.h>
class KFilePlacesModel;
-class UrlNavigator;
+class KUrlNavigator;
class KMenu;
/**
*
* @see UrlNavigator
*/
-class BookmarkSelector : public UrlButton
+class KFilePlacesSelector : public KUrlButton
{
Q_OBJECT
* @param parent Parent widget where the bookmark selector
* 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
private:
int m_selectedItem;
- UrlNavigator* m_urlNavigator;
+ KUrlNavigator* m_urlNavigator;
KMenu* m_placesMenu;
KFilePlacesModel* m_placesModel;
};
#include <kprotocolinfo.h>
#include <kprotocolmanager.h>
-#include "protocolcombo.h"
+#include "kprotocolcombo_p.h"
const static int customProtocolIndex = 0;
-ProtocolCombo::ProtocolCombo(const QString& protocol, UrlNavigator* parent)
- : UrlNavigatorButton(-1, parent),
+KProtocolCombo::KProtocolCombo(const QString& protocol, KUrlNavigator* parent)
+ : KUrlNavigatorButton(-1, parent),
m_protocols(KProtocolInfo::protocols())
{
qSort(m_protocols);
// #include <kurl.h>
// #include "urlnavigator.h"
-void ProtocolCombo::setProtocol(const QString& protocol)
+void KProtocolCombo::setProtocol(const QString& protocol)
{
setText(protocol);
// if (KProtocolInfo::isKnownProtocol(protocol))
// }
}
-void ProtocolCombo::setProtocol(int index)
+void KProtocolCombo::setProtocol(int index)
{
if (index < 0 || index > m_protocols.count())
{
/* */
}
-QString ProtocolCombo::currentProtocol() const
+QString KProtocolCombo::currentProtocol() const
{
return text(); //currentText();
}
-#include "protocolcombo.moc"
+#include "kprotocolcombo_p.moc"
* Free Software Foundation, Inc., *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef PROTOCOLCOMBO_H
-#define PROTOCOLCOMBO_H
+#ifndef KPROTOCOLCOMBO_P_H
+#define KPROTOCOLCOMBO_P_H
-#include "urlnavigatorbutton.h"
+#include "kurlnavigatorbutton_p.h"
-class UrlNavigator;
+class KUrlNavigator;
/**
* A combobox listing available protocols
*/
-class ProtocolCombo : public UrlNavigatorButton
+class KProtocolCombo : public KUrlNavigatorButton
{
Q_OBJECT
public:
- explicit ProtocolCombo(const QString& protocol, UrlNavigator* parent = 0);
+ explicit KProtocolCombo(const QString& protocol, KUrlNavigator* parent = 0);
QString currentProtocol() const;
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "urlnavigatorbutton.h"
-#include "urlnavigator.h"
+#include "kurlbutton_p.h"
-UrlButton::UrlButton(UrlNavigator* parent) :
+#include "kurlnavigator.h"
+
+KUrlButton::KUrlButton(KUrlNavigator* parent) :
QPushButton(parent),
m_displayHint(0),
m_urlNavigator(parent)
connect(this, SIGNAL(clicked()), parent, SLOT(requestActivation()));
}
-UrlButton::~UrlButton()
+KUrlButton::~KUrlButton()
{
}
-void UrlButton::setDisplayHintEnabled(DisplayHint hint,
+void KUrlButton::setDisplayHintEnabled(DisplayHint hint,
bool enable)
{
if (enable) {
update();
}
-bool UrlButton::isDisplayHintEnabled(DisplayHint hint) const
+bool KUrlButton::isDisplayHintEnabled(DisplayHint hint) const
{
return (m_displayHint & hint) > 0;
}
-void UrlButton::enterEvent(QEvent* event)
+void KUrlButton::enterEvent(QEvent* event)
{
QPushButton::enterEvent(event);
setDisplayHintEnabled(EnteredHint, true);
update();
}
-void UrlButton::leaveEvent(QEvent* event)
+void KUrlButton::leaveEvent(QEvent* event)
{
QPushButton::leaveEvent(event);
setDisplayHintEnabled(EnteredHint, false);
update();
}
-QColor UrlButton::mixColors(const QColor& c1,
+QColor KUrlButton::mixColors(const QColor& c1,
const QColor& c2) const
{
const int red = (c1.red() + c2.red()) / 2;
return QColor(red, green, blue);
}
-#include "urlbutton.moc"
+#include "kurlbutton_p.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef URLBUTTON_H
-#define URLBUTTON_H
+#ifndef KURLBUTTON_P_H
+#define KURLBUTTON_P_H
#include <QPushButton>
class KUrl;
class QEvent;
-class UrlNavigator;
+class KUrlNavigator;
/**
* @brief Base class for buttons of the URL navigator.
* Each button of the URL navigator contains an URL, which
* is set as soon as the button has been clicked.
*/
-class UrlButton : public QPushButton
+class KUrlButton : public QPushButton
{
Q_OBJECT
public:
- explicit UrlButton(UrlNavigator* parent);
- virtual ~UrlButton();
+ explicit KUrlButton(KUrlNavigator* parent);
+ virtual ~KUrlButton();
- UrlNavigator* urlNavigator() const { return m_urlNavigator; }
+ KUrlNavigator* urlNavigator() const { return m_urlNavigator; }
protected:
enum DisplayHint {
private:
int m_displayHint;
- UrlNavigator* m_urlNavigator;
+ KUrlNavigator* m_urlNavigator;
};
#endif
* Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>) *
* Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) *
* 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 *
* it under the terms of the GNU General Public License as published by *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "urlnavigator.h"
+#include "kurlnavigator.h"
-#include "bookmarkselector.h"
-#include "protocolcombo.h"
-#include "urlnavigatorbutton.h"
+#include "kfileplacesselector_p.h"
+#include "kprotocolcombo_p.h"
+#include "kurlnavigatorbutton_p.h"
#include <assert.h>
{
}
-class UrlNavigator::Private
+class KUrlNavigator::Private
{
public:
- Private(UrlNavigator* q, KFilePlacesModel* placesModel);
+ Private(KUrlNavigator* q, KFilePlacesModel* placesModel);
void slotReturnPressed(const QString&);
void slotRemoteHostActivated();
QList<HistoryElem> m_history;
QToolButton* m_toggleButton;
- BookmarkSelector* m_bookmarkSelector;
+ KFilePlacesSelector* m_placesSelector;
KUrlComboBox* m_pathBox;
- ProtocolCombo* m_protocols;
+ KProtocolCombo* m_protocols;
QLabel* m_protocolSeparator;
QLineEdit* m_host;
- QLinkedList<UrlNavigatorButton*> m_navButtons;
+ QLinkedList<KUrlNavigatorButton*> m_navButtons;
QWidget* m_filler;
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_showHiddenFiles(false),
connect(m_toggleButton, SIGNAL(clicked()),
q, SLOT(switchView()));
- // initialize the bookmark selector
- m_bookmarkSelector = new BookmarkSelector(q, placesModel);
- connect(m_bookmarkSelector, SIGNAL(placeActivated(const KUrl&)),
+ // initialize the places selector
+ m_placesSelector = new KFilePlacesSelector(q, placesModel);
+ connect(m_placesSelector, SIGNAL(placeActivated(const KUrl&)),
q, SLOT(setUrl(const KUrl&)));
// initialize the path box of the traditional view
m_filler->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
m_layout->addWidget(m_toggleButton);
- m_layout->addWidget(m_bookmarkSelector);
+ m_layout->addWidget(m_placesSelector);
m_layout->addWidget(m_pathBox);
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);
}
-void UrlNavigator::Private::slotReturnPressed(const QString& text)
+void KUrlNavigator::Private::slotReturnPressed(const QString& text)
{
// Parts of the following code have been taken
// from the class KateFileSelector located in
m_pathBox->setUrls(urls, KUrlComboBox::RemoveBottom);
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.
m_pathBox->setUrl(q->url());
}
-void UrlNavigator::Private::slotRemoteHostActivated()
+void KUrlNavigator::Private::slotRemoteHostActivated()
{
KUrl u = q->url();
}
}
-void UrlNavigator::Private::slotProtocolChanged(const QString& protocol)
+void KUrlNavigator::Private::slotProtocolChanged(const QString& protocol)
{
KUrl url;
url.setProtocol(protocol);
//url.setPath(KProtocolInfo::protocolClass(protocol) == ":local" ? "/" : "");
url.setPath("/");
- QLinkedList<UrlNavigatorButton*>::const_iterator it = m_navButtons.begin();
- const QLinkedList<UrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end();
+ QLinkedList<KUrlNavigatorButton*>::const_iterator it = m_navButtons.begin();
+ const QLinkedList<KUrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end();
while (it != itEnd) {
(*it)->close();
(*it)->deleteLater();
}
#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 from " << oldUrl << " to " << newUrl << endl;
}
#endif
-void UrlNavigator::Private::switchView()
+void KUrlNavigator::Private::switchView()
{
updateContent();
if (q->isUrlEditable()) {
emit q->requestActivation();
}
-void UrlNavigator::Private::updateHistoryElem()
+void KUrlNavigator::Private::updateHistoryElem()
{
assert(m_historyIndex >= 0);
const KFileItem* item = 0; // TODO: m_dolphinView->currentFileItem();
}
}
-void UrlNavigator::Private::updateContent()
+void KUrlNavigator::Private::updateContent()
{
- m_bookmarkSelector->updateSelection(q->url());
+ m_placesSelector->updateSelection(q->url());
m_toggleButton->setToolTip(QString());
QString path(q->url().pathOrUrl());
m_pathBox->hide();
m_filler->show();
- // get the data from the currently selected bookmark
- KUrl placeUrl = m_bookmarkSelector->selectedPlaceUrl();
+ // get the data from the currently selected place
+ KUrl placeUrl = m_placesSelector->selectedPlaceUrl();
QString placePath;
if (!placeUrl.isValid()) {
QString protocol = currentUrl.protocol();
if (!m_protocols) {
deleteButtons();
- m_protocols = new ProtocolCombo(protocol, q);
+ m_protocols = new KProtocolCombo(protocol, q);
appendWidget(m_protocols);
connect(m_protocols, SIGNAL(activated(QString)),
q, SLOT(slotProtocolChanged(QString)));
}
}
-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();
- const QLinkedList<UrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end();
+ QLinkedList<KUrlNavigatorButton*>::iterator it = m_navButtons.begin();
+ const QLinkedList<KUrlNavigatorButton*>::const_iterator itEnd = m_navButtons.end();
bool createButton = false;
const KUrl currentUrl = q->url();
if (isFirstButton) {
// the first URL navigator button should get the name of the
// place instead of the directory name
- const KUrl placeUrl = m_bookmarkSelector->selectedPlaceUrl();
- text = m_bookmarkSelector->selectedPlaceText();
+ const KUrl placeUrl = m_placesSelector->selectedPlaceUrl();
+ text = m_placesSelector->selectedPlaceText();
if (text.isEmpty()) {
if (currentUrl.isLocalFile()) {
text = i18n("Custom Path");
}
}
- UrlNavigatorButton* button = 0;
+ KUrlNavigatorButton* button = 0;
if (createButton) {
- button = new UrlNavigatorButton(idx, q);
+ button = new KUrlNavigatorButton(idx, q);
appendWidget(button);
}
else {
} while (hasNext);
// delete buttons which are not used anymore
- QLinkedList<UrlNavigatorButton*>::iterator itBegin = it;
+ QLinkedList<KUrlNavigatorButton*>::iterator itBegin = it;
while (it != itEnd) {
(*it)->close();
(*it)->deleteLater();
m_navButtons.erase(itBegin, m_navButtons.end());
}
-void UrlNavigator::Private::deleteButtons()
+void KUrlNavigator::Private::deleteButtons()
{
- QLinkedList<UrlNavigatorButton*>::iterator itBegin = m_navButtons.begin();
- QLinkedList<UrlNavigatorButton*>::iterator itEnd = m_navButtons.end();
- QLinkedList<UrlNavigatorButton*>::iterator it = itBegin;
+ QLinkedList<KUrlNavigatorButton*>::iterator itBegin = m_navButtons.begin();
+ QLinkedList<KUrlNavigatorButton*>::iterator itEnd = m_navButtons.end();
+ QLinkedList<KUrlNavigatorButton*>::iterator it = itBegin;
while (it != itEnd) {
(*it)->close();
(*it)->deleteLater();
////
-UrlNavigator::UrlNavigator(KFilePlacesModel* placesModel,
+KUrlNavigator::KUrlNavigator(KFilePlacesModel* placesModel,
const KUrl& url,
QWidget* parent) :
QWidget(parent),
d->updateContent();
}
-UrlNavigator::~UrlNavigator()
+KUrlNavigator::~KUrlNavigator()
{
delete d;
}
-const KUrl& UrlNavigator::url() const
+const KUrl& KUrlNavigator::url() const
{
assert(!d->m_history.empty());
return d->m_history[d->m_historyIndex].url();
}
-KUrl UrlNavigator::url(int index) const
+KUrl KUrlNavigator::url(int index) const
{
assert(index >= 0);
// keep scheme, hostname etc. maybe we will need this in the future
return newurl;
}
-QPoint UrlNavigator::savedPosition() const
+QPoint KUrlNavigator::savedPosition() const
{
const HistoryElem& histElem = d->m_history[d->m_historyIndex];
return QPoint( histElem.contentsX(), histElem.contentsY() );
}
-int UrlNavigator::historySize() const
+int KUrlNavigator::historySize() const
{
return d->m_history.count();
}
-void UrlNavigator::goBack()
+void KUrlNavigator::goBack()
{
d->updateHistoryElem();
}
}
-void UrlNavigator::goForward()
+void KUrlNavigator::goForward()
{
if (d->m_historyIndex > 0) {
--d->m_historyIndex;
}
}
-void UrlNavigator::goUp()
+void KUrlNavigator::goUp()
{
setUrl(url().upUrl());
}
-void UrlNavigator::goHome()
+void KUrlNavigator::goHome()
{
if (d->m_homeUrl.isEmpty())
setUrl(QDir::homePath());
setUrl(d->m_homeUrl);
}
-bool UrlNavigator::isUrlEditable() const
+bool KUrlNavigator::isUrlEditable() const
{
return d->m_toggleButton->isChecked();
}
-void UrlNavigator::setUrlEditable(bool editable)
+void KUrlNavigator::setUrlEditable(bool editable)
{
if (isUrlEditable() != editable) {
d->m_toggleButton->toggle();
}
}
-void UrlNavigator::setActive(bool active)
+void KUrlNavigator::setActive(bool active)
{
if (active != d->m_active) {
d->m_active = active;
}
}
-void UrlNavigator::setShowHiddenFiles( bool show )
+void KUrlNavigator::setShowHiddenFiles( bool show )
{
d->m_showHiddenFiles = show;
}
-void UrlNavigator::dropUrls(const KUrl::List& urls,
+void KUrlNavigator::dropUrls(const KUrl::List& urls,
const KUrl& destination)
{
emit urlsDropped(urls, destination);
}
-void UrlNavigator::setUrl(const KUrl& url)
+void KUrlNavigator::setUrl(const KUrl& url)
{
QString urlStr(url.pathOrUrl());
/* kDebug() << "history starting ====================" << endl;
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, ++i)
{
requestActivation();
}
-void UrlNavigator::requestActivation()
+void KUrlNavigator::requestActivation()
{
setActive(true);
}
-void UrlNavigator::storeContentsPosition(int x, int y)
+void KUrlNavigator::storeContentsPosition(int x, int y)
{
HistoryElem& hist = d->m_history[d->m_historyIndex];
hist.setContentsX(x);
hist.setContentsY(y);
}
-void UrlNavigator::keyReleaseEvent(QKeyEvent* event)
+void KUrlNavigator::keyReleaseEvent(QKeyEvent* event)
{
QWidget::keyReleaseEvent(event);
if (isUrlEditable() && (event->key() == Qt::Key_Escape)) {
}
}
-void UrlNavigator::mouseReleaseEvent(QMouseEvent* event)
+void KUrlNavigator::mouseReleaseEvent(QMouseEvent* event)
{
if (event->button() == Qt::MidButton) {
QClipboard* clipboard = QApplication::clipboard();
QWidget::mouseReleaseEvent(event);
}
-bool UrlNavigator::isActive() const
+bool KUrlNavigator::isActive() const
{
return d->m_active;
}
-bool UrlNavigator::showHiddenFiles() const
+bool KUrlNavigator::showHiddenFiles() const
{
return d->m_showHiddenFiles;
}
-void UrlNavigator::setHomeUrl(const QString& homeUrl)
+void KUrlNavigator::setHomeUrl(const QString& homeUrl)
{
d->m_homeUrl = homeUrl;
}
-#include "urlnavigator.moc"
+#include "kurlnavigator.moc"
* Copyright (C) 2006 by Peter Penz (<peter.penz@gmx.at>) *
* Copyright (C) 2006 by Aaron J. Seigo (<aseigo@kde.org>) *
* 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 *
* it under the terms of the GNU General Public License as published by *
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef URLNAVIGATOR_H
-#define URLNAVIGATOR_H
+#ifndef KURLNAVIGATOR_H
+#define KURLNAVIGATOR_H
#include <kurl.h>
#include <QWidget>
* The URL navigator also remembers the URL history and allows to go
* back and forward within this history.
*/
-class UrlNavigator : public QWidget
+class KUrlNavigator : public QWidget
{
Q_OBJECT
public:
- UrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
- virtual ~UrlNavigator();
+ KUrlNavigator(KFilePlacesModel* placesModel, const KUrl& url, QWidget* parent);
+ virtual ~KUrlNavigator();
/** Returns the current active URL. */
const KUrl& url() const;
class Private;
Private* const d;
- Q_DISABLE_COPY( UrlNavigator )
+ Q_DISABLE_COPY( KUrlNavigator )
};
#endif
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#include "urlnavigatorbutton.h"
+#include "kurlnavigatorbutton_p.h"
#include <assert.h>
-#include "urlnavigator.h"
+#include "kurlnavigator.h"
#include <kio/job.h>
#include <kio/jobclasses.h>
#include <QPaintEvent>
#include <QTimer>
-UrlNavigatorButton::UrlNavigatorButton(int index, UrlNavigator* parent) :
- UrlButton(parent),
+KUrlNavigatorButton::KUrlNavigatorButton(int index, KUrlNavigator* parent) :
+ KUrlButton(parent),
m_index(-1),
m_popupDelay(0),
m_listJob(0)
connect(this, SIGNAL(pressed()), this, SLOT(startPopupDelay()));
}
-UrlNavigatorButton::~UrlNavigatorButton()
+KUrlNavigatorButton::~KUrlNavigatorButton()
{
}
-void UrlNavigatorButton::setIndex(int index)
+void KUrlNavigatorButton::setIndex(int index)
{
m_index = index;
update();
}
-QSize UrlNavigatorButton::sizeHint() const
+QSize KUrlNavigatorButton::sizeHint() const
{
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);
painter.setClipRect(event->rect());
}
}
-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
// be shown as tooltip
}
}
-void UrlNavigatorButton::leaveEvent(QEvent* event)
+void KUrlNavigatorButton::leaveEvent(QEvent* event)
{
- UrlButton::leaveEvent(event);
+ KUrlButton::leaveEvent(event);
setToolTip(QString());
}
-void UrlNavigatorButton::dropEvent(QDropEvent* event)
+void KUrlNavigatorButton::dropEvent(QDropEvent* event)
{
if (m_index < 0) {
return;
}
}
-void UrlNavigatorButton::dragEnterEvent(QDragEnterEvent* event)
+void KUrlNavigatorButton::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasUrls()) {
setDisplayHintEnabled(DraggedHint, true);
}
}
-void UrlNavigatorButton::dragLeaveEvent(QDragLeaveEvent* event)
+void KUrlNavigatorButton::dragLeaveEvent(QDragLeaveEvent* event)
{
- UrlButton::dragLeaveEvent(event);
+ KUrlButton::dragLeaveEvent(event);
setDisplayHintEnabled(DraggedHint, false);
update();
}
-void UrlNavigatorButton::updateNavigatorUrl()
+void KUrlNavigatorButton::updateNavigatorUrl()
{
stopPopupDelay();
urlNavigator()->setUrl(urlNavigator()->url(m_index));
}
-void UrlNavigatorButton::startPopupDelay()
+void KUrlNavigatorButton::startPopupDelay()
{
if (m_popupDelay->isActive() || (m_listJob != 0) || (m_index < 0)) {
return;
m_popupDelay->start(300);
}
-void UrlNavigatorButton::stopPopupDelay()
+void KUrlNavigatorButton::stopPopupDelay()
{
m_popupDelay->stop();
if (m_listJob != 0) {
}
}
-void UrlNavigatorButton::startListJob()
+void KUrlNavigatorButton::startListJob()
{
if (m_listJob != 0) {
return;
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) {
return;
m_subdirs.sort();
}
-void UrlNavigatorButton::listJobFinished(KJob* job)
+void KUrlNavigatorButton::listJobFinished(KJob* job)
{
if (job != m_listJob) {
return;
setDisplayHintEnabled(PopupActiveHint, false);
}
-int UrlNavigatorButton::arrowWidth() const
+int KUrlNavigatorButton::arrowWidth() const
{
int width = (height() / 2) - 7;
if (width < 4) {
return width;
}
-bool UrlNavigatorButton::isTextClipped() const
+bool KUrlNavigatorButton::isTextClipped() const
{
int availableWidth = width();
if (!isDisplayHintEnabled(ActivatedHint)) {
return fontMetrics.width(text()) >= availableWidth;
}
-#include "urlnavigatorbutton.moc"
+#include "kurlnavigatorbutton_p.moc"
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
***************************************************************************/
-#ifndef URLNAVIGATORBUTTON_H
-#define URLNAVIGATORBUTTON_H
+#ifndef KURLNAVIGATORBUTTON_P_H
+#define KURLNAVIGATORBUTTON_P_H
#include <kio/global.h>
-#include "urlbutton.h"
+#include "kurlbutton_p.h"
class KJob;
class KUrl;
-class UrlNavigator;
+class KUrlNavigator;
class QPainter;
class QPaintEvent;
* to copy, move or link the dropped items to the URL part indicated by
* the button.
*/
-class UrlNavigatorButton : public UrlButton
+class KUrlNavigatorButton : public KUrlButton
{
Q_OBJECT
public:
- explicit UrlNavigatorButton(int index, UrlNavigator* parent);
- virtual ~UrlNavigatorButton();
+ explicit KUrlNavigatorButton(int index, KUrlNavigator* parent);
+ virtual ~KUrlNavigatorButton();
void setIndex(int index);
int index() const { return m_index; }