#include <kparts/part.h>
#include <kfileitem.h>
#include <kfileitemdelegate.h>
-#include <konq_fileundomanager.h>
+#include <kio/fileundomanager.h>
#include <kio/job.h>
#include <QBoxLayout>
class DolphinController;
class DolphinColumnView;
class DolphinDetailsView;
-class DolphinFileItemDelegate;
class DolphinIconsView;
class DolphinMainWindow;
class DolphinModel;
class KFileItemDelegate;
class KUrl;
class KToggleAction;
+class ToolTipManager;
class QModelIndex;
class ViewProperties;
*/
KUrl::List selectedUrls() const;
- /**
- * Returns the file item for the given model index \a index.
- */
- KFileItem fileItem(const QModelIndex& index) const;
-
/**
* Sets the upper left position of the view content
* to (x,y). The content of the view might be larger than the visible area
*/
QPair<bool, QString> pasteInfo() const;
+ /**
+ * If \a tabsForFiles is true, the signal tabRequested() will also
+ * emitted also for files. Per default tabs for files is disabled
+ * and hence the signal tabRequested() will only be emitted for
+ * directories.
+ */
+ void setTabsForFilesEnabled(bool tabsForFiles);
+ bool isTabsForFilesEnabled() const;
+
public slots:
/**
* Changes the directory to \a url. If the current directory is equal to
/** Pastes the clipboard data to this view. */
void paste();
+ /**
+ * Pastes the clipboard data into the currently selected
+ * folder. If the current selection is not exactly one folder, no
+ * paste operation is done.
+ */
+ void pasteIntoFolder();
+
/**
* Turns on the file preview for the all files of the current directory,
* if \a show is true.
void urlChanged(const KUrl& url);
/**
- * Is emitted when clicking on an item
+ * Is emitted if the view requests a changing of the current
+ * URL to \a url (see DolphinController::triggerUrlChangeRequest()).
+ */
+ void requestUrlChange(const KUrl& url);
+
+ /**
+ * Is emitted when clicking on an item with the left mouse button.
*/
void itemTriggered(const KFileItem& item);
+ /**
+ * Is emitted if a new tab should be opened for the URL \a url.
+ */
+ void tabRequested(const KUrl& url);
+
/**
* Is emitted if the view mode (IconsView, DetailsView,
* PreviewsView) has been changed.
* Is emitted when renaming, copying, moving, linking etc.
* Used for feedback in the mainwindow.
*/
- void doingOperation(KonqFileUndoManager::CommandType type);
+ void doingOperation(KIO::FileUndoManager::CommandType type);
protected:
/** @see QWidget::mouseReleaseEvent */
*/
void slotDeleteFileFinished(KJob* job);
+ /**
+ * Called when KDirLister emits redirection.
+ * Testcase: fish://localhost
+ */
+ void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
+
+ /**
+ * Is emitted if the controller requests a changing of the current
+ * URL to \a url
+ */
+ void slotRequestUrlChange(const KUrl& url);
+
+ /**
+ * Restores the current item (= item that has the keyboard focus)
+ * to m_currentItemUrl.
+ */
+ void restoreCurrentItem();
+
private:
void loadDirectory(const KUrl& url, bool reload = false);
*/
bool isCutItem(const KFileItem& item) const;
+ /**
+ * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
+ * Pastes the clipboard data into the URL \a url.
+ */
+ void pasteToUrl(const KUrl& url);
+
/**
* Returns true, if the ColumnView is activated. As the column view
* requires some special handling for iterating through directories,
}
private:
- bool m_active;
- bool m_showPreview;
- bool m_loadingDirectory;
- bool m_storedCategorizedSorting;
+ bool m_active : 1;
+ bool m_showPreview : 1;
+ bool m_loadingDirectory : 1;
+ bool m_storedCategorizedSorting : 1;
+ bool m_tabsForFiles : 1;
+ bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue 207192
+
Mode m_mode;
DolphinMainWindow* m_mainWindow;
DolphinIconsView* m_iconsView;
DolphinDetailsView* m_detailsView;
DolphinColumnView* m_columnView;
- DolphinFileItemDelegate* m_fileItemDelegate;
+ KFileItemDelegate* m_fileItemDelegate;
QItemSelectionModel* m_selectionModel;
DolphinModel* m_dolphinModel;
DolphinSortFilterProxyModel* m_proxyModel;
IconManager* m_iconManager;
+ ToolTipManager* m_toolTipManager;
KUrl m_rootUrl;
+ KUrl m_currentItemUrl;
};
/// Allow using DolphinView::Mode in QVariant