]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinview.h
Implement todo (create a dialog box when ok is enable/disable when text is empty...
[dolphin.git] / src / dolphinview.h
1 /***************************************************************************
2 * Copyright (C) 2006-2009 by Peter Penz <peter.penz@gmx.at> *
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
22 #ifndef DOLPHINVIEW_H
23 #define DOLPHINVIEW_H
24
25 #include <config-nepomuk.h>
26
27 #include "libdolphin_export.h"
28
29 #include <kparts/part.h>
30 #include <kfileitem.h>
31 #include <kfileitemdelegate.h>
32 #include <kio/fileundomanager.h>
33 #include <kio/job.h>
34
35 #include <QBoxLayout>
36 #include <QKeyEvent>
37 #include <QLinkedList>
38 #include <QListView>
39 #include <QSet>
40 #include <QWidget>
41
42 typedef KIO::FileUndoManager::CommandType CommandType;
43
44 class DolphinController;
45 class DolphinColumnViewContainer;
46 class DolphinDetailsView;
47 class DolphinIconsView;
48 class DolphinModel;
49 class DolphinSortFilterProxyModel;
50 class KFilePreviewGenerator;
51 class KAction;
52 class KActionCollection;
53 class KDirLister;
54 class KUrl;
55 class ViewProperties;
56 class DolphinDetailsViewExpander;
57
58 /**
59 * @short Represents a view for the directory content.
60 *
61 * View modes for icons, details and columns are supported. It's
62 * possible to adjust:
63 * - sort order
64 * - sort type
65 * - show hidden files
66 * - show previews
67 *
68 * @see DolphinIconsView
69 * @see DolphinDetailsView
70 * @see DolphinColumnView
71 */
72 class LIBDOLPHINPRIVATE_EXPORT DolphinView : public QWidget
73 {
74 Q_OBJECT
75
76 public:
77 /**
78 * Defines the view mode for a directory. The view mode
79 * can be defined when constructing a DolphinView. The
80 * view mode is automatically updated if the directory itself
81 * defines a view mode (see class ViewProperties for details).
82 */
83 enum Mode
84 {
85 /**
86 * The directory items are shown as icons including an
87 * icon name.
88 */
89 IconsView = 0,
90
91 /**
92 * The icon, the name and at least the size of the directory
93 * items are shown in a table. It is possible to add columns
94 * for date, group and permissions.
95 */
96 DetailsView = 1,
97
98 /**
99 * Each folder is shown in a separate column.
100 */
101 ColumnView = 2,
102 MaxModeEnum = ColumnView
103 };
104
105 /** Defines the sort order for the items of a directory. */
106 enum Sorting
107 {
108 SortByName = 0,
109 SortBySize,
110 SortByDate,
111 SortByPermissions,
112 SortByOwner,
113 SortByGroup,
114 SortByType,
115 MaxSortEnum = SortByType
116 };
117
118 /**
119 * @param parent Parent widget of the view.
120 * @param url Specifies the content which should be shown.
121 * @param proxyModel Used proxy model which specifies the sorting. The
122 * model is not owned by the view and won't get
123 * deleted.
124 */
125 DolphinView(QWidget* parent,
126 const KUrl& url,
127 DolphinSortFilterProxyModel* proxyModel);
128
129 virtual ~DolphinView();
130
131 /**
132 * Returns the current active URL, where all actions are applied.
133 * The URL navigator is synchronized with this URL.
134 */
135 const KUrl& url() const;
136
137 /**
138 * Returns the root URL of the view, which is defined as the first
139 * visible path of DolphinView::url(). Usually the root URL is
140 * equal to DolphinView::url(), but in the case of the column view
141 * when 2 columns are shown, the root URL might be:
142 * /home/peter/Documents
143 * and DolphinView::url() might return
144 * /home/peter/Documents/Music/
145 */
146 KUrl rootUrl() const;
147
148 /**
149 * If \a active is true, the view will marked as active. The active
150 * view is defined as view where all actions are applied to.
151 */
152 void setActive(bool active);
153 bool isActive() const;
154
155 /**
156 * Changes the view mode for the current directory to \a mode.
157 * If the view properties should be remembered for each directory
158 * (GeneralSettings::globalViewProps() returns false), then the
159 * changed view mode will be stored automatically.
160 */
161 void setMode(Mode mode);
162 Mode mode() const;
163
164 /** See setShowPreview */
165 bool showPreview() const;
166
167 /** See setShowHiddenFiles */
168 bool showHiddenFiles() const;
169
170 /** See setCategorizedSorting */
171 bool categorizedSorting() const;
172
173 /**
174 * Returns true, if the categorized sorting is supported by the current
175 * used mode (see DolphinView::setMode()). Currently only DolphinView::IconsView
176 * supports categorizations. To check whether the categorized
177 * sorting is set, use DolphinView::categorizedSorting().
178 */
179 bool supportsCategorizedSorting() const;
180
181 /**
182 * Marks the items indicated by \p urls to get selected after the
183 * directory DolphinView::url() has been loaded. Note that nothing
184 * gets selected if no loading of a directory has been triggered
185 * by DolphinView::setUrl() or DolphinView::reload().
186 */
187 void markUrlsAsSelected(const QList<KUrl>& urls);
188
189 /**
190 * Returns the selected items. The list is empty if no item has been
191 * selected.
192 * @see DolphinView::selectedUrls()
193 */
194 KFileItemList selectedItems() const;
195
196 /**
197 * Returns a list of URLs for all selected items. An empty list
198 * is returned, if no item is selected.
199 * @see DolphinView::selectedItems()
200 */
201 KUrl::List selectedUrls() const;
202
203 /**
204 * Returns the number of selected items (this is faster than
205 * invoking selectedItems().count()).
206 */
207 int selectedItemsCount() const;
208
209 QItemSelectionModel* selectionModel() const;
210
211 /**
212 * Sets the zoom level to \a level. It is assured that the used
213 * level is adjusted to be inside the range ZoomLevelInfo::minimumLevel() and
214 * ZoomLevelInfo::maximumLevel().
215 */
216 void setZoomLevel(int level);
217 int zoomLevel() const;
218
219 /**
220 * Returns true, if zooming in is possible. If false is returned,
221 * the maximum zooming level has been reached.
222 */
223 bool isZoomInPossible() const;
224
225 /**
226 * Returns true, if zooming out is possible. If false is returned,
227 * the minimum zooming level has been reached.
228 */
229 bool isZoomOutPossible() const;
230
231 /** Sets the sort order of the items inside a directory (see DolphinView::Sorting). */
232 void setSorting(Sorting sorting);
233
234 /** Returns the sort order of the items inside a directory (see DolphinView::Sorting). */
235 Sorting sorting() const;
236
237 /** Sets the sort order (Qt::Ascending or Qt::Descending) for the items. */
238 void setSortOrder(Qt::SortOrder order);
239
240 /** Returns the current used sort order (Qt::Ascending or Qt::Descending). */
241 Qt::SortOrder sortOrder() const;
242
243 /** Sets a separate sorting with folders first (true) or a mixed sorting of files and folders (false). */
244 void setSortFoldersFirst(bool foldersFirst);
245
246 /** Returns if files and folders are sorted separately or not. */
247 bool sortFoldersFirst() const;
248
249 /** Sets the additional information which should be shown for the items. */
250 void setAdditionalInfo(KFileItemDelegate::InformationList info);
251
252 /** Returns the additional information which should be shown for the items. */
253 KFileItemDelegate::InformationList additionalInfo() const;
254
255 /** Reloads the current directory. */
256 void reload();
257
258 /**
259 * Refreshes the view to get synchronized with the (updated) Dolphin settings.
260 * This method only needs to get invoked if the view settings for the Icons View,
261 * Details View or Columns View have been changed.
262 */
263 void refresh();
264
265 /**
266 * Filters the currently shown items by \a nameFilter. All items
267 * which contain the given filter string will be shown.
268 */
269 void setNameFilter(const QString& nameFilter);
270
271 /**
272 * Calculates the number of currently shown files into
273 * \a fileCount and the number of folders into \a folderCount.
274 * The size of all files is written into \a totalFileSize.
275 * It is recommend using this method instead of asking the
276 * directory lister or the model directly, as it takes
277 * filtering and hierarchical previews into account.
278 */
279 void calculateItemCount(int& fileCount, int& folderCount, KIO::filesize_t& totalFileSize) const;
280
281 /**
282 * Returns a textual representation of the state of the current
283 * folder or selected items, suitable for use in the status bar.
284 */
285 QString statusBarText() const;
286
287 /**
288 * Returns the version control actions that are provided for the items \p items.
289 * Usually the actions are presented in the context menu.
290 */
291 QList<QAction*> versionControlActions(const KFileItemList& items) const;
292
293 /**
294 * Updates the state of the 'Additional Information' actions in \a collection.
295 */
296 void updateAdditionalInfoActions(KActionCollection* collection);
297
298 /**
299 * Returns the state of the paste action:
300 * first is whether the action should be enabled
301 * second is the text for the action
302 */
303 QPair<bool, QString> pasteInfo() const;
304
305 /**
306 * If \a tabsForFiles is true, the signal tabRequested() will also
307 * emitted also for files. Per default tabs for files is disabled
308 * and hence the signal tabRequested() will only be emitted for
309 * directories.
310 */
311 void setTabsForFilesEnabled(bool tabsForFiles);
312 bool isTabsForFilesEnabled() const;
313
314 /**
315 * Marks the item \a url as active item as soon as it has
316 * been loaded by the directory lister. This is useful mark
317 * the previously visited directory as active when going
318 * back in history (the URL is known, but the item is not
319 * loaded yet).
320 */
321 void activateItem(const KUrl& url);
322
323 /**
324 * Returns true if the current view allows folders to be expanded,
325 * i.e. presents a hierarchical view to the user.
326 */
327 bool itemsExpandable() const;
328
329 /**
330 * Restores the view state (current item, contents position, details view expansion state)
331 */
332 void restoreState(QDataStream& stream);
333
334 /**
335 * Saves the view state (current item, contents position, details view expansion state)
336 */
337 void saveState(QDataStream& stream);
338
339 public slots:
340 /**
341 * Changes the directory to \a url. If the current directory is equal to
342 * \a url, nothing will be done (use DolphinView::reload() instead).
343 */
344 void setUrl(const KUrl& url);
345
346 /**
347 * Selects all items.
348 * @see DolphinView::selectedItems()
349 */
350 void selectAll();
351
352 /**
353 * Inverts the current selection: selected items get unselected,
354 * unselected items get selected.
355 * @see DolphinView::selectedItems()
356 */
357 void invertSelection();
358
359 /** Returns true, if at least one item is selected. */
360 bool hasSelection() const;
361
362 void clearSelection();
363
364 /**
365 * Triggers the renaming of the currently selected items, where
366 * the user must input a new name for the items.
367 */
368 void renameSelectedItems();
369
370 /**
371 * Moves all selected items to the trash.
372 */
373 void trashSelectedItems();
374
375 /**
376 * Deletes all selected items.
377 */
378 void deleteSelectedItems();
379
380 /**
381 * Copies all selected items to the clipboard and marks
382 * the items as cut.
383 */
384 void cutSelectedItems();
385
386 /** Copies all selected items to the clipboard. */
387 void copySelectedItems();
388
389 /** Pastes the clipboard data to this view. */
390 void paste();
391
392 /**
393 * Pastes the clipboard data into the currently selected
394 * folder. If the current selection is not exactly one folder, no
395 * paste operation is done.
396 */
397 void pasteIntoFolder();
398
399 /**
400 * Turns on the file preview for the all files of the current directory,
401 * if \a show is true.
402 * If the view properties should be remembered for each directory
403 * (GeneralSettings::globalViewProps() returns false), then the
404 * preview setting will be stored automatically.
405 */
406 void setShowPreview(bool show);
407
408 /**
409 * Shows all hidden files of the current directory,
410 * if \a show is true.
411 * If the view properties should be remembered for each directory
412 * (GeneralSettings::globalViewProps() returns false), then the
413 * show hidden file setting will be stored automatically.
414 */
415 void setShowHiddenFiles(bool show);
416
417 /**
418 * Summarizes all sorted items by their category \a categorized
419 * is true.
420 * If the view properties should be remembered for each directory
421 * (GeneralSettings::globalViewProps() returns false), then the
422 * categorized sorting setting will be stored automatically.
423 */
424 void setCategorizedSorting(bool categorized);
425
426 /** Switches between an ascending and descending sorting order. */
427 void toggleSortOrder();
428
429 /** Switches between a separate sorting (with folders first) and a mixed sorting of files and folders. */
430 void toggleSortFoldersFirst();
431
432 /**
433 * Switches on or off the displaying of additional information
434 * as specified by \a action.
435 */
436 void toggleAdditionalInfo(QAction* action);
437
438 signals:
439 /**
440 * Is emitted if the view has been activated by e. g. a mouse click.
441 */
442 void activated();
443
444 /** Is emitted if URL of the view has been changed to \a url. */
445 void urlChanged(const KUrl& url);
446
447 /**
448 * Is emitted if the view requests a changing of the current
449 * URL to \a url (see DolphinController::triggerUrlChangeRequest()).
450 */
451 void requestUrlChange(const KUrl& url);
452
453 /**
454 * Is emitted when clicking on an item with the left mouse button.
455 */
456 void itemTriggered(const KFileItem& item);
457
458 /**
459 * Is emitted if a new tab should be opened for the URL \a url.
460 */
461 void tabRequested(const KUrl& url);
462
463 /**
464 * Is emitted if the view mode (IconsView, DetailsView,
465 * PreviewsView) has been changed.
466 */
467 void modeChanged();
468
469 /** Is emitted if the 'show preview' property has been changed. */
470 void showPreviewChanged();
471
472 /** Is emitted if the 'show hidden files' property has been changed. */
473 void showHiddenFilesChanged();
474
475 /** Is emitted if the 'categorized sorting' property has been changed. */
476 void categorizedSortingChanged();
477
478 /** Is emitted if the sorting by name, size or date has been changed. */
479 void sortingChanged(DolphinView::Sorting sorting);
480
481 /** Is emitted if the sort order (ascending or descending) has been changed. */
482 void sortOrderChanged(Qt::SortOrder order);
483
484 /** Is emitted if the sorting of files and folders (separate with folders first or mixed) has been changed. */
485 void sortFoldersFirstChanged(bool foldersFirst);
486
487 /** Is emitted if the additional information shown for this view has been changed. */
488 void additionalInfoChanged();
489
490 /** Is emitted if the zoom level has been changed by zooming in or out. */
491 void zoomLevelChanged(int level);
492
493 /**
494 * Is emitted if information of an item is requested to be shown e. g. in the panel.
495 * If item is null, no item information request is pending.
496 */
497 void requestItemInfo(const KFileItem& item);
498
499 /**
500 * Is emitted whenever the selection has been changed.
501 */
502 void selectionChanged(const KFileItemList& selection);
503
504 /**
505 * Is emitted if a context menu is requested for the item \a item,
506 * which is part of \a url. If the item is null, the context menu
507 * for the URL should be shown and the custom actions \a customActions
508 * will be added.
509 */
510 void requestContextMenu(const KFileItem& item,
511 const KUrl& url,
512 const QList<QAction*>& customActions);
513
514 /**
515 * Is emitted if an information message with the content \a msg
516 * should be shown.
517 */
518 void infoMessage(const QString& msg);
519
520 /**
521 * Is emitted if an error message with the content \a msg
522 * should be shown.
523 */
524 void errorMessage(const QString& msg);
525
526 /**
527 * Is emitted if an "operation completed" message with the content \a msg
528 * should be shown.
529 */
530 void operationCompletedMessage(const QString& msg);
531
532 /**
533 * Is emitted after DolphinView::setUrl() has been invoked and
534 * the path \a url is currently loaded. If this signal is emitted,
535 * it is assured that the view contains already the correct root
536 * URL and property settings.
537 */
538 void startedPathLoading(const KUrl& url);
539
540 /**
541 * Emitted when KDirLister emits redirection.
542 * Testcase: fish://localhost
543 */
544 void redirection(const KUrl& oldUrl, const KUrl& newUrl);
545
546 protected:
547 /** @see QWidget::mouseReleaseEvent */
548 virtual void mouseReleaseEvent(QMouseEvent* event);
549 virtual bool eventFilter(QObject* watched, QEvent* event);
550
551 private slots:
552 /**
553 * Marks the view as active (DolphinView:isActive() will return true)
554 * and emits the 'activated' signal if it is not already active.
555 */
556 void activate();
557
558 /**
559 * If the item \a item is a directory, then this
560 * directory will be loaded. If the item is a file, the corresponding
561 * application will get started.
562 */
563 void triggerItem(const KFileItem& index);
564
565 /**
566 * Emits the signal \a selectionChanged() with a small delay. This is
567 * because getting all file items for the signal can be an expensive
568 * operation. Fast selection changes are collected in this case and
569 * the signal is emitted only after no selection change has been done
570 * within a small delay.
571 */
572 void slotSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
573
574 /**
575 * Is called by emitDelayedSelectionChangedSignal() and emits the
576 * signal \a selectionChanged() with all selected file items as parameter.
577 */
578 void emitSelectionChangedSignal();
579
580 /**
581 * Opens the context menu on position \a pos. The position
582 * is used to check whether the context menu is related to an
583 * item or to the viewport.
584 */
585 void openContextMenu(const QPoint& pos, const QList<QAction*>& customActions);
586
587 /**
588 * Drops dragged URLs to the destination path \a destPath. If
589 * the URLs are dropped above an item inside the destination path,
590 * the item is indicated by \a destItem.
591 */
592 void dropUrls(const KFileItem& destItem,
593 const KUrl& destPath,
594 QDropEvent* event);
595
596 /**
597 * Updates the view properties of the current URL to the
598 * sorting given by \a sorting.
599 */
600 void updateSorting(DolphinView::Sorting sorting);
601
602 /**
603 * Updates the view properties of the current URL to the
604 * sort order given by \a order.
605 */
606 void updateSortOrder(Qt::SortOrder order);
607
608 /**
609 * Updates the view properties of the current URL to the
610 * sorting of files and folders (separate with folders first or mixed) given by \a foldersFirst.
611 */
612 void updateSortFoldersFirst(bool foldersFirst);
613
614 /**
615 * Updates the view properties of the current URL to the
616 * additional information given by \a info.
617 */
618 void updateAdditionalInfo(const KFileItemDelegate::InformationList& info);
619
620 /**
621 * Updates the status bar to show hover information for the
622 * item \a item. If currently other items are selected,
623 * no hover information is shown.
624 * @see DolphinView::clearHoverInformation()
625 */
626 void showHoverInformation(const KFileItem& item);
627
628 /**
629 * Clears the hover information shown in the status bar.
630 * @see DolphinView::showHoverInformation().
631 */
632 void clearHoverInformation();
633
634 /**
635 * Indicates in the status bar that the delete operation
636 * of the job \a job has been finished.
637 */
638 void slotDeleteFileFinished(KJob* job);
639
640 /**
641 * Is emitted if the controller requests a changing of the current
642 * URL to \a url
643 */
644 void slotRequestUrlChange(const KUrl& url);
645
646 /**
647 * Invoked when the directory lister has completed the loading of
648 * items. Assures that pasted items and renamed items get seleced.
649 */
650 void slotDirListerCompleted();
651
652 /**
653 * Invoked when the loading of the directory is finished.
654 * Restores the active item and the scroll position if possible.
655 */
656 void slotLoadingCompleted();
657
658 /**
659 * Is invoked when the KDirLister indicates refreshed items.
660 */
661 void slotRefreshItems();
662
663 /**
664 * Observes the item with the URL \a url. As soon as the directory
665 * model indicates that the item is available, the item will
666 * get selected and it is assure that the item stays visible.
667 *
668 * @see selectAndScrollToCreatedItem()
669 */
670 void observeCreatedItem(const KUrl& url);
671
672 /**
673 * Selects and scrolls to the item that got observed
674 * by observeCreatedItem().
675 */
676 void selectAndScrollToCreatedItem();
677
678 /**
679 * Called when a redirection happens.
680 * Testcase: fish://localhost
681 */
682 void slotRedirection(const KUrl& oldUrl, const KUrl& newUrl);
683
684 /**
685 * Restores the contents position, if history information about the old position is available.
686 */
687 void restoreContentsPosition();
688
689 private:
690 void loadDirectory(const KUrl& url, bool reload = false);
691
692 /**
693 * Applies the view properties which are defined by the current URL
694 * to the DolphinView properties.
695 */
696 void applyViewProperties();
697
698 /**
699 * Creates a new view representing the given view mode (DolphinView::mode()).
700 * The current view will get deleted.
701 */
702 void createView();
703
704 void deleteView();
705
706 /**
707 * Helper method for DolphinView::paste() and DolphinView::pasteIntoFolder().
708 * Pastes the clipboard data into the URL \a url.
709 */
710 void pasteToUrl(const KUrl& url);
711
712 /**
713 * Checks whether the current item view has the same zoom level
714 * as \a oldZoomLevel. If this is not the case, the zoom level
715 * of the controller is updated and a zoomLevelChanged() signal
716 * is emitted.
717 */
718 void updateZoomLevel(int oldZoomLevel);
719
720 /**
721 * Returns a list of URLs for all selected items. The list is
722 * simplified, so that when the URLs are part of different tree
723 * levels, only the parent is returned.
724 */
725 KUrl::List simplifiedSelectedUrls() const;
726
727 /**
728 * Returns the MIME data for all selected items.
729 */
730 QMimeData* selectionMimeData() const;
731
732 /**
733 * Is invoked after a paste operation or a drag & drop
734 * operation and adds the filenames of all URLs from \a mimeData to
735 * m_newFileNames. This allows to select all newly added
736 * items in slotDirListerCompleted().
737 */
738 void addNewFileNames(const QMimeData* mimeData);
739
740 private:
741 /**
742 * Abstracts the access to the different view implementations
743 * for icons-, details- and column-view.
744 */
745 class ViewAccessor
746 {
747 public:
748 ViewAccessor(DolphinSortFilterProxyModel* proxyModel);
749 ~ViewAccessor();
750
751 void createView(QWidget* parent, DolphinController* controller, Mode mode);
752 void deleteView();
753
754 /**
755 * Must be invoked before the URL has been changed and allows view implementations
756 * like the column view to create a new column.
757 */
758 void prepareUrlChange(const KUrl& url);
759
760 QAbstractItemView* itemView() const;
761 KFileItemDelegate* itemDelegate() const;
762
763 /**
764 * Returns the widget that should be added to the layout as target. Usually
765 * the item view itself is returned, but in the case of the column view
766 * a container widget is returned.
767 */
768 QWidget* layoutTarget() const;
769
770 KUrl rootUrl() const;
771 KDirLister* rootDirLister() const;
772
773 bool supportsCategorizedSorting() const;
774 bool itemsExpandable() const;
775 QSet<KUrl> expandedUrls() const;
776 const DolphinDetailsViewExpander* setExpandedUrls(const QSet<KUrl>& urlsToExpand);
777
778 /**
779 * Returns true, if a reloading of the items is required
780 * when the additional information properties have been changed
781 * by the user.
782 */
783 bool reloadOnAdditionalInfoChange() const;
784
785 DolphinModel* dirModel() const;
786 DolphinSortFilterProxyModel* proxyModel() const;
787 KDirLister* dirLister() const;
788
789 private:
790 DolphinIconsView* m_iconsView;
791 DolphinDetailsView* m_detailsView;
792 DolphinColumnViewContainer* m_columnsContainer;
793 DolphinSortFilterProxyModel* m_proxyModel;
794 QAbstractItemView* m_dragSource;
795 QPointer<DolphinDetailsViewExpander> m_detailsViewExpander;
796 };
797
798 bool m_active : 1;
799 bool m_showPreview : 1;
800 bool m_loadingDirectory : 1;
801 bool m_storedCategorizedSorting : 1;
802 bool m_tabsForFiles : 1;
803 bool m_isContextMenuOpen : 1; // TODO: workaround for Qt-issue 207192
804 bool m_ignoreViewProperties : 1;
805 bool m_assureVisibleCurrentIndex : 1;
806 bool m_expanderActive : 1;
807
808 Mode m_mode;
809
810 QVBoxLayout* m_topLayout;
811
812 DolphinController* m_controller;
813 ViewAccessor m_viewAccessor;
814
815 QItemSelectionModel* m_selectionModel; // allow to switch views without losing the selection
816 QTimer* m_selectionChangedTimer;
817
818 KUrl m_rootUrl;
819 KUrl m_activeItemUrl;
820 QPoint m_restoredContentsPosition;
821 KUrl m_createdItemUrl; // URL for a new item that got created by the "Create New..." menu
822 KFileItemList m_selectedItems; // this is used for making the View to remember selections after F5
823
824 /**
825 * Remembers the filenames that have been added by a paste operation
826 * or a drag & drop operation. Allows to select the items in
827 * slotDirListerCompleted().
828 */
829 QSet<QString> m_newFileNames;
830 };
831
832 /// Allow using DolphinView::Mode in QVariant
833 Q_DECLARE_METATYPE(DolphinView::Mode)
834
835 #endif // DOLPHINVIEW_H