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;
231 * Refreshes the view to get synchronized with the settings (e.g. icons size,
237 * Saves the current settings (e.g. icons size, font, ..).
239 void writeSettings();
242 * Filters the currently shown items by \a nameFilter. All items
243 * which contain the given filter string will be shown.
245 void setNameFilter(const QString
&nameFilter
);
246 QString
nameFilter() const;
249 * Filters the currently shown items by \a filters. All items
250 * whose content-type matches those given by the list of filters
253 void setMimeTypeFilters(const QStringList
&filters
);
254 QStringList
mimeTypeFilters() const;
257 * Tells the view to generate an updated status bar text. The result
258 * is returned through the statusBarTextChanged(QString statusBarText) signal.
259 * It will carry a textual representation of the state of the current
260 * folder or selected items, suitable for use in the status bar.
261 * Any pending requests of status bar text are killed.
263 void requestStatusBarText();
266 * Returns the version control actions that are provided for the items \p items.
267 * Usually the actions are presented in the context menu.
269 QList
<QAction
*> versionControlActions(const KFileItemList
&items
) const;
272 * Returns the state of the paste action:
273 * first is whether the action should be enabled
274 * second is the text for the action
276 QPair
<bool, QString
> pasteInfo() const;
279 * If \a tabsForFiles is true, the signal tabRequested() will also
280 * emitted also for files. Per default tabs for files is disabled
281 * and hence the signal tabRequested() will only be emitted for
284 void setTabsForFilesEnabled(bool tabsForFiles
);
285 bool isTabsForFilesEnabled() const;
288 * Returns true if the current view allows folders to be expanded,
289 * i.e. presents a hierarchical view to the user.
291 bool itemsExpandable() const;
294 * @returns true if the @p item is one of the items() of this view and
295 * is currently expanded. false otherwise.
296 * Only directories in view modes that allow expanding can ever be expanded.
298 bool isExpanded(const KFileItem
&item
) const;
301 * Restores the view state (current item, contents position, details view expansion state)
303 void restoreState(QDataStream
&stream
);
306 * Saves the view state (current item, contents position, details view expansion state)
308 void saveState(QDataStream
&stream
);
311 * Returns the root item which represents the current URL.
313 KFileItem
rootItem() const;
316 * Sets a context that is used for remembering the view-properties.
317 * Per default the context is empty and the path of the currently set URL
318 * is used for remembering the view-properties. Setting a custom context
319 * makes sense if specific types of URLs (e.g. search-URLs) should
320 * share common view-properties.
322 void setViewPropertiesContext(const QString
&context
);
323 QString
viewPropertiesContext() const;
326 * Checks if the given \a item can be opened as folder (e.g. archives).
327 * This function will also adjust the \a url (e.g. change the protocol).
328 * @return a valid and adjusted url if the item can be opened as folder,
329 * otherwise return an empty url.
331 static QUrl
openItemAsFolderUrl(const KFileItem
&item
, const bool browseThroughArchives
= true);
334 * Hides tooltip displayed over element.
336 void hideToolTip(const ToolTipManager::HideBehavior behavior
= ToolTipManager::HideBehavior::Later
);
339 * Check if the space key should be handled as a normal key, even if it's
340 * used as a keyboard shortcut.
344 bool handleSpaceAsNormalKey() const;
346 /** Activates the view if the item list container gets focus. */
347 bool eventFilter(QObject
*watched
, QEvent
*event
) override
;
351 * Changes the directory to \a url. If the current directory is equal to
352 * \a url, nothing will be done (use DolphinView::reload() instead).
354 void setUrl(const QUrl
&url
);
358 * @see DolphinView::selectedItems()
363 * Inverts the current selection: selected items get unselected,
364 * unselected items get selected.
365 * @see DolphinView::selectedItems()
367 void invertSelection();
369 void clearSelection();
372 * Triggers the renaming of the currently selected items, where
373 * the user must input a new name for the items.
375 void renameSelectedItems();
378 * Moves all selected items to the trash.
380 void trashSelectedItems();
383 * Deletes all selected items.
385 void deleteSelectedItems();
388 * Copies all selected items to the clipboard and marks
391 void cutSelectedItemsToClipboard();
393 /** Copies all selected items to the clipboard. */
394 void copySelectedItemsToClipboard();
397 * Copies all selected items to @p destinationUrl.
399 void copySelectedItems(const KFileItemList
&selection
, const QUrl
&destinationUrl
);
402 * Moves all selected items to @p destinationUrl.
404 void moveSelectedItems(const KFileItemList
&selection
, const QUrl
&destinationUrl
);
406 /** Pastes the clipboard data to this view. */
410 * Pastes the clipboard data into the currently selected
411 * folder. If the current selection is not exactly one folder, no
412 * paste operation is done.
414 void pasteIntoFolder();
417 * Copies the path of the first selected KFileItem into Clipboard.
419 void copyPathToClipboard();
422 * Creates duplicates of selected items, appending "copy"
425 void duplicateSelectedItems();
428 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
430 void dropUrls(const QUrl
&destUrl
, QDropEvent
*dropEvent
, QWidget
*dropWidget
);
435 * Applies the state that has been restored by restoreViewState()
438 void updateViewState();
442 * Is emitted if the view has been activated by e. g. a mouse click.
446 /** Is emitted if the URL of the view has been changed to \a url. */
447 void urlChanged(const QUrl
&url
);
450 * Is emitted when clicking on an item with the left mouse button.
452 void itemActivated(const KFileItem
&item
);
455 * Is emitted when multiple items have been activated by e. g.
456 * context menu open with.
458 void itemsActivated(const KFileItemList
&items
);
461 * Is emitted if items have been added or deleted.
463 void itemCountChanged();
466 * Is emitted if a new tab should be opened for the URL \a url.
468 void tabRequested(const QUrl
&url
);
471 * Is emitted if a new tab should be opened for the URL \a url and set as active.
473 void activeTabRequested(const QUrl
&url
);
476 * Is emitted if a new window should be opened for the URL \a url.
478 void windowRequested(const QUrl
&url
);
481 * Is emitted if the view mode (IconsView, DetailsView,
482 * PreviewsView) has been changed.
484 void modeChanged(DolphinView::Mode current
, DolphinView::Mode previous
);
486 /** Is emitted if the 'show preview' property has been changed. */
487 void previewsShownChanged(bool shown
);
489 /** Is emitted if the 'show hidden files' property has been changed. */
490 void hiddenFilesShownChanged(bool shown
);
492 /** Is emitted if the 'grouped sorting' property has been changed. */
493 void groupedSortingChanged(bool groupedSorting
);
495 /** Is emitted in reaction to a requestStatusBarText() call.
496 * @see requestStatusBarText() */
497 void statusBarTextChanged(QString statusBarText
);
499 /** Is emitted if the sorting by name, size or date has been changed. */
500 void sortRoleChanged(const QByteArray
&role
);
502 /** Is emitted if the sort order (ascending or descending) has been changed. */
503 void sortOrderChanged(Qt::SortOrder order
);
506 * Is emitted if the sorting of files and folders (separate with folders
507 * first or mixed) has been changed.
509 void sortFoldersFirstChanged(bool foldersFirst
);
512 * Is emitted if the sorting of hidden files has been changed.
514 void sortHiddenLastChanged(bool hiddenLast
);
516 /** Is emitted if the additional information shown for this view has been changed. */
517 void visibleRolesChanged(const QList
<QByteArray
> ¤t
, const QList
<QByteArray
> &previous
);
519 /** Is emitted if the zoom level has been changed by zooming in or out. */
520 void zoomLevelChanged(int current
, int previous
);
523 * Is emitted if information of an item is requested to be shown e. g. in the panel.
524 * If item is null, no item information request is pending.
526 void requestItemInfo(const KFileItem
&item
);
529 * Is emitted whenever the selection has been changed.
531 void selectionChanged(const KFileItemList
&selection
);
534 * Is emitted if a context menu is requested for the item \a item,
535 * which is part of \a url. If the item is null, the context menu
536 * for the URL should be shown.
538 void requestContextMenu(const QPoint
&pos
, const KFileItem
&item
, const KFileItemList
&selectedItems
, const QUrl
&url
);
541 * Is emitted if an information message with the content \a msg
544 void infoMessage(const QString
&msg
);
547 * Is emitted if an error message with the content \a msg
550 void errorMessage(const QString
&msg
);
553 * Is emitted if an "operation completed" message with the content \a msg
556 void operationCompletedMessage(const QString
&msg
);
559 * Is emitted after DolphinView::setUrl() has been invoked and
560 * the current directory is loaded. If this signal is emitted,
561 * it is assured that the view contains already the correct root
562 * URL and property settings.
564 void directoryLoadingStarted();
567 * Is emitted after the directory triggered by DolphinView::setUrl()
570 void directoryLoadingCompleted();
573 * Is emitted after the directory loading triggered by DolphinView::setUrl()
576 void directoryLoadingCanceled();
579 * Is emitted after DolphinView::setUrl() has been invoked and provides
580 * the information how much percent of the current directory have been loaded.
582 void directoryLoadingProgress(int percent
);
585 * Is emitted if the sorting is done asynchronously and provides the
586 * progress information of the sorting.
588 void directorySortingProgress(int percent
);
591 * Emitted when the file-item-model emits redirection.
592 * Testcase: fish://localhost
594 void redirection(const QUrl
&oldUrl
, const QUrl
&newUrl
);
597 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
598 * In this case no signal errorMessage() will be emitted.
600 void urlIsFileError(const QUrl
&url
);
603 * Is emitted when the write state of the folder has been changed. The application
604 * should disable all actions like "Create New..." that depend on the write
607 void writeStateChanged(bool isFolderWritable
);
610 * Is emitted if the URL should be changed to the previous URL of the
611 * history (e.g. because the "back"-mousebutton has been pressed).
613 void goBackRequested();
616 * Is emitted if the URL should be changed to the next URL of the
617 * history (e.g. because the "next"-mousebutton has been pressed).
619 void goForwardRequested();
622 * Used to request either entering or leaving of selection mode
623 * Entering is typically requested on press and hold.
624 * Leaving by pressing Escape when no item is selected.
626 void selectionModeChangeRequested(bool enabled
);
629 * Is emitted when the user wants to move the focus to another view.
631 void toggleActiveViewRequested();
634 * Is emitted when the user clicks a tag or a link
635 * in the metadata widget of a tooltip.
637 void urlActivated(const QUrl
&url
);
639 void goUpRequested();
641 void fileItemsChanged(const KFileItemList
&changedFileItems
);
644 * Emitted when the current directory of the model was removed.
646 void currentDirectoryRemoved();
649 /** Changes the zoom level if Control is pressed during a wheel event. */
650 void wheelEvent(QWheelEvent
*event
) override
;
652 void hideEvent(QHideEvent
*event
) override
;
653 bool event(QEvent
*event
) override
;
657 * Marks the view as active (DolphinView:isActive() will return true)
658 * and emits the 'activated' signal if it is not already active.
662 void slotItemActivated(int index
);
663 void slotItemsActivated(const KItemSet
&indexes
);
664 void slotItemMiddleClicked(int index
);
665 void slotItemContextMenuRequested(int index
, const QPointF
&pos
);
666 void slotViewContextMenuRequested(const QPointF
&pos
);
667 void slotHeaderContextMenuRequested(const QPointF
&pos
);
668 void slotHeaderColumnWidthChangeFinished(const QByteArray
&role
, qreal current
);
669 void slotSidePaddingWidthChanged(qreal width
);
670 void slotItemHovered(int index
);
671 void slotItemUnhovered(int index
);
672 void slotItemDropEvent(int index
, QGraphicsSceneDragDropEvent
*event
);
673 void slotModelChanged(KItemModelBase
*current
, KItemModelBase
*previous
);
674 void slotMouseButtonPressed(int itemIndex
, Qt::MouseButtons buttons
);
675 void slotRenameDialogRenamingFinished(const QList
<QUrl
> &urls
);
676 void slotSelectedItemTextPressed(int index
);
677 void slotItemCreatedFromJob(KIO::Job
*, const QUrl
&, const QUrl
&to
);
678 void slotIncreaseZoom();
679 void slotDecreaseZoom();
683 * Is called when new items get pasted or dropped.
685 void slotItemCreated(const QUrl
&url
);
687 * Is called after all pasted or dropped items have been copied to destination.
689 void slotJobResult(KJob
*job
);
692 * Emits the signal \a selectionChanged() with a small delay. This is
693 * because getting all file items for the selection can be an expensive
694 * operation. Fast selection changes are collected in this case and
695 * the signal is emitted only after no selection change has been done
696 * within a small delay.
698 void slotSelectionChanged(const KItemSet
¤t
, const KItemSet
&previous
);
701 * Is called by emitDelayedSelectionChangedSignal() and emits the
702 * signal \a selectionChanged() with all selected file items as parameter.
704 void emitSelectionChangedSignal();
707 * Helper method for DolphinView::requestStatusBarText().
708 * Calculates the amount of folders and files and their total size in
709 * response to a KStatJob::result(), then calls emitStatusBarText().
710 * @see requestStatusBarText()
711 * @see emitStatusBarText()
713 void slotStatJobResult(KJob
*job
);
716 * Updates the view properties of the current URL to the
717 * sorting given by \a role.
719 void updateSortRole(const QByteArray
&role
);
722 * Updates the view properties of the current URL to the
723 * sort order given by \a order.
725 void updateSortOrder(Qt::SortOrder order
);
728 * Updates the view properties of the current URL to the
729 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
731 void updateSortFoldersFirst(bool foldersFirst
);
734 * Updates the view properties of the current URL to the
735 * sorting of hidden files given by \a hiddenLast.
737 void updateSortHiddenLast(bool hiddenLast
);
740 * Indicates in the status bar that the delete operation
741 * of the job \a job has been finished.
743 void slotDeleteFileFinished(KJob
*job
);
746 * Indicates in the status bar that the trash operation
747 * of the job \a job has been finished.
749 void slotTrashFileFinished(KJob
*job
);
752 * Invoked when the rename job is done, for error handling.
754 void slotRenamingResult(KJob
*job
);
757 * Invoked when the file item model has started the loading
758 * of the directory specified by DolphinView::url().
760 void slotDirectoryLoadingStarted();
763 * Invoked when the file item model indicates that the loading of a directory has
764 * been completed. Assures that pasted items and renamed items get selected.
766 void slotDirectoryLoadingCompleted();
769 * Invoked when the file item model indicates that the loading of a directory has
772 void slotDirectoryLoadingCanceled();
775 * Is invoked when items of KFileItemModel have been changed.
777 void slotItemsChanged();
780 * Is invoked when the sort order has been changed by the user by clicking
781 * on a header item. The view properties of the directory will get updated.
783 void slotSortOrderChangedByHeader(Qt::SortOrder current
, Qt::SortOrder previous
);
786 * Is invoked when the sort role has been changed by the user by clicking
787 * on a header item. The view properties of the directory will get updated.
789 void slotSortRoleChangedByHeader(const QByteArray
¤t
, const QByteArray
&previous
);
792 * Is invoked when the visible roles have been changed by the user by dragging
793 * a header item. The view properties of the directory will get updated.
795 void slotVisibleRolesChangedByHeader(const QList
<QByteArray
> ¤t
, const QList
<QByteArray
> &previous
);
797 void slotRoleEditingCanceled();
798 void slotRoleEditingFinished(int index
, const QByteArray
&role
, const QVariant
&value
);
801 * Observes the item with the URL \a url. As soon as the directory
802 * model indicates that the item is available, the item will
803 * get selected and it is assured that the item stays visible.
805 void observeCreatedItem(const QUrl
&url
);
808 * Selects the next item after prev selection deleted/trashed
810 void selectNextItem();
813 * Called when a redirection happens.
814 * Testcase: fish://localhost
816 void slotDirectoryRedirection(const QUrl
&oldUrl
, const QUrl
&newUrl
);
818 void slotTwoClicksRenamingTimerTimeout();
821 void loadDirectory(const QUrl
&url
, bool reload
= false);
824 * Applies the view properties which are defined by the current URL
825 * to the DolphinView properties. The view properties are read from a
826 * .directory file either in the current directory, or in the
827 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
829 void applyViewProperties();
832 * Applies the given view properties to the DolphinView.
834 void applyViewProperties(const ViewProperties
&props
);
837 * Applies the m_mode property to the corresponding
838 * itemlayout-property of the KItemListView.
840 void applyModeToView();
842 enum Selection
{ HasSelection
, NoSelection
};
844 * Helper method for DolphinView::requestStatusBarText().
845 * Generates the status bar text from the parameters and
846 * then emits statusBarTextChanged().
847 * @param totalFileSize the sum of the sizes of the files
848 * @param selection if HasSelection is passed, the emitted status bar text will say
849 * that the folders and files which are counted here are selected.
851 void emitStatusBarText(const int folderCount
, const int fileCount
, KIO::filesize_t totalFileSize
, const Selection selection
);
854 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
855 * Pastes the clipboard data into the URL \a url.
857 void pasteToUrl(const QUrl
&url
);
860 * Returns a list of URLs for all selected items. The list is
861 * simplified, so that when the URLs are part of different tree
862 * levels, only the parent is returned.
864 QList
<QUrl
> simplifiedSelectedUrls() const;
867 * Returns the MIME data for all selected items.
869 QMimeData
*selectionMimeData() const;
872 * Updates m_isFolderWritable dependent on whether the folder represented by
873 * the current URL is writable. If the state has changed, the signal
874 * writeableStateChanged() will be emitted.
876 void updateWritableState();
879 * @return The current URL if no viewproperties-context is given (see
880 * DolphinView::viewPropertiesContext(), otherwise the context
883 QUrl
viewPropertiesUrl() const;
886 * Clears the selection and updates current item and selection according to the parameters
888 * @param current URL to be set as current
889 * @param selected list of selected items
891 void forceUrlsSelection(const QUrl
¤t
, const QList
<QUrl
> &selected
);
893 void abortTwoClicksRenaming();
895 void updatePlaceholderLabel();
897 bool tryShowNameToolTip(QHelpEvent
*event
);
900 void updatePalette();
901 void showLoadingPlaceholder();
905 bool m_assureVisibleCurrentIndex
;
906 bool m_isFolderWritable
;
907 bool m_dragging
; // True if a dragging is done. Required to be able to decide whether a
908 // tooltip may be shown when hovering an item.
909 bool m_selectNextItem
;
911 enum class LoadingState
{ Idle
, Loading
, Canceled
, Completed
};
912 LoadingState m_loadingState
= LoadingState::Idle
;
915 QString m_viewPropertiesContext
;
917 QList
<QByteArray
> m_visibleRoles
;
919 QPointer
<KIO::StatJob
> m_statJobForStatusBarText
;
921 QVBoxLayout
*m_topLayout
;
923 KFileItemModel
*m_model
;
924 DolphinItemListView
*m_view
;
925 KItemListContainer
*m_container
;
927 ToolTipManager
*m_toolTipManager
;
929 QTimer
*m_selectionChangedTimer
;
931 QUrl m_currentItemUrl
; // Used for making the view to remember the current URL after F5
932 bool m_scrollToCurrentItem
; // Used for marking we need to scroll to current item or not
933 QPoint m_restoredContentsPosition
;
935 // Used for tracking the accumulated scroll amount (for zooming with high
936 // resolution scroll wheels)
937 int m_controlWheelAccumulatedDelta
;
939 QList
<QUrl
> m_selectedUrls
; // Used for making the view to remember selections after F5 and file operations
940 bool m_clearSelectionBeforeSelectingNewItems
;
941 bool m_markFirstNewlySelectedItemAsCurrent
;
942 /// Decides whether items created by jobs should automatically be selected.
943 bool m_selectJobCreatedItems
;
945 VersionControlObserver
*m_versionControlObserver
;
947 QTimer
*m_twoClicksRenamingTimer
;
948 QUrl m_twoClicksRenamingItemUrl
;
949 QLabel
*m_placeholderLabel
;
950 QTimer
*m_showLoadingPlaceholderTimer
;
952 /// The information roleIndex of the list column header currently hovered
953 std::optional
<int> m_hoveredColumnHeaderIndex
;
955 /// Used for selection mode. @see setSelectionMode()
956 std::unique_ptr
<QProxyStyle
> m_proxyStyle
;
959 friend class TestBase
;
960 friend class DolphinDetailsViewTest
;
961 friend class DolphinMainWindowTest
;
962 friend class DolphinPart
; // Accesses m_model
963 void updateSelectionState();
966 /// Allow using DolphinView::Mode in QVariant
967 Q_DECLARE_METATYPE(DolphinView::Mode
)
969 #endif // DOLPHINVIEW_H