[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdelibs/kfile
From: Peter Penz <peter.penz () gmx ! at>
Date: 2010-04-22 14:54:07
Message-ID: 20100422145407.12CC7AC8A0 () svn ! kde ! org
[Download RAW message or body]
SVN commit 1117591 by ppenz:
Assure that each private class of KUrlNavigator gets a KUrlNavigator prefix (although \
all cyclic dependencies from the private classes to KUrlNavigator have been removed, \
they are still KUrlNavigator specific classes)
M +5 -5 CMakeLists.txt
D kfileplacesselector.cpp
D kfileplacesselector_p.h
D kprotocolcombo.cpp
D kprotocolcombo_p.h
D kurlbutton.cpp
D kurlbutton_p.h
D kurldropdownbutton.cpp
D kurldropdownbutton_p.h
M +19 -19 kurlnavigator.cpp
M +11 -11 kurlnavigatorbutton.cpp
M +3 -5 kurlnavigatorbutton_p.h
A kurlnavigatorbuttonbase.cpp kurlbutton.cpp#1117555 [License: LGPL \
(v2+)] A kurlnavigatorbuttonbase_p.h kurlbutton_p.h#1117555 [License: \
LGPL (v2+)] A kurlnavigatordropdownbutton.cpp \
kurldropdownbutton.cpp#1117555 [License: LGPL (v2+)] A \
kurlnavigatordropdownbutton_p.h kurldropdownbutton_p.h#1117555 [License: LGPL \
(v2+)] M +13 -14 kurlnavigatormenu.cpp
M +13 -18 kurlnavigatormenu_p.h
A kurlnavigatorplacesselector.cpp kfileplacesselector.cpp#1117555 \
[License: LGPL (v2+)] A kurlnavigatorplacesselector_p.h \
kfileplacesselector_p.h#1117555 [License: LGPL (v2+)] A \
kurlnavigatorprotocolcombo.cpp kprotocolcombo.cpp#1117555 [License: LGPL (v2+)] A \
kurlnavigatorprotocolcombo_p.h kprotocolcombo_p.h#1117555 [License: LGPL (v2+)] A \
kurlnavigatortogglebutton.cpp kurltogglebutton.cpp#1117555 [License: LGPL (v2+)] A \
kurlnavigatortogglebutton_p.h kurltogglebutton_p.h#1117555 [License: LGPL (v2+)] D \
kurltogglebutton.cpp D kurltogglebutton_p.h
--- trunk/KDE/kdelibs/kfile/CMakeLists.txt #1117590:1117591
@@ -21,18 +21,18 @@
kfileplacesitem.cpp
kfileplacesmodel.cpp
kfileplacessharedbookmarks.cpp
- kfileplacesselector.cpp
kfileplacesview.cpp
kfileplaceeditdialog.cpp
kfilepreviewgenerator.cpp
knameandurlinputdialog.cpp
knewfilemenu.cpp
- kprotocolcombo.cpp
- kurlbutton.cpp
- kurldropdownbutton.cpp
+ kurlnavigatordropdownbutton.cpp
+ kurlnavigatorbuttonbase.cpp
kurlnavigatorbutton.cpp
+ kurlnavigatorplacesselector.cpp
+ kurlnavigatorprotocolcombo.cpp
+ kurlnavigatortogglebutton.cpp
kurlnavigator.cpp
- kurltogglebutton.cpp
kurlnavigatormenu.cpp
)
--- trunk/KDE/kdelibs/kfile/kurlnavigator.cpp #1117590:1117591
@@ -22,11 +22,11 @@
#include "kurlnavigator.h"
-#include "kfileplacesselector_p.h"
-#include "kprotocolcombo_p.h"
-#include "kurldropdownbutton_p.h"
+#include "kurlnavigatorplacesselector_p.h"
+#include "kurlnavigatorprotocolcombo_p.h"
+#include "kurlnavigatordropdownbutton_p.h"
#include "kurlnavigatorbutton_p.h"
-#include "kurltogglebutton_p.h"
+#include "kurlnavigatortogglebutton_p.h"
#include <kfileitem.h>
#include <kfileplacesmodel.h>
@@ -166,13 +166,13 @@
QHBoxLayout* m_layout;
QList<LocationData> m_history;
- KFilePlacesSelector* m_placesSelector;
+ KUrlNavigatorPlacesSelector* m_placesSelector;
KUrlComboBox* m_pathBox;
- KProtocolCombo* m_protocols;
+ KUrlNavigatorProtocolCombo* m_protocols;
KLineEdit* m_host;
- KUrlDropDownButton* m_dropDownButton;
+ KUrlNavigatorDropDownButton* m_dropDownButton;
QList<KUrlNavigatorButton*> m_navButtons;
- KUrlButton* m_toggleEditableMode;
+ KUrlNavigatorButtonBase* m_toggleEditableMode;
KUrl m_homeUrl;
QStringList m_customProtocols;
KUrlNavigator* q;
@@ -204,7 +204,7 @@
q->setAutoFillBackground(false);
if (placesModel != 0) {
- m_placesSelector = new KFilePlacesSelector(q, placesModel);
+ m_placesSelector = new KUrlNavigatorPlacesSelector(q, placesModel);
connect(m_placesSelector, SIGNAL(placeActivated(const KUrl&)),
q, SLOT(setUrl(const KUrl&)));
@@ -217,7 +217,7 @@
}
// create protocol combo
- m_protocols = new KProtocolCombo(QString(), q);
+ m_protocols = new KUrlNavigatorProtocolCombo(QString(), q);
connect(m_protocols, SIGNAL(activated(QString)),
q, SLOT(slotProtocolChanged(QString)));
@@ -230,7 +230,7 @@
q, SIGNAL(returnPressed()));
// create drop down button for accessing all paths of the URL
- m_dropDownButton = new KUrlDropDownButton(q);
+ m_dropDownButton = new KUrlNavigatorDropDownButton(q);
connect(m_dropDownButton, SIGNAL(clicked()),
q, SLOT(openPathSelectorMenu()));
@@ -250,7 +250,7 @@
// create toggle button which allows to switch between
// the breadcrumb and traditional view
- m_toggleEditableMode = new KUrlToggleButton(q);
+ m_toggleEditableMode = new KUrlNavigatorToggleButton(q);
m_toggleEditableMode->setMinimumWidth(20);
connect(m_toggleEditableMode, SIGNAL(clicked()),
q, SLOT(switchView()));
@@ -355,7 +355,7 @@
}
m_navButtons.clear();
- if (KProtocolInfo::protocolClass(protocol) == ":local") {
+ if (KProtocolInfo::protocolClass(protocol) == QLatin1String(":local")) {
q->setLocationUrl(url);
} else {
m_host->setText(QString());
@@ -377,13 +377,13 @@
popup->setLayoutDirection(Qt::LeftToRight);
const QString placePath = retrievePlacePath();
- int idx = placePath.count('/'); // idx points to the first directory
- // after the place path
+ int idx = placePath.count(QLatin1Char('/')); // idx points to the first \
directory + // after the place path
const QString path = m_history[m_historyIndex].url.pathOrUrl();
- QString dirName = path.section('/', idx, idx);
+ QString dirName = path.section(QLatin1Char('/'), idx, idx);
if (dirName.isEmpty()) {
- dirName = QChar('/');
+ dirName = QLatin1Char('/');
}
do {
const QString text = spacer + dirName;
@@ -585,7 +585,7 @@
void KUrlNavigator::Private::updateButtons(int startIndex)
{
KUrl currentUrl = q->locationUrl();
- if (currentUrl.protocol() == "nepomuksearch") {
+ if (currentUrl.protocol() == QLatin1String("nepomuksearch")) {
// hide the Nepomuk search URL from the user
currentUrl = KUrl("nepomuksearch:/");
startIndex = -1;
@@ -1049,7 +1049,7 @@
urlStr.insert(0, QDir::homePath());
}
- if ((url.protocol() == "tar") || (url.protocol() == "zip")) {
+ if ((url.protocol() == QLatin1String("tar")) || (url.protocol() == \
QLatin1String("zip"))) { // The URL represents a tar- or zip-file. Check whether
// the URL is really part of the tar- or zip-file, otherwise
// replace it by the local path again.
--- trunk/KDE/kdelibs/kfile/kurlnavigatorbutton.cpp #1117590:1117591
@@ -37,8 +37,8 @@
QPointer<KUrlNavigatorMenu> KUrlNavigatorButton::m_dirsMenu;
-KUrlNavigatorButton::KUrlNavigatorButton(const KUrl& url, KUrlNavigator* parent) :
- KUrlButton(parent),
+KUrlNavigatorButton::KUrlNavigatorButton(const KUrl& url, QWidget* parent) :
+ KUrlNavigatorButtonBase(parent),
m_hoverArrow(false),
m_pendingTextChange(false),
m_wheelSteps(0),
@@ -91,7 +91,7 @@
// Assure that the button always consists of one line
adjustedText.remove(QLatin1Char('\n'));
- KUrlButton::setText(adjustedText);
+ KUrlNavigatorButtonBase::setText(adjustedText);
updateMinimumWidth();
// Assure that statFinished() does not overwrite a text that has been
@@ -120,7 +120,7 @@
// the minimum size is textWidth + arrowWidth() + 2 * BorderWidth; for the
// preferred size we add the BorderWidth 2 times again for having an uncluttered \
look
const int width = fontMetrics().width(text()) + arrowWidth() + 4 * BorderWidth;
- return QSize(width, KUrlButton::sizeHint().height());
+ return QSize(width, KUrlNavigatorButtonBase::sizeHint().height());
}
void KUrlNavigatorButton::paintEvent(QPaintEvent* event)
@@ -211,7 +211,7 @@
void KUrlNavigatorButton::enterEvent(QEvent* event)
{
- KUrlButton::enterEvent(event);
+ KUrlNavigatorButtonBase::enterEvent(event);
// if the text is clipped due to a small window width, the text should
// be shown as tooltip
@@ -222,7 +222,7 @@
void KUrlNavigatorButton::leaveEvent(QEvent* event)
{
- KUrlButton::leaveEvent(event);
+ KUrlNavigatorButtonBase::leaveEvent(event);
setToolTip(QString());
if (m_hoverArrow) {
@@ -283,7 +283,7 @@
void KUrlNavigatorButton::dragLeaveEvent(QDragLeaveEvent* event)
{
- KUrlButton::dragLeaveEvent(event);
+ KUrlNavigatorButtonBase::dragLeaveEvent(event);
m_hoverArrow = false;
setDisplayHintEnabled(DraggedHint, false);
@@ -296,7 +296,7 @@
// the mouse is pressed above the [>] button
startListJob();
}
- KUrlButton::mousePressEvent(event);
+ KUrlNavigatorButtonBase::mousePressEvent(event);
}
void KUrlNavigatorButton::mouseReleaseEvent(QMouseEvent* event)
@@ -306,12 +306,12 @@
// above the [>] button
emit clicked(m_url, event->button());
}
- KUrlButton::mouseReleaseEvent(event);
+ KUrlNavigatorButtonBase::mouseReleaseEvent(event);
}
void KUrlNavigatorButton::mouseMoveEvent(QMouseEvent* event)
{
- KUrlButton::mouseMoveEvent(event);
+ KUrlNavigatorButtonBase::mouseMoveEvent(event);
const bool hoverArrow = isAboveArrow(event->x());
if (hoverArrow != m_hoverArrow) {
@@ -327,7 +327,7 @@
startCycleJob();
event->accept();
} else {
- KUrlButton::wheelEvent(event);
+ KUrlNavigatorButtonBase::wheelEvent(event);
}
}
--- trunk/KDE/kdelibs/kfile/kurlnavigatorbutton_p.h #1117590:1117591
@@ -21,7 +21,7 @@
#ifndef KURLNAVIGATORBUTTON_P_H
#define KURLNAVIGATORBUTTON_P_H
-#include "kurltogglebutton_p.h"
+#include "kurlnavigatorbuttonbase_p.h"
#include "kurlnavigatormenu_p.h"
#include <kio/global.h>
@@ -31,7 +31,6 @@
#include <QPointer>
class KJob;
-class KUrlNavigator;
class QDropEvent;
class QPaintEvent;
@@ -48,13 +47,12 @@
* to copy, move or link the dropped items to the URL part indicated by
* the button.
*/
-class KUrlNavigatorButton : public KUrlButton
+class KUrlNavigatorButton : public KUrlNavigatorButtonBase
{
Q_OBJECT
public:
- // TODO KDE 4.5: get rid of KUrlNavigator dependency
- explicit KUrlNavigatorButton(const KUrl& url, KUrlNavigator* parent);
+ explicit KUrlNavigatorButton(const KUrl& url, QWidget* parent);
virtual ~KUrlNavigatorButton();
void setUrl(const KUrl& url);
--- trunk/KDE/kdelibs/kfile/kurlnavigatormenu.cpp #1117590:1117591
@@ -1,21 +1,21 @@
/*
- Copyright (C) 2009 by Rahman Duran <rahman.duran@gmail.com>
-
+ Copyright (C) 2009 by Rahman Duran <rahman.duran@gmail.com>
+
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2 of the License or
- ( at your option ) version 3 or, at the discretion of KDE e.V.
+ by the Free Software Foundation; either version 2 of the License or
+ ( at your option ) version 3 or, at the discretion of KDE e.V.
( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
@@ -23,7 +23,6 @@
#include <QtGui/QKeyEvent>
-
KUrlNavigatorMenu::KUrlNavigatorMenu(QWidget* parent) :
KMenu(parent)
{
@@ -37,13 +36,13 @@
void KUrlNavigatorMenu::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasUrls()) {
- event->acceptProposedAction();
- }
+ event->acceptProposedAction();
+ }
}
void KUrlNavigatorMenu::dragMoveEvent(QDragMoveEvent* event)
-{
- QMouseEvent mouseEvent(QMouseEvent(QEvent::MouseMove, event->pos(),
+{
+ QMouseEvent mouseEvent(QMouseEvent(QEvent::MouseMove, event->pos(),
Qt::LeftButton, event->mouseButtons(), event->keyboardModifiers()));
mouseMoveEvent(&mouseEvent);
}
--- trunk/KDE/kdelibs/kfile/kurlnavigatormenu_p.h #1117590:1117591
@@ -1,21 +1,21 @@
/*
- Copyright (C) 2009 by Rahman Duran <rahman.duran@gmail.com>
-
+ Copyright (C) 2009 by Rahman Duran <rahman.duran@gmail.com>
+
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Library General Public License as published
- by the Free Software Foundation; either version 2 of the License or
- ( at your option ) version 3 or, at the discretion of KDE e.V.
+ by the Free Software Foundation; either version 2 of the License or
+ ( at your option ) version 3 or, at the discretion of KDE e.V.
( which shall act as a proxy as in section 14 of the GPLv3 ), any later version.
This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Library General Public License for more details.
+ Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
- along with this library; see the file COPYING.LIB. If not, write to
- the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
- Boston, MA 02110-1301, USA.
+ along with this library; see the file COPYING.LIB. If not, write to
+ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ Boston, MA 02110-1301, USA.
*/
#ifndef KURLNAVIGATORMENU_P_H
@@ -24,9 +24,9 @@
#include <kmenu.h>
/**
- * @brief Base class for drop-down url menus of the URL navigator.
+ * @brief Provides drop-down menus for the URL navigator.
*
- * This menu acts like KMenu with drag&drop support.
+ * The implementation extends KMenu with drag & drop support.
*/
class KUrlNavigatorMenu : public KMenu
{
@@ -35,9 +35,8 @@
public:
explicit KUrlNavigatorMenu(QWidget* parent);
virtual ~KUrlNavigatorMenu();
-
-Q_SIGNALS:
+Q_SIGNALS:
/**
* Is emitted when drop event occurs.
*/
@@ -46,11 +45,7 @@
protected:
virtual void dragEnterEvent(QDragEnterEvent* event);
virtual void dragMoveEvent(QDragMoveEvent* event);
- virtual void dropEvent(QDropEvent* event);
-
-private:
-
+ virtual void dropEvent(QDropEvent* event);
};
-
#endif
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic