X-Git-Url: https://cloud.milkyroute.net/gitweb/dolphin.git/blobdiff_plain/d9d7926c49c097fd1f5b72576e2c84c3989e89e7..0c8ef2977e2285676fb4c2ee1fdcb1e641c1acd7:/src/views/dolphinview.h diff --git a/src/views/dolphinview.h b/src/views/dolphinview.h index 9435206d9..6b62b5da6 100644 --- a/src/views/dolphinview.h +++ b/src/views/dolphinview.h @@ -23,14 +23,14 @@ #include -#include "libdolphin_export.h" +#include "dolphin_export.h" #include #include #include #include -#include - +#include +#include #include typedef KIO::FileUndoManager::CommandType CommandType; @@ -40,7 +40,6 @@ class KFileItemModel; class KItemListContainer; class KItemModelBase; class KItemSet; -class KUrl; class ToolTipManager; class VersionControlObserver; class ViewProperties; @@ -58,7 +57,7 @@ class QRegExp; * - show previews * - enable grouping */ -class LIBDOLPHINPRIVATE_EXPORT DolphinView : public QWidget +class DOLPHIN_EXPORT DolphinView : public QWidget { Q_OBJECT @@ -304,14 +303,14 @@ public: * @return a valid and adjusted url if the item can be opened as folder, * otherwise return an empty url. */ - static KUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true); + static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true); public slots: /** * Changes the directory to \a url. If the current directory is equal to * \a url, nothing will be done (use DolphinView::reload() instead). */ - void setUrl(const KUrl& url); + void setUrl(const QUrl& url); /** * Selects all items. @@ -363,10 +362,15 @@ public slots: */ void pasteIntoFolder(); + /** + * Handles a drop of @p dropEvent onto @p destUrl + */ + void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent); + void stopLoading(); /** Activates the view if the item list container gets focus. */ - virtual bool eventFilter(QObject* watched, QEvent* event); + virtual bool eventFilter(QObject* watched, QEvent* event) Q_DECL_OVERRIDE; signals: /** @@ -374,15 +378,8 @@ signals: */ void activated(); - /** - * Is emitted if the URL of the view will be changed to \a url. - * After the URL has been changed the signal urlChanged() will - * be emitted. - */ - void urlAboutToBeChanged(const KUrl& url); - /** Is emitted if the URL of the view has been changed to \a url. */ - void urlChanged(const KUrl& url); + void urlChanged(const QUrl& url); /** * Is emitted when clicking on an item with the left mouse button. @@ -403,7 +400,7 @@ signals: /** * Is emitted if a new tab should be opened for the URL \a url. */ - void tabRequested(const KUrl& url); + void tabRequested(const QUrl& url); /** * Is emitted if the view mode (IconsView, DetailsView, @@ -458,7 +455,7 @@ signals: */ void requestContextMenu(const QPoint& pos, const KFileItem& item, - const KUrl& url, + const QUrl& url, const QList& customActions); /** @@ -515,13 +512,13 @@ signals: * Emitted when the file-item-model emits redirection. * Testcase: fish://localhost */ - void redirection(const KUrl& oldUrl, const KUrl& newUrl); + void redirection(const QUrl& oldUrl, const QUrl& newUrl); /** * Is emitted when the URL set by DolphinView::setUrl() represents a file. * In this case no signal errorMessage() will be emitted. */ - void urlIsFileError(const KUrl& url); + void urlIsFileError(const QUrl& url); /** * Is emitted when the write state of the folder has been changed. The application @@ -542,13 +539,23 @@ signals: */ void goForwardRequested(); + /** + * Is emitted when the user wants to move the focus to another view. + */ + void toggleActiveViewRequested(); + + /** + * Is emitted when the user clicks a tag or a link + * in the metadata widget of a tooltip. + */ + void urlActivated(const QUrl& url); + protected: /** Changes the zoom level if Control is pressed during a wheel event. */ - virtual void wheelEvent(QWheelEvent* event); + virtual void wheelEvent(QWheelEvent* event) Q_DECL_OVERRIDE; - /** @reimp */ - virtual void hideEvent(QHideEvent* event); - virtual bool event(QEvent* event); + virtual void hideEvent(QHideEvent* event) Q_DECL_OVERRIDE; + virtual bool event(QEvent* event) Q_DECL_OVERRIDE; private slots: /** @@ -563,7 +570,7 @@ private slots: void slotItemContextMenuRequested(int index, const QPointF& pos); void slotViewContextMenuRequested(const QPointF& pos); void slotHeaderContextMenuRequested(const QPointF& pos); - void slotHeaderColumnWidthChanged(const QByteArray& role, qreal current, qreal previous); + void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current); void slotItemHovered(int index); void slotItemUnhovered(int index); void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event); @@ -573,7 +580,11 @@ private slots: /* * Is called when new items get pasted or dropped. */ - void slotAboutToCreate(const QList &urls); + void slotItemCreated(const QUrl &url); + /* + * Is called after all pasted or dropped items have been copied to destination. + */ + void slotPasteJobResult(KJob *job); /** * Emits the signal \a selectionChanged() with a small delay. This is @@ -696,7 +707,7 @@ private slots: void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const; private: - void loadDirectory(const KUrl& url, bool reload = false); + void loadDirectory(const QUrl& url, bool reload = false); /** * Applies the view properties which are defined by the current URL @@ -721,14 +732,14 @@ private: * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder(). * Pastes the clipboard data into the URL \a url. */ - void pasteToUrl(const KUrl& url); + void pasteToUrl(const QUrl& url); /** * Returns a list of URLs for all selected items. The list is * simplified, so that when the URLs are part of different tree * levels, only the parent is returned. */ - KUrl::List simplifiedSelectedUrls() const; + QList simplifiedSelectedUrls() const; /** * Returns the MIME data for all selected items. @@ -747,9 +758,11 @@ private: * DolphinView::viewPropertiesContext(), otherwise the context * is returned. */ - KUrl viewPropertiesUrl() const; + QUrl viewPropertiesUrl() const; private: + void updatePalette(); + bool m_active; bool m_tabsForFiles; bool m_assureVisibleCurrentIndex; @@ -757,7 +770,7 @@ private: bool m_dragging; // True if a dragging is done. Required to be able to decide whether a // tooltip may be shown when hovering an item. - KUrl m_url; + QUrl m_url; QString m_viewPropertiesContext; Mode m_mode; QList m_visibleRoles;