2 * SPDX-FileCopyrightText: 2006-2009 Peter Penz <peter.penz19@gmail.com>
3 * SPDX-FileCopyrightText: 2006 Gregor Kališnik <gregor@podnapisi.net>
5 * SPDX-License-Identifier: GPL-2.0-or-later
11 #include "dolphin_export.h"
12 #include "dolphintabwidget.h"
13 #include "tooltips/tooltipmanager.h"
15 #include "config-dolphin.h"
18 #include <kio/fileundomanager.h>
19 #include <kparts/part.h>
28 typedef KIO::FileUndoManager::CommandType CommandType
;
30 class DolphinItemListView
;
32 class KItemListContainer
;
36 class VersionControlObserver
;
39 class QGraphicsSceneDragDropEvent
;
42 class QRegularExpression
;
45 * @short Represents a view for the directory content.
47 * View modes for icons, compact and details are supported. It's
55 class DOLPHIN_EXPORT DolphinView
: public QWidget
61 * Defines the view mode for a directory. The
62 * view mode is automatically updated if the directory itself
63 * defines a view mode (see class ViewProperties for details).
67 * The items are shown as icons with a name-label below.
72 * The icon, the name and the size of the items are
73 * shown per default as a table.
78 * The items are shown as icons with the name-label aligned
85 * @param url Specifies the content which should be shown.
86 * @param parent Parent widget of the view.
88 DolphinView(const QUrl
&url
, QWidget
*parent
);
90 ~DolphinView() override
;
93 * Returns the current active URL, where all actions are applied.
94 * The URL navigator is synchronized with this URL.
99 * If \a active is true, the view will marked as active. The active
100 * view is defined as view where all actions are applied to.
102 void setActive(bool active
);
103 bool isActive() const;
106 * Changes the view mode for the current directory to \a mode.
107 * If the view properties should be remembered for each directory
108 * (GeneralSettings::globalViewProps() returns false), then the
109 * changed view mode will be stored automatically.
111 void setViewMode(Mode mode
);
112 Mode
viewMode() const;
115 * Enables or disables a mode for quick and easy selection of items.
117 void setSelectionModeEnabled(bool enabled
);
118 bool selectionMode() const;
121 * Turns on the file preview for the all files of the current directory,
122 * if \a show is true.
123 * If the view properties should be remembered for each directory
124 * (GeneralSettings::globalViewProps() returns false), then the
125 * preview setting will be stored automatically.
127 void setPreviewsShown(bool show
);
128 bool previewsShown() const;
131 * Shows all hidden files of the current directory,
132 * if \a show is true.
133 * If the view properties should be remembered for each directory
134 * (GeneralSettings::globalViewProps() returns false), then the
135 * show hidden file setting will be stored automatically.
137 void setHiddenFilesShown(bool show
);
138 bool hiddenFilesShown() const;
141 * Turns on sorting by groups if \a enable is true.
143 void setGroupedSorting(bool grouped
);
144 bool groupedSorting() const;
147 * Returns the items of the view.
149 KFileItemList
items() const;
152 * @return The number of items. itemsCount() is faster in comparison
153 * to items().count().
155 int itemsCount() const;
158 * Returns the selected items. The list is empty if no item has been
161 KFileItemList
selectedItems() const;
164 * Returns the number of selected items (this is faster than
165 * invoking selectedItems().count()).
167 int selectedItemsCount() const;
170 * Marks the items indicated by \p urls to get selected after the
171 * directory DolphinView::url() has been loaded. Note that nothing
172 * gets selected if no loading of a directory has been triggered
173 * by DolphinView::setUrl() or DolphinView::reload().
175 void markUrlsAsSelected(const QList
<QUrl
> &urls
);
178 * Marks the item indicated by \p url to be scrolled to and as the
179 * current item after directory DolphinView::url() has been loaded.
181 void markUrlAsCurrent(const QUrl
&url
);
184 * All items that match the regular expression \a regexp will get selected
185 * if \a enabled is true and deselected if \a enabled is false.
187 * Note that to match the whole string the pattern should be anchored:
188 * - you can anchor the pattern with QRegularExpression::anchoredPattern()
189 * - if you use QRegularExpresssion::wildcardToRegularExpression(), don't use
190 * QRegularExpression::anchoredPattern() as the former already returns an
193 void selectItems(const QRegularExpression
®exp
, bool enabled
);
196 * Sets the zoom level to \a level. It is assured that the used
197 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
198 * ZoomLevelInfo::maximumLevel().
200 void setZoomLevel(int level
);
201 int zoomLevel() const;
204 * Resets the view's icon size to the default value
206 void resetZoomLevel();
208 void setSortRole(const QByteArray
&role
);
209 QByteArray
sortRole() const;
211 void setSortOrder(Qt::SortOrder order
);
212 Qt::SortOrder
sortOrder() const;
214 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
215 void setSortFoldersFirst(bool foldersFirst
);
216 bool sortFoldersFirst() const;
218 /** Sets a separate sorting with hidden files and folders last (true) or not (false). */
219 void setSortHiddenLast(bool hiddenLast
);
220 bool sortHiddenLast() const;
222 /** Sets the additional information which should be shown for the items. */
223 void setVisibleRoles(const QList
<QByteArray
> &roles
);
225 /** Returns the additional information which should be shown for the items. */
226 QList
<QByteArray
> visibleRoles() const;
229 * Refreshes the view to get synchronized with the settings (e.g. icons size,
235 * Saves the current settings (e.g. icons size, font, ..).
237 void writeSettings();
240 * Filters the currently shown items by \a nameFilter. All items
241 * which contain the given filter string will be shown.
243 void setNameFilter(const QString
&nameFilter
);
244 QString
nameFilter() const;
247 * Filters the currently shown items by \a filters. All items
248 * whose content-type matches those given by the list of filters
251 void setMimeTypeFilters(const QStringList
&filters
);
252 QStringList
mimeTypeFilters() const;
255 * Tells the view to generate an updated status bar text. The result
256 * is returned through the statusBarTextChanged(QString statusBarText) signal.
257 * It will carry a textual representation of the state of the current
258 * folder or selected items, suitable for use in the status bar.
259 * Any pending requests of status bar text are killed.
261 void requestStatusBarText();
264 * Returns the version control actions that are provided for the items \p items.
265 * Usually the actions are presented in the context menu.
267 QList
<QAction
*> versionControlActions(const KFileItemList
&items
) const;
270 * Returns the state of the paste action:
271 * first is whether the action should be enabled
272 * second is the text for the action
274 QPair
<bool, QString
> pasteInfo() const;
277 * If \a tabsForFiles is true, the signal tabRequested() will also
278 * emitted also for files. Per default tabs for files is disabled
279 * and hence the signal tabRequested() will only be emitted for
282 void setTabsForFilesEnabled(bool tabsForFiles
);
283 bool isTabsForFilesEnabled() const;
286 * Returns true if the current view allows folders to be expanded,
287 * i.e. presents a hierarchical view to the user.
289 bool itemsExpandable() const;
292 * @returns true if the @p item is one of the items() of this view and
293 * is currently expanded. false otherwise.
294 * Only directories in view modes that allow expanding can ever be expanded.
296 bool isExpanded(const KFileItem
&item
) const;
299 * Restores the view state (current item, contents position, details view expansion state)
301 void restoreState(QDataStream
&stream
);
304 * Saves the view state (current item, contents position, details view expansion state)
306 void saveState(QDataStream
&stream
);
309 * Returns the root item which represents the current URL.
311 KFileItem
rootItem() const;
314 * Sets a context that is used for remembering the view-properties.
315 * Per default the context is empty and the path of the currently set URL
316 * is used for remembering the view-properties. Setting a custom context
317 * makes sense if specific types of URLs (e.g. search-URLs) should
318 * share common view-properties.
320 void setViewPropertiesContext(const QString
&context
);
321 QString
viewPropertiesContext() const;
324 * Checks if the given \a item can be opened as folder (e.g. archives).
325 * This function will also adjust the \a url (e.g. change the protocol).
326 * @return a valid and adjusted url if the item can be opened as folder,
327 * otherwise return an empty url.
329 static QUrl
openItemAsFolderUrl(const KFileItem
&item
, const bool browseThroughArchives
= true);
332 * Hides tooltip displayed over element.
334 void hideToolTip(const ToolTipManager::HideBehavior behavior
= ToolTipManager::HideBehavior::Later
);
337 * Check if the space key should be handled as a normal key, even if it's
338 * used as a keyboard shortcut.
342 bool handleSpaceAsNormalKey() const;
344 /** Activates the view if the item list container gets focus. */
345 bool eventFilter(QObject
*watched
, QEvent
*event
) override
;
352 * Changes the directory to \a url. If the current directory is equal to
353 * \a url, nothing will be done (use DolphinView::reload() instead).
355 void setUrl(const QUrl
&url
);
359 * @see DolphinView::selectedItems()
364 * Inverts the current selection: selected items get unselected,
365 * unselected items get selected.
366 * @see DolphinView::selectedItems()
368 void invertSelection();
370 void clearSelection();
373 * Triggers the renaming of the currently selected items, where
374 * the user must input a new name for the items.
376 void renameSelectedItems();
379 * Moves all selected items to the trash.
381 void trashSelectedItems();
384 * Deletes all selected items.
386 void deleteSelectedItems();
389 * Copies all selected items to the clipboard and marks
392 void cutSelectedItemsToClipboard();
394 /** Copies all selected items to the clipboard. */
395 void copySelectedItemsToClipboard();
398 * Copies all selected items to @p destinationUrl.
400 void copySelectedItems(const KFileItemList
&selection
, const QUrl
&destinationUrl
);
403 * Moves all selected items to @p destinationUrl.
405 void moveSelectedItems(const KFileItemList
&selection
, const QUrl
&destinationUrl
);
407 /** Pastes the clipboard data to this view. */
411 * Pastes the clipboard data into the currently selected
412 * folder. If the current selection is not exactly one folder, no
413 * paste operation is done.
415 void pasteIntoFolder();
418 * Copies the path of the first selected KFileItem into Clipboard.
420 void copyPathToClipboard();
423 * Creates duplicates of selected items, appending "copy"
426 void duplicateSelectedItems();
429 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
431 void dropUrls(const QUrl
&destUrl
, QDropEvent
*dropEvent
, QWidget
*dropWidget
);
436 * Applies the state that has been restored by restoreViewState()
439 void updateViewState();
443 * Is emitted if the view has been activated by e. g. a mouse click.
447 /** Is emitted if the URL of the view has been changed to \a url. */
448 void urlChanged(const QUrl
&url
);
451 * Is emitted when clicking on an item with the left mouse button.
453 void itemActivated(const KFileItem
&item
);
456 * Is emitted when clicking on a file with the middle mouse button.
457 * @note: This will not be emitted for folders or file archives that will/can be opened like folders.
459 void fileMiddleClickActivated(const KFileItem
&item
);
462 * Is emitted when multiple items have been activated by e. g.
463 * context menu open with.
465 void itemsActivated(const KFileItemList
&items
);
468 * Is emitted if items have been added or deleted.
470 void itemCountChanged();
473 * Is emitted if a new tab should be opened for the URL \a url.
475 void tabRequested(const QUrl
&url
);
478 * Is emitted if a new tab should be opened for the URL \a url and set as active.
480 void activeTabRequested(const QUrl
&url
);
483 * Is emitted if a new window should be opened for the URL \a url.
485 void windowRequested(const QUrl
&url
);
488 * Is emitted if the view mode (IconsView, DetailsView,
489 * PreviewsView) has been changed.
491 void modeChanged(DolphinView::Mode current
, DolphinView::Mode previous
);
493 /** Is emitted if the 'show preview' property has been changed. */
494 void previewsShownChanged(bool shown
);
496 /** Is emitted if the 'show hidden files' property has been changed. */
497 void hiddenFilesShownChanged(bool shown
);
499 /** Is emitted if the 'grouped sorting' property has been changed. */
500 void groupedSortingChanged(bool groupedSorting
);
502 /** Is emitted in reaction to a requestStatusBarText() call.
503 * @see requestStatusBarText() */
504 void statusBarTextChanged(QString statusBarText
);
506 /** Is emitted if the sorting by name, size or date has been changed. */
507 void sortRoleChanged(const QByteArray
&role
);
509 /** Is emitted if the sort order (ascending or descending) has been changed. */
510 void sortOrderChanged(Qt::SortOrder order
);
513 * Is emitted if the sorting of files and folders (separate with folders
514 * first or mixed) has been changed.
516 void sortFoldersFirstChanged(bool foldersFirst
);
519 * Is emitted if the sorting of hidden files has been changed.
521 void sortHiddenLastChanged(bool hiddenLast
);
523 /** Is emitted if the additional information shown for this view has been changed. */
524 void visibleRolesChanged(const QList
<QByteArray
> ¤t
, const QList
<QByteArray
> &previous
);
526 /** Is emitted if the zoom level has been changed by zooming in or out. */
527 void zoomLevelChanged(int current
, int previous
);
530 * Is emitted if information of an item is requested to be shown e. g. in the panel.
531 * If item is null, no item information request is pending.
533 void requestItemInfo(const KFileItem
&item
);
536 * Is emitted whenever the selection has been changed.
538 void selectionChanged(const KFileItemList
&selection
);
541 * Is emitted if a context menu is requested for the item \a item,
542 * which is part of \a url. If the item is null, the context menu
543 * for the URL should be shown.
545 void requestContextMenu(const QPoint
&pos
, const KFileItem
&item
, const KFileItemList
&selectedItems
, const QUrl
&url
);
548 * Is emitted if an information message with the content \a msg
551 void infoMessage(const QString
&msg
);
554 * Is emitted if an error message with the content \a msg
557 void errorMessage(const QString
&msg
);
560 * Is emitted if an "operation completed" message with the content \a msg
563 void operationCompletedMessage(const QString
&msg
);
566 * Is emitted after DolphinView::setUrl() has been invoked and
567 * the current directory is loaded. If this signal is emitted,
568 * it is assured that the view contains already the correct root
569 * URL and property settings.
571 void directoryLoadingStarted();
574 * Is emitted after the directory triggered by DolphinView::setUrl()
577 void directoryLoadingCompleted();
580 * Is emitted after the directory loading triggered by DolphinView::setUrl()
583 void directoryLoadingCanceled();
586 * Is emitted after DolphinView::setUrl() has been invoked and provides
587 * the information how much percent of the current directory have been loaded.
589 void directoryLoadingProgress(int percent
);
592 * Is emitted if the sorting is done asynchronously and provides the
593 * progress information of the sorting.
595 void directorySortingProgress(int percent
);
598 * Emitted when the file-item-model emits redirection.
599 * Testcase: fish://localhost
601 void redirection(const QUrl
&oldUrl
, const QUrl
&newUrl
);
604 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
605 * In this case no signal errorMessage() will be emitted.
607 void urlIsFileError(const QUrl
&url
);
610 * Is emitted when the write state of the folder has been changed. The application
611 * should disable all actions like "Create New..." that depend on the write
614 void writeStateChanged(bool isFolderWritable
);
617 * Is emitted if the URL should be changed to the previous URL of the
618 * history (e.g. because the "back"-mousebutton has been pressed).
620 void goBackRequested();
623 * Is emitted if the URL should be changed to the next URL of the
624 * history (e.g. because the "next"-mousebutton has been pressed).
626 void goForwardRequested();
629 * Used to request either entering or leaving of selection mode
630 * Entering is typically requested on press and hold.
631 * Leaving by pressing Escape when no item is selected.
633 void selectionModeChangeRequested(bool enabled
);
636 * Is emitted when the user wants to move the focus to another view.
638 void toggleActiveViewRequested();
641 * Is emitted when the user clicks a tag or a link
642 * in the metadata widget of a tooltip.
644 void urlActivated(const QUrl
&url
);
646 void goUpRequested();
648 void fileItemsChanged(const KFileItemList
&changedFileItems
);
651 * Emitted when the current directory of the model was removed.
653 void currentDirectoryRemoved();
656 /** Changes the zoom level if Control is pressed during a wheel event. */
657 void wheelEvent(QWheelEvent
*event
) override
;
659 void hideEvent(QHideEvent
*event
) override
;
660 bool event(QEvent
*event
) override
;
664 * Marks the view as active (DolphinView:isActive() will return true)
665 * and emits the 'activated' signal if it is not already active.
669 void slotItemActivated(int index
);
670 void slotItemsActivated(const KItemSet
&indexes
);
671 void slotItemMiddleClicked(int index
);
672 void slotItemContextMenuRequested(int index
, const QPointF
&pos
);
673 void slotViewContextMenuRequested(const QPointF
&pos
);
674 void slotHeaderContextMenuRequested(const QPointF
&pos
);
675 void slotHeaderColumnWidthChangeFinished(const QByteArray
&role
, qreal current
);
676 void slotSidePaddingWidthChanged(qreal width
);
677 void slotItemHovered(int index
);
678 void slotItemUnhovered(int index
);
679 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
*event
);
680 void slotModelChanged(KItemModelBase
*current
, KItemModelBase
*previous
);
681 void slotMouseButtonPressed(int itemIndex
, Qt::MouseButtons buttons
);
682 void slotRenameDialogRenamingFinished(const QList
<QUrl
> &urls
);
683 void slotSelectedItemTextPressed(int index
);
684 void slotItemCreatedFromJob(KIO::Job
*, const QUrl
&, const QUrl
&to
);
685 void slotIncreaseZoom();
686 void slotDecreaseZoom();
690 * Is called when new items get pasted or dropped.
692 void slotItemCreated(const QUrl
&url
);
694 * Is called after all pasted or dropped items have been copied to destination.
696 void slotJobResult(KJob
*job
);
699 * Emits the signal \a selectionChanged() with a small delay. This is
700 * because getting all file items for the selection can be an expensive
701 * operation. Fast selection changes are collected in this case and
702 * the signal is emitted only after no selection change has been done
703 * within a small delay.
705 void slotSelectionChanged(const KItemSet
¤t
, const KItemSet
&previous
);
708 * Is called by emitDelayedSelectionChangedSignal() and emits the
709 * signal \a selectionChanged() with all selected file items as parameter.
711 void emitSelectionChangedSignal();
714 * Helper method for DolphinView::requestStatusBarText().
715 * Calculates the amount of folders and files and their total size in
716 * response to a KStatJob::result(), then calls emitStatusBarText().
717 * @see requestStatusBarText()
718 * @see emitStatusBarText()
720 void slotStatJobResult(KJob
*job
);
723 * Updates the view properties of the current URL to the
724 * sorting given by \a role.
726 void updateSortRole(const QByteArray
&role
);
729 * Updates the view properties of the current URL to the
730 * sort order given by \a order.
732 void updateSortOrder(Qt::SortOrder order
);
735 * Updates the view properties of the current URL to the
736 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
738 void updateSortFoldersFirst(bool foldersFirst
);
741 * Updates the view properties of the current URL to the
742 * sorting of hidden files given by \a hiddenLast.
744 void updateSortHiddenLast(bool hiddenLast
);
747 * Indicates in the status bar that the delete operation
748 * of the job \a job has been finished.
750 void slotDeleteFileFinished(KJob
*job
);
753 * Indicates in the status bar that the trash operation
754 * of the job \a job has been finished.
756 void slotTrashFileFinished(KJob
*job
);
759 * Invoked when the rename job is done, for error handling.
761 void slotRenamingResult(KJob
*job
);
764 * Invoked when the file item model has started the loading
765 * of the directory specified by DolphinView::url().
767 void slotDirectoryLoadingStarted();
770 * Invoked when the file item model indicates that the loading of a directory has
771 * been completed. Assures that pasted items and renamed items get selected.
773 void slotDirectoryLoadingCompleted();
776 * Invoked when the file item model indicates that the loading of a directory has
779 void slotDirectoryLoadingCanceled();
782 * Is invoked when items of KFileItemModel have been changed.
784 void slotItemsChanged();
787 * Is invoked when the sort order has been changed by the user by clicking
788 * on a header item. The view properties of the directory will get updated.
790 void slotSortOrderChangedByHeader(Qt::SortOrder current
, Qt::SortOrder previous
);
793 * Is invoked when the sort role has been changed by the user by clicking
794 * on a header item. The view properties of the directory will get updated.
796 void slotSortRoleChangedByHeader(const QByteArray
¤t
, const QByteArray
&previous
);
799 * Is invoked when the visible roles have been changed by the user by dragging
800 * a header item. The view properties of the directory will get updated.
802 void slotVisibleRolesChangedByHeader(const QList
<QByteArray
> ¤t
, const QList
<QByteArray
> &previous
);
804 void slotRoleEditingCanceled();
805 void slotRoleEditingFinished(int index
, const QByteArray
&role
, const QVariant
&value
);
808 * Observes the item with the URL \a url. As soon as the directory
809 * model indicates that the item is available, the item will
810 * get selected and it is assured that the item stays visible.
812 void observeCreatedItem(const QUrl
&url
);
815 * Selects the next item after prev selection deleted/trashed
817 void selectNextItem();
820 * Called when a redirection happens.
821 * Testcase: fish://localhost
823 void slotDirectoryRedirection(const QUrl
&oldUrl
, const QUrl
&newUrl
);
825 void slotTwoClicksRenamingTimerTimeout();
828 void loadDirectory(const QUrl
&url
, bool reload
= false);
831 * Applies the view properties which are defined by the current URL
832 * to the DolphinView properties. The view properties are read from a
833 * .directory file either in the current directory, or in the
834 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
836 void applyViewProperties();
839 * Applies the given view properties to the DolphinView.
841 void applyViewProperties(const ViewProperties
&props
);
844 * Applies the m_mode property to the corresponding
845 * itemlayout-property of the KItemListView.
847 void applyModeToView();
849 enum Selection
{ HasSelection
, NoSelection
};
851 * Helper method for DolphinView::requestStatusBarText().
852 * Generates the status bar text from the parameters and
853 * then emits statusBarTextChanged().
854 * @param totalFileSize the sum of the sizes of the files
855 * @param selection if HasSelection is passed, the emitted status bar text will say
856 * that the folders and files which are counted here are selected.
858 void emitStatusBarText(const int folderCount
, const int fileCount
, KIO::filesize_t totalFileSize
, const Selection selection
);
861 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
862 * Pastes the clipboard data into the URL \a url.
864 void pasteToUrl(const QUrl
&url
);
867 * Returns a list of URLs for all selected items. The list is
868 * simplified, so that when the URLs are part of different tree
869 * levels, only the parent is returned.
871 QList
<QUrl
> simplifiedSelectedUrls() const;
874 * Returns the MIME data for all selected items.
876 QMimeData
*selectionMimeData() const;
879 * Updates m_isFolderWritable dependent on whether the folder represented by
880 * the current URL is writable. If the state has changed, the signal
881 * writeableStateChanged() will be emitted.
883 void updateWritableState();
886 * @return The current URL if no viewproperties-context is given (see
887 * DolphinView::viewPropertiesContext(), otherwise the context
890 QUrl
viewPropertiesUrl() const;
893 * Clears the selection and updates current item and selection according to the parameters
895 * @param current URL to be set as current
896 * @param selected list of selected items
898 void forceUrlsSelection(const QUrl
¤t
, const QList
<QUrl
> &selected
);
900 void abortTwoClicksRenaming();
902 void updatePlaceholderLabel();
904 bool tryShowNameToolTip(QHelpEvent
*event
);
907 void updatePalette();
908 void showLoadingPlaceholder();
912 bool m_assureVisibleCurrentIndex
;
913 bool m_isFolderWritable
;
914 bool m_dragging
; // True if a dragging is done. Required to be able to decide whether a
915 // tooltip may be shown when hovering an item.
916 bool m_selectNextItem
;
918 enum class LoadingState
{ Idle
, Loading
, Canceled
, Completed
};
919 LoadingState m_loadingState
= LoadingState::Idle
;
922 QString m_viewPropertiesContext
;
924 QList
<QByteArray
> m_visibleRoles
;
926 QPointer
<KIO::StatJob
> m_statJobForStatusBarText
;
928 QVBoxLayout
*m_topLayout
;
930 KFileItemModel
*m_model
;
931 DolphinItemListView
*m_view
;
932 KItemListContainer
*m_container
;
934 ToolTipManager
*m_toolTipManager
;
936 QTimer
*m_selectionChangedTimer
;
938 QUrl m_currentItemUrl
; // Used for making the view to remember the current URL after F5
939 bool m_scrollToCurrentItem
; // Used for marking we need to scroll to current item or not
940 QPoint m_restoredContentsPosition
;
942 // Used for tracking the accumulated scroll amount (for zooming with high
943 // resolution scroll wheels)
944 int m_controlWheelAccumulatedDelta
;
946 QList
<QUrl
> m_selectedUrls
; // Used for making the view to remember selections after F5 and file operations
947 bool m_clearSelectionBeforeSelectingNewItems
;
948 bool m_markFirstNewlySelectedItemAsCurrent
;
949 /// Decides whether items created by jobs should automatically be selected.
950 bool m_selectJobCreatedItems
;
952 VersionControlObserver
*m_versionControlObserver
;
954 QTimer
*m_twoClicksRenamingTimer
;
955 QUrl m_twoClicksRenamingItemUrl
;
956 QLabel
*m_placeholderLabel
;
957 QTimer
*m_showLoadingPlaceholderTimer
;
959 /// The information roleIndex of the list column header currently hovered
960 std::optional
<int> m_hoveredColumnHeaderIndex
;
962 /// Used for selection mode. @see setSelectionMode()
963 std::unique_ptr
<QProxyStyle
> m_proxyStyle
;
966 friend class TestBase
;
967 friend class DolphinDetailsViewTest
;
968 friend class DolphinMainWindowTest
;
969 friend class DolphinPart
; // Accesses m_model
970 void updateSelectionState();
973 /// Allow using DolphinView::Mode in QVariant
974 Q_DECLARE_METATYPE(DolphinView::Mode
)
976 #endif // DOLPHINVIEW_H