]> cloud.milkyroute.net Git - dolphin.git/blob - src/views/dolphinview.h
Remove unused #include
[dolphin.git] / src / views / dolphinview.h
1 /***************************************************************************
2 * Copyright (C) 2006-2009 by Peter Penz <peter.penz19@gmail.com> *
3 * Copyright (C) 2006 by Gregor Kališnik <gregor@podnapisi.net> *
4 * *
5 * This program is free software; you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation; either version 2 of the License, or *
8 * (at your option) any later version. *
9 * *
10 * This program is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
14 * *
15 * You should have received a copy of the GNU General Public License *
16 * along with this program; if not, write to the *
17 * Free Software Foundation, Inc., *
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
19 ***************************************************************************/
20
21 #ifndef DOLPHINVIEW_H
22 #define DOLPHINVIEW_H
23
24 #include "dolphin_export.h"
25
26 #include <KFileItem>
27 #include <KIO/Job>
28 #include <config-baloo.h>
29 #include <kio/fileundomanager.h>
30 #include <kparts/part.h>
31
32 #include <QMimeData>
33 #include <QUrl>
34 #include <QWidget>
35
36 typedef KIO::FileUndoManager::CommandType CommandType;
37 class QVBoxLayout;
38 class DolphinItemListView;
39 class KFileItemModel;
40 class KItemListContainer;
41 class KItemModelBase;
42 class KItemSet;
43 class ToolTipManager;
44 class VersionControlObserver;
45 class ViewProperties;
46 class QGraphicsSceneDragDropEvent;
47 class QRegExp;
48
49 /**
50 * @short Represents a view for the directory content.
51 *
52 * View modes for icons, compact and details are supported. It's
53 * possible to adjust:
54 * - sort order
55 * - sort type
56 * - show hidden files
57 * - show previews
58 * - enable grouping
59 */
60 class DOLPHIN_EXPORT DolphinView : public QWidget
61 {
62 Q_OBJECT
63
64 public:
65 /**
66 * Defines the view mode for a directory. The
67 * view mode is automatically updated if the directory itself
68 * defines a view mode (see class ViewProperties for details).
69 */
70 enum Mode
71 {
72 /**
73 * The items are shown as icons with a name-label below.
74 */
75 IconsView = 0,
76
77 /**
78 * The icon, the name and the size of the items are
79 * shown per default as a table.
80 */
81 DetailsView,
82
83 /**
84 * The items are shown as icons with the name-label aligned
85 * to the right side.
86 */
87 CompactView
88 };
89
90 /**
91 * @param url Specifies the content which should be shown.
92 * @param parent Parent widget of the view.
93 */
94 DolphinView(const QUrl& url, QWidget* parent);
95
96 ~DolphinView() override;
97
98 /**
99 * Returns the current active URL, where all actions are applied.
100 * The URL navigator is synchronized with this URL.
101 */
102 QUrl url() const;
103
104 /**
105 * If \a active is true, the view will marked as active. The active
106 * view is defined as view where all actions are applied to.
107 */
108 void setActive(bool active);
109 bool isActive() const;
110
111 /**
112 * Changes the view mode for the current directory to \a mode.
113 * If the view properties should be remembered for each directory
114 * (GeneralSettings::globalViewProps() returns false), then the
115 * changed view mode will be stored automatically.
116 */
117 void setMode(Mode mode);
118 Mode mode() const;
119
120 /**
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.
126 */
127 void setPreviewsShown(bool show);
128 bool previewsShown() const;
129
130 /**
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.
136 */
137 void setHiddenFilesShown(bool show);
138 bool hiddenFilesShown() const;
139
140 /**
141 * Turns on sorting by groups if \a enable is true.
142 */
143 void setGroupedSorting(bool grouped);
144 bool groupedSorting() const;
145
146 /**
147 * Returns the items of the view.
148 */
149 KFileItemList items() const;
150
151 /**
152 * @return The number of items. itemsCount() is faster in comparison
153 * to items().count().
154 */
155 int itemsCount() const;
156
157 /**
158 * Returns the selected items. The list is empty if no item has been
159 * selected.
160 */
161 KFileItemList selectedItems() const;
162
163 /**
164 * Returns the number of selected items (this is faster than
165 * invoking selectedItems().count()).
166 */
167 int selectedItemsCount() const;
168
169 /**
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().
174 */
175 void markUrlsAsSelected(const QList<QUrl> &urls);
176
177 /**
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.
180 */
181 void markUrlAsCurrent(const QUrl& url);
182
183 /**
184 * All items that match to the pattern \a pattern will get selected
185 * if \a enabled is true and deselected if \a enabled is false.
186 */
187 void selectItems(const QRegExp& pattern, bool enabled);
188
189 /**
190 * Sets the zoom level to \a level. It is assured that the used
191 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
192 * ZoomLevelInfo::maximumLevel().
193 */
194 void setZoomLevel(int level);
195 int zoomLevel() const;
196
197 void setSortRole(const QByteArray& role);
198 QByteArray sortRole() const;
199
200 void setSortOrder(Qt::SortOrder order);
201 Qt::SortOrder sortOrder() const;
202
203 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
204 void setSortFoldersFirst(bool foldersFirst);
205 bool sortFoldersFirst() const;
206
207 /** Sets the additional information which should be shown for the items. */
208 void setVisibleRoles(const QList<QByteArray>& roles);
209
210 /** Returns the additional information which should be shown for the items. */
211 QList<QByteArray> visibleRoles() const;
212
213 void reload();
214
215 /**
216 * Refreshes the view to get synchronized with the settings (e.g. icons size,
217 * font, ...).
218 */
219 void readSettings();
220
221 /**
222 * Saves the current settings (e.g. icons size, font, ..).
223 */
224 void writeSettings();
225
226 /**
227 * Filters the currently shown items by \a nameFilter. All items
228 * which contain the given filter string will be shown.
229 */
230 void setNameFilter(const QString& nameFilter);
231 QString nameFilter() const;
232
233 /**
234 * Filters the currently shown items by \a filters. All items
235 * whose content-type matches those given by the list of filters
236 * will be shown.
237 */
238 void setMimeTypeFilters(const QStringList& filters);
239 QStringList mimeTypeFilters() const;
240
241 /**
242 * Returns a textual representation of the state of the current
243 * folder or selected items, suitable for use in the status bar.
244 */
245 QString statusBarText() const;
246
247 /**
248 * Returns the version control actions that are provided for the items \p items.
249 * Usually the actions are presented in the context menu.
250 */
251 QList<QAction*> versionControlActions(const KFileItemList& items) const;
252
253 /**
254 * Returns the state of the paste action:
255 * first is whether the action should be enabled
256 * second is the text for the action
257 */
258 QPair<bool, QString> pasteInfo() const;
259
260 /**
261 * If \a tabsForFiles is true, the signal tabRequested() will also
262 * emitted also for files. Per default tabs for files is disabled
263 * and hence the signal tabRequested() will only be emitted for
264 * directories.
265 */
266 void setTabsForFilesEnabled(bool tabsForFiles);
267 bool isTabsForFilesEnabled() const;
268
269 /**
270 * Returns true if the current view allows folders to be expanded,
271 * i.e. presents a hierarchical view to the user.
272 */
273 bool itemsExpandable() const;
274
275 /**
276 * Restores the view state (current item, contents position, details view expansion state)
277 */
278 void restoreState(QDataStream& stream);
279
280 /**
281 * Saves the view state (current item, contents position, details view expansion state)
282 */
283 void saveState(QDataStream& stream);
284
285 /**
286 * Returns the root item which represents the current URL.
287 */
288 KFileItem rootItem() const;
289
290 /**
291 * Sets a context that is used for remembering the view-properties.
292 * Per default the context is empty and the path of the currently set URL
293 * is used for remembering the view-properties. Setting a custom context
294 * makes sense if specific types of URLs (e.g. search-URLs) should
295 * share common view-properties.
296 */
297 void setViewPropertiesContext(const QString& context);
298 QString viewPropertiesContext() const;
299
300 /**
301 * Checks if the given \a item can be opened as folder (e.g. archives).
302 * This function will also adjust the \a url (e.g. change the protocol).
303 * @return a valid and adjusted url if the item can be opened as folder,
304 * otherwise return an empty url.
305 */
306 static QUrl openItemAsFolderUrl(const KFileItem& item, const bool browseThroughArchives = true);
307
308 public slots:
309 /**
310 * Changes the directory to \a url. If the current directory is equal to
311 * \a url, nothing will be done (use DolphinView::reload() instead).
312 */
313 void setUrl(const QUrl& url);
314
315 /**
316 * Selects all items.
317 * @see DolphinView::selectedItems()
318 */
319 void selectAll();
320
321 /**
322 * Inverts the current selection: selected items get unselected,
323 * unselected items get selected.
324 * @see DolphinView::selectedItems()
325 */
326 void invertSelection();
327
328 void clearSelection();
329
330 /**
331 * Triggers the renaming of the currently selected items, where
332 * the user must input a new name for the items.
333 */
334 void renameSelectedItems();
335
336 /**
337 * Moves all selected items to the trash.
338 */
339 void trashSelectedItems();
340
341 /**
342 * Deletes all selected items.
343 */
344 void deleteSelectedItems();
345
346 /**
347 * Copies all selected items to the clipboard and marks
348 * the items as cut.
349 */
350 void cutSelectedItems();
351
352 /** Copies all selected items to the clipboard. */
353 void copySelectedItems();
354
355 /** Pastes the clipboard data to this view. */
356 void paste();
357
358 /**
359 * Pastes the clipboard data into the currently selected
360 * folder. If the current selection is not exactly one folder, no
361 * paste operation is done.
362 */
363 void pasteIntoFolder();
364
365 /**
366 * Handles a drop of @p dropEvent onto widget @p dropWidget and destination @p destUrl
367 */
368 void dropUrls(const QUrl &destUrl, QDropEvent *dropEvent, QWidget *dropWidget);
369
370 void stopLoading();
371
372 /** Activates the view if the item list container gets focus. */
373 bool eventFilter(QObject* watched, QEvent* event) override;
374
375 signals:
376 /**
377 * Is emitted if the view has been activated by e. g. a mouse click.
378 */
379 void activated();
380
381 /** Is emitted if the URL of the view has been changed to \a url. */
382 void urlChanged(const QUrl& url);
383
384 /**
385 * Is emitted when clicking on an item with the left mouse button.
386 */
387 void itemActivated(const KFileItem& item);
388
389 /**
390 * Is emitted when multiple items have been activated by e. g.
391 * context menu open with.
392 */
393 void itemsActivated(const KFileItemList& items);
394
395 /**
396 * Is emitted if items have been added or deleted.
397 */
398 void itemCountChanged();
399
400 /**
401 * Is emitted if a new tab should be opened for the URL \a url.
402 */
403 void tabRequested(const QUrl& url);
404
405 /**
406 * Is emitted if the view mode (IconsView, DetailsView,
407 * PreviewsView) has been changed.
408 */
409 void modeChanged(DolphinView::Mode current, DolphinView::Mode previous);
410
411 /** Is emitted if the 'show preview' property has been changed. */
412 void previewsShownChanged(bool shown);
413
414 /** Is emitted if the 'show hidden files' property has been changed. */
415 void hiddenFilesShownChanged(bool shown);
416
417 /** Is emitted if the 'grouped sorting' property has been changed. */
418 void groupedSortingChanged(bool groupedSorting);
419
420 /** Is emitted if the sorting by name, size or date has been changed. */
421 void sortRoleChanged(const QByteArray& role);
422
423 /** Is emitted if the sort order (ascending or descending) has been changed. */
424 void sortOrderChanged(Qt::SortOrder order);
425
426 /**
427 * Is emitted if the sorting of files and folders (separate with folders
428 * first or mixed) has been changed.
429 */
430 void sortFoldersFirstChanged(bool foldersFirst);
431
432 /** Is emitted if the additional information shown for this view has been changed. */
433 void visibleRolesChanged(const QList<QByteArray>& current,
434 const QList<QByteArray>& previous);
435
436 /** Is emitted if the zoom level has been changed by zooming in or out. */
437 void zoomLevelChanged(int current, int previous);
438
439 /**
440 * Is emitted if information of an item is requested to be shown e. g. in the panel.
441 * If item is null, no item information request is pending.
442 */
443 void requestItemInfo(const KFileItem& item);
444
445 /**
446 * Is emitted whenever the selection has been changed.
447 */
448 void selectionChanged(const KFileItemList& selection);
449
450 /**
451 * Is emitted if a context menu is requested for the item \a item,
452 * which is part of \a url. If the item is null, the context menu
453 * for the URL should be shown and the custom actions \a customActions
454 * will be added.
455 */
456 void requestContextMenu(const QPoint& pos,
457 const KFileItem& item,
458 const QUrl& url,
459 const QList<QAction*>& customActions);
460
461 /**
462 * Is emitted if an information message with the content \a msg
463 * should be shown.
464 */
465 void infoMessage(const QString& msg);
466
467 /**
468 * Is emitted if an error message with the content \a msg
469 * should be shown.
470 */
471 void errorMessage(const QString& msg);
472
473 /**
474 * Is emitted if an "operation completed" message with the content \a msg
475 * should be shown.
476 */
477 void operationCompletedMessage(const QString& msg);
478
479 /**
480 * Is emitted after DolphinView::setUrl() has been invoked and
481 * the current directory is loaded. If this signal is emitted,
482 * it is assured that the view contains already the correct root
483 * URL and property settings.
484 */
485 void directoryLoadingStarted();
486
487 /**
488 * Is emitted after the directory triggered by DolphinView::setUrl()
489 * has been loaded.
490 */
491 void directoryLoadingCompleted();
492
493 /**
494 * Is emitted after the directory loading triggered by DolphinView::setUrl()
495 * has been canceled.
496 */
497 void directoryLoadingCanceled();
498
499 /**
500 * Is emitted after DolphinView::setUrl() has been invoked and provides
501 * the information how much percent of the current directory have been loaded.
502 */
503 void directoryLoadingProgress(int percent);
504
505 /**
506 * Is emitted if the sorting is done asynchronously and provides the
507 * progress information of the sorting.
508 */
509 void directorySortingProgress(int percent);
510
511 /**
512 * Emitted when the file-item-model emits redirection.
513 * Testcase: fish://localhost
514 */
515 void redirection(const QUrl& oldUrl, const QUrl& newUrl);
516
517 /**
518 * Is emitted when the URL set by DolphinView::setUrl() represents a file.
519 * In this case no signal errorMessage() will be emitted.
520 */
521 void urlIsFileError(const QUrl& url);
522
523 /**
524 * Is emitted when the write state of the folder has been changed. The application
525 * should disable all actions like "Create New..." that depend on the write
526 * state.
527 */
528 void writeStateChanged(bool isFolderWritable);
529
530 /**
531 * Is emitted if the URL should be changed to the previous URL of the
532 * history (e.g. because the "back"-mousebutton has been pressed).
533 */
534 void goBackRequested();
535
536 /**
537 * Is emitted if the URL should be changed to the next URL of the
538 * history (e.g. because the "next"-mousebutton has been pressed).
539 */
540 void goForwardRequested();
541
542 /**
543 * Is emitted when the user wants to move the focus to another view.
544 */
545 void toggleActiveViewRequested();
546
547 /**
548 * Is emitted when the user clicks a tag or a link
549 * in the metadata widget of a tooltip.
550 */
551 void urlActivated(const QUrl& url);
552
553 protected:
554 /** Changes the zoom level if Control is pressed during a wheel event. */
555 void wheelEvent(QWheelEvent* event) override;
556
557 void hideEvent(QHideEvent* event) override;
558 bool event(QEvent* event) override;
559
560 private slots:
561 /**
562 * Marks the view as active (DolphinView:isActive() will return true)
563 * and emits the 'activated' signal if it is not already active.
564 */
565 void activate();
566
567 void slotItemActivated(int index);
568 void slotItemsActivated(const KItemSet& indexes);
569 void slotItemMiddleClicked(int index);
570 void slotItemContextMenuRequested(int index, const QPointF& pos);
571 void slotViewContextMenuRequested(const QPointF& pos);
572 void slotHeaderContextMenuRequested(const QPointF& pos);
573 void slotHeaderColumnWidthChangeFinished(const QByteArray& role, qreal current);
574 void slotItemHovered(int index);
575 void slotItemUnhovered(int index);
576 void slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* event);
577 void slotModelChanged(KItemModelBase* current, KItemModelBase* previous);
578 void slotMouseButtonPressed(int itemIndex, Qt::MouseButtons buttons);
579 void slotRenameDialogRenamingFinished(const QList<QUrl>& urls);
580 void slotSelectedItemTextPressed(int index);
581
582 /*
583 * Is called when new items get pasted or dropped.
584 */
585 void slotItemCreated(const QUrl &url);
586 /*
587 * Is called after all pasted or dropped items have been copied to destination.
588 */
589 void slotPasteJobResult(KJob *job);
590
591 /**
592 * Emits the signal \a selectionChanged() with a small delay. This is
593 * because getting all file items for the selection can be an expensive
594 * operation. Fast selection changes are collected in this case and
595 * the signal is emitted only after no selection change has been done
596 * within a small delay.
597 */
598 void slotSelectionChanged(const KItemSet& current, const KItemSet& previous);
599
600 /**
601 * Is called by emitDelayedSelectionChangedSignal() and emits the
602 * signal \a selectionChanged() with all selected file items as parameter.
603 */
604 void emitSelectionChangedSignal();
605
606 /**
607 * Updates the view properties of the current URL to the
608 * sorting given by \a role.
609 */
610 void updateSortRole(const QByteArray& role);
611
612 /**
613 * Updates the view properties of the current URL to the
614 * sort order given by \a order.
615 */
616 void updateSortOrder(Qt::SortOrder order);
617
618 /**
619 * Updates the view properties of the current URL to the
620 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
621 */
622 void updateSortFoldersFirst(bool foldersFirst);
623
624 /**
625 * Indicates in the status bar that the delete operation
626 * of the job \a job has been finished.
627 */
628 void slotDeleteFileFinished(KJob* job);
629
630 /**
631 * Indicates in the status bar that the trash operation
632 * of the job \a job has been finished.
633 */
634 void slotTrashFileFinished(KJob* job);
635
636 /**
637 * Invoked when the rename job is done, for error handling.
638 */
639 void slotRenamingResult(KJob* job);
640
641 /**
642 * Invoked when the file item model has started the loading
643 * of the directory specified by DolphinView::url().
644 */
645 void slotDirectoryLoadingStarted();
646
647 /**
648 * Invoked when the file item model indicates that the loading of a directory has
649 * been completed. Assures that pasted items and renamed items get seleced.
650 */
651 void slotDirectoryLoadingCompleted();
652
653 /**
654 * Is invoked when items of KFileItemModel have been changed.
655 */
656 void slotItemsChanged();
657
658 /**
659 * Is invoked when the sort order has been changed by the user by clicking
660 * on a header item. The view properties of the directory will get updated.
661 */
662 void slotSortOrderChangedByHeader(Qt::SortOrder current, Qt::SortOrder previous);
663
664 /**
665 * Is invoked when the sort role has been changed by the user by clicking
666 * on a header item. The view properties of the directory will get updated.
667 */
668 void slotSortRoleChangedByHeader(const QByteArray& current, const QByteArray& previous);
669
670 /**
671 * Is invoked when the visible roles have been changed by the user by dragging
672 * a header item. The view properties of the directory will get updated.
673 */
674 void slotVisibleRolesChangedByHeader(const QList<QByteArray>& current,
675 const QList<QByteArray>& previous);
676
677 void slotRoleEditingCanceled();
678 void slotRoleEditingFinished(int index, const QByteArray& role, const QVariant& value);
679
680 /**
681 * Observes the item with the URL \a url. As soon as the directory
682 * model indicates that the item is available, the item will
683 * get selected and it is assured that the item stays visible.
684 */
685 void observeCreatedItem(const QUrl &url);
686
687 /**
688 * Called when a redirection happens.
689 * Testcase: fish://localhost
690 */
691 void slotDirectoryRedirection(const QUrl& oldUrl, const QUrl& newUrl);
692
693 /**
694 * Applies the state that has been restored by restoreViewState()
695 * to the view.
696 */
697 void updateViewState();
698
699 void hideToolTip();
700
701 /**
702 * Calculates the number of currently shown files into
703 * \a fileCount and the number of folders into \a folderCount.
704 * The size of all files is written into \a totalFileSize.
705 * It is recommend using this method instead of asking the
706 * directory lister or the model directly, as it takes
707 * filtering and hierarchical previews into account.
708 */
709 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
710
711 void slotTwoClicksRenamingTimerTimeout();
712
713 private:
714 void loadDirectory(const QUrl& url, bool reload = false);
715
716 /**
717 * Applies the view properties which are defined by the current URL
718 * to the DolphinView properties. The view properties are read from a
719 * .directory file either in the current directory, or in the
720 * share/apps/dolphin/view_properties/ subfolder of the user's .kde folder.
721 */
722 void applyViewProperties();
723
724 /**
725 * Applies the given view properties to the DolphinView.
726 */
727 void applyViewProperties(const ViewProperties& props);
728
729 /**
730 * Applies the m_mode property to the corresponding
731 * itemlayout-property of the KItemListView.
732 */
733 void applyModeToView();
734
735 /**
736 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
737 * Pastes the clipboard data into the URL \a url.
738 */
739 void pasteToUrl(const QUrl& url);
740
741 /**
742 * Returns a list of URLs for all selected items. The list is
743 * simplified, so that when the URLs are part of different tree
744 * levels, only the parent is returned.
745 */
746 QList<QUrl> simplifiedSelectedUrls() const;
747
748 /**
749 * Returns the MIME data for all selected items.
750 */
751 QMimeData* selectionMimeData() const;
752
753 /**
754 * Updates m_isFolderWritable dependent on whether the folder represented by
755 * the current URL is writable. If the state has changed, the signal
756 * writeableStateChanged() will be emitted.
757 */
758 void updateWritableState();
759
760 /**
761 * @return The current URL if no viewproperties-context is given (see
762 * DolphinView::viewPropertiesContext(), otherwise the context
763 * is returned.
764 */
765 QUrl viewPropertiesUrl() const;
766
767 /**
768 * Clears the selection and updates current item and selection according to the parameters
769 *
770 * @param current URL to be set as current
771 * @param selected list of selected items
772 */
773 void forceUrlsSelection(const QUrl& current, const QList<QUrl>& selected);
774
775 void abortTwoClicksRenaming();
776
777 private:
778 void updatePalette();
779
780 bool m_active;
781 bool m_tabsForFiles;
782 bool m_assureVisibleCurrentIndex;
783 bool m_isFolderWritable;
784 bool m_dragging; // True if a dragging is done. Required to be able to decide whether a
785 // tooltip may be shown when hovering an item.
786
787 QUrl m_url;
788 QString m_viewPropertiesContext;
789 Mode m_mode;
790 QList<QByteArray> m_visibleRoles;
791
792 QVBoxLayout* m_topLayout;
793
794 KFileItemModel* m_model;
795 DolphinItemListView* m_view;
796 KItemListContainer* m_container;
797
798 ToolTipManager* m_toolTipManager;
799
800 QTimer* m_selectionChangedTimer;
801
802 QUrl m_currentItemUrl; // Used for making the view to remember the current URL after F5
803 bool m_scrollToCurrentItem; // Used for marking we need to scroll to current item or not
804 QPoint m_restoredContentsPosition;
805
806 QList<QUrl> m_selectedUrls; // Used for making the view to remember selections after F5
807 bool m_clearSelectionBeforeSelectingNewItems;
808 bool m_markFirstNewlySelectedItemAsCurrent;
809
810 VersionControlObserver* m_versionControlObserver;
811
812 QTimer* m_twoClicksRenamingTimer;
813 QUrl m_twoClicksRenamingItemUrl;
814
815 // For unit tests
816 friend class TestBase;
817 friend class DolphinDetailsViewTest;
818 friend class DolphinPart; // Accesses m_model
819 };
820
821 /// Allow using DolphinView::Mode in QVariant
822 Q_DECLARE_METATYPE(DolphinView::Mode)
823
824 #endif // DOLPHINVIEW_H