- m_refreshing(false),
- m_showProgress(false),
- m_mode(mode),
- m_iconsView(0),
- m_detailsView(0),
- m_statusBar(0),
- m_iconSize(0),
- m_folderCount(0),
- m_fileCount(0),
- m_filterBar(0)
-{
- setFocusPolicy(Qt::StrongFocus);
- m_topLayout = new Q3VBoxLayout(this);
-
- Dolphin& dolphin = Dolphin::mainWin();
-
- connect(this, SIGNAL(signalModeChanged()),
- &dolphin, SLOT(slotViewModeChanged()));
- connect(this, SIGNAL(signalShowHiddenFilesChanged()),
- &dolphin, SLOT(slotShowHiddenFilesChanged()));
- connect(this, SIGNAL(signalSortingChanged(DolphinView::Sorting)),
- &dolphin, SLOT(slotSortingChanged(DolphinView::Sorting)));
- connect(this, SIGNAL(signalSortOrderChanged(Qt::SortOrder)),
- &dolphin, SLOT(slotSortOrderChanged(Qt::SortOrder)));
-
- m_urlNavigator = new UrlNavigator(url, this);
- connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- this, SLOT(slotUrlChanged(const KUrl&)));
- connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- &dolphin, SLOT(slotUrlChanged(const KUrl&)));
- connect(m_urlNavigator, SIGNAL(historyChanged()),
- &dolphin, SLOT(slotHistoryChanged()));
-
- m_statusBar = new DolphinStatusBar(this);
-
- m_dirLister = new DolphinDirLister();
- m_dirLister->setAutoUpdate(true);
- m_dirLister->setMainWindow(this);
- m_dirLister->setShowingDotFiles(showHiddenFiles);
- connect(m_dirLister, SIGNAL(clear()),
- this, SLOT(slotClear()));
- connect(m_dirLister, SIGNAL(percent(int)),
- this, SLOT(slotPercent(int)));
- connect(m_dirLister, SIGNAL(deleteItem(KFileItem*)),
- this, SLOT(slotDeleteItem(KFileItem*)));
- connect(m_dirLister, SIGNAL(completed()),
- this, SLOT(slotCompleted()));
- connect(m_dirLister, SIGNAL(infoMessage(const QString&)),
- this, SLOT(slotInfoMessage(const QString&)));
- connect(m_dirLister, SIGNAL(errorMessage(const QString&)),
- this, SLOT(slotErrorMessage(const QString&)));
- connect(m_dirLister, SIGNAL(refreshItems(const KFileItemList&)),
- this, SLOT(slotRefreshItems(const KFileItemList&)));
- connect(m_dirLister, SIGNAL(redirection(const KUrl&, const KUrl&)),
- this, SIGNAL(redirection(const KUrl&, const KUrl&)));
- connect(m_dirLister, SIGNAL(newItems(const KFileItemList&)),
- this, SLOT(slotAddItems(const KFileItemList&)));
-
- m_iconSize = K3Icon::SizeMedium;
-
- m_topLayout->addWidget(m_urlNavigator);
- createView();
-
- m_filterBar = new FilterBar(this);
- m_filterBar->hide();
- m_topLayout->addWidget(m_filterBar);
- connect(m_filterBar, SIGNAL(signalFilterChanged(const QString&)),
- this, SLOT(slotChangeNameFilter(const QString&)));
-
- m_topLayout->addWidget(m_statusBar);
+ m_active(true),
+ m_showPreview(false),
+ m_storedCategorizedSorting(false),
+ m_tabsForFiles(false),
+ m_isContextMenuOpen(false),
+ m_ignoreViewProperties(false),
+ m_assureVisibleCurrentIndex(false),
+ m_mode(DolphinView::IconsView),
+ m_topLayout(0),
+ m_controller(0),
+ m_viewAccessor(proxyModel),
+ m_selectionModel(0),
+ m_selectionChangedTimer(0),
+ m_rootUrl(),
+ m_activeItemUrl(),
+ m_restoredContentsPosition(),
+ m_createdItemUrl(),
+ m_selectedItems(),
+ m_newFileNames()
+{
+ m_topLayout = new QVBoxLayout(this);
+ m_topLayout->setSpacing(0);
+ m_topLayout->setMargin(0);
+
+ m_controller = new DolphinController(this);
+ m_controller->setUrl(url);
+
+ connect(m_controller, SIGNAL(urlChanged(const KUrl&)),
+ this, SIGNAL(urlChanged(const KUrl&)));
+
+ connect(m_controller, SIGNAL(requestContextMenu(const QPoint&, const QList<QAction*>&)),
+ this, SLOT(openContextMenu(const QPoint&, const QList<QAction*>&)));
+ connect(m_controller, SIGNAL(urlsDropped(const KFileItem&, const KUrl&, QDropEvent*)),
+ this, SLOT(dropUrls(const KFileItem&, const KUrl&, QDropEvent*)));
+ connect(m_controller, SIGNAL(sortingChanged(DolphinView::Sorting)),
+ this, SLOT(updateSorting(DolphinView::Sorting)));
+ connect(m_controller, SIGNAL(sortOrderChanged(Qt::SortOrder)),
+ this, SLOT(updateSortOrder(Qt::SortOrder)));
+ connect(m_controller, SIGNAL(sortFoldersFirstChanged(bool)),
+ this, SLOT(updateSortFoldersFirst(bool)));
+ connect(m_controller, SIGNAL(additionalInfoChanged(const KFileItemDelegate::InformationList&)),
+ this, SLOT(updateAdditionalInfo(const KFileItemDelegate::InformationList&)));
+ connect(m_controller, SIGNAL(itemTriggered(const KFileItem&)),
+ this, SLOT(triggerItem(const KFileItem&)));
+ connect(m_controller, SIGNAL(tabRequested(const KUrl&)),
+ this, SIGNAL(tabRequested(const KUrl&)));
+ connect(m_controller, SIGNAL(activated()),
+ this, SLOT(activate()));
+ connect(m_controller, SIGNAL(itemEntered(const KFileItem&)),
+ this, SLOT(showHoverInformation(const KFileItem&)));
+ connect(m_controller, SIGNAL(viewportEntered()),
+ this, SLOT(clearHoverInformation()));
+
+ KDirLister* dirLister = m_viewAccessor.dirLister();
+ connect(dirLister, SIGNAL(redirection(KUrl,KUrl)),
+ this, SLOT(slotRedirection(KUrl,KUrl)));
+ connect(dirLister, SIGNAL(completed()),
+ this, SLOT(slotDirListerCompleted()));
+ connect(dirLister, SIGNAL(refreshItems(const QList<QPair<KFileItem,KFileItem>>&)),
+ this, SLOT(slotRefreshItems()));
+
+ // When a new item has been created by the "Create New..." menu, the item should
+ // get selected and it must be assured that the item will get visible. As the
+ // creation is done asynchronously, several signals must be checked:
+ connect(&DolphinNewMenuObserver::instance(), SIGNAL(itemCreated(const KUrl&)),
+ this, SLOT(observeCreatedItem(const KUrl&)));
+
+ m_selectionChangedTimer = new QTimer(this);
+ m_selectionChangedTimer->setSingleShot(true);
+ m_selectionChangedTimer->setInterval(300);
+ connect(m_selectionChangedTimer, SIGNAL(timeout()),
+ this, SLOT(emitSelectionChangedSignal()));
+
+ applyViewProperties();
+ m_topLayout->addWidget(m_viewAccessor.layoutTarget());