- connect(m_searchBox, SIGNAL(closeRequest()), this, SLOT(closeSearchBox()));
- connect(m_searchBox, SIGNAL(search(QString)), this, SLOT(startSearching(QString)));
- connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus()));
-
- DolphinDirLister* dirLister = new DolphinDirLister();
- dirLister->setAutoUpdate(true);
- dirLister->setMainWindow(window());
- dirLister->setDelayedMimeTypes(true);
-
- DolphinModel* dolphinModel = new DolphinModel(this);
- dolphinModel->setDirLister(dirLister); // dolphinModel takes ownership of dirLister
- dolphinModel->setDropsAllowed(DolphinModel::DropOnDirectory);
-
- DolphinSortFilterProxyModel* proxyModel = new DolphinSortFilterProxyModel(this);
- proxyModel->setSourceModel(dolphinModel);
- proxyModel->setFilterCaseSensitivity(Qt::CaseInsensitive);
-
- // TODO: In the case of the column view the directory lister changes. Let the DolphinView
- // inform the container about this information for KDE SC 4.7
- connect(dirLister, SIGNAL(clear()),
- this, SLOT(delayedStatusBarUpdate()));
- connect(dirLister, SIGNAL(percent(int)),
- this, SLOT(updateProgress(int)));
- connect(dirLister, SIGNAL(itemsDeleted(const KFileItemList&)),
- this, SLOT(delayedStatusBarUpdate()));
- connect(dirLister, SIGNAL(newItems(KFileItemList)),
- this, SLOT(delayedStatusBarUpdate()));
- connect(dirLister, SIGNAL(infoMessage(const QString&)),
- this, SLOT(showInfoMessage(const QString&)));
- connect(dirLister, SIGNAL(errorMessage(const QString&)),
- this, SLOT(showErrorMessage(const QString&)));
- connect(dirLister, SIGNAL(urlIsFileError(const KUrl&)),
- this, SLOT(openFile(const KUrl&)));
-
- m_view = new DolphinView(this, url, proxyModel);
- connect(m_view, SIGNAL(urlChanged(const KUrl&)),
- m_urlNavigator, SLOT(setUrl(const KUrl&)));
- connect(m_view, SIGNAL(requestItemInfo(KFileItem)),
- this, SLOT(showItemInfo(KFileItem)));
- connect(m_view, SIGNAL(errorMessage(const QString&)),
- this, SLOT(showErrorMessage(const QString&)));
- connect(m_view, SIGNAL(infoMessage(const QString&)),
- this, SLOT(showInfoMessage(const QString&)));
- connect(m_view, SIGNAL(operationCompletedMessage(const QString&)),
- this, SLOT(showOperationCompletedMessage(const QString&)));
- connect(m_view, SIGNAL(itemTriggered(KFileItem)),
- this, SLOT(slotItemTriggered(KFileItem)));
- connect(m_view, SIGNAL(redirection(KUrl, KUrl)),
- this, SLOT(redirect(KUrl, KUrl)));
- connect(m_view, SIGNAL(selectionChanged(const KFileItemList&)),
- this, SLOT(delayedStatusBarUpdate()));
- connect(m_view, SIGNAL(startedPathLoading(KUrl)),
- this, SLOT(slotStartedPathLoading()));
- connect(m_view, SIGNAL(finishedPathLoading(KUrl)),
- this, SLOT(slotFinishedPathLoading()));
- connect(m_view, SIGNAL(writeStateChanged(bool)),
- this, SIGNAL(writeStateChanged(bool)));
-
- connect(m_urlNavigator, SIGNAL(urlChanged(const KUrl&)),
- this, SLOT(slotUrlNavigatorLocationChanged(const KUrl&)));
- connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(const KUrl&)),
- this, SLOT(saveViewState()));
- connect(m_urlNavigator, SIGNAL(historyChanged()),
- this, SLOT(slotHistoryChanged()));
-
- // initialize status bar
- m_statusBar = new DolphinStatusBar(this, m_view);
- connect(m_statusBar, SIGNAL(stopPressed()), this, SLOT(stopLoading()));
+ connect(m_searchBox, &DolphinSearchBox::activated, this, &DolphinViewContainer::activate);
+ connect(m_searchBox, &DolphinSearchBox::closeRequest, this, &DolphinViewContainer::closeSearchBox);
+ connect(m_searchBox, &DolphinSearchBox::searchRequest, this, &DolphinViewContainer::startSearching);
+ connect(m_searchBox, &DolphinSearchBox::returnPressed, this, &DolphinViewContainer::requestFocus);
+
+ m_messageWidget = new KMessageWidget(this);
+ m_messageWidget->setCloseButtonVisible(true);
+ m_messageWidget->hide();
+
+ m_view = new DolphinView(url, this);
+ connect(m_view, &DolphinView::urlChanged,
+ m_urlNavigator, &KUrlNavigator::setUrl);
+ connect(m_view, &DolphinView::urlChanged,
+ m_messageWidget, &KMessageWidget::hide);
+ connect(m_view, &DolphinView::directoryLoadingCompleted,
+ m_messageWidget, &KMessageWidget::hide);
+ connect(m_view, &DolphinView::writeStateChanged,
+ this, &DolphinViewContainer::writeStateChanged);
+ connect(m_view, &DolphinView::requestItemInfo,
+ this, &DolphinViewContainer::showItemInfo);
+ connect(m_view, &DolphinView::itemActivated,
+ this, &DolphinViewContainer::slotItemActivated);
+ connect(m_view, &DolphinView::itemsActivated,
+ this, &DolphinViewContainer::slotItemsActivated);
+ connect(m_view, &DolphinView::redirection,
+ this, &DolphinViewContainer::redirect);
+ connect(m_view, &DolphinView::directoryLoadingStarted,
+ this, &DolphinViewContainer::slotDirectoryLoadingStarted);
+ connect(m_view, &DolphinView::directoryLoadingCompleted,
+ this, &DolphinViewContainer::slotDirectoryLoadingCompleted);
+ connect(m_view, &DolphinView::directoryLoadingCanceled,
+ this, &DolphinViewContainer::slotDirectoryLoadingCanceled);
+ connect(m_view, &DolphinView::itemCountChanged,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
+ connect(m_view, &DolphinView::directoryLoadingProgress,
+ this, &DolphinViewContainer::updateDirectoryLoadingProgress);
+ connect(m_view, &DolphinView::directorySortingProgress,
+ this, &DolphinViewContainer::updateDirectorySortingProgress);
+ connect(m_view, &DolphinView::selectionChanged,
+ this, &DolphinViewContainer::delayedStatusBarUpdate);
+ connect(m_view, &DolphinView::urlAboutToBeChanged,
+ this, &DolphinViewContainer::slotViewUrlAboutToBeChanged);
+ connect(m_view, &DolphinView::errorMessage,
+ this, &DolphinViewContainer::showErrorMessage);
+ connect(m_view, &DolphinView::urlIsFileError,
+ this, &DolphinViewContainer::slotUrlIsFileError);
+ connect(m_view, &DolphinView::activated,
+ this, &DolphinViewContainer::activate);
+
+ connect(m_urlNavigator, &KUrlNavigator::urlAboutToBeChanged,
+ this, &DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged);
+ connect(m_urlNavigator, &KUrlNavigator::urlChanged,
+ this, &DolphinViewContainer::slotUrlNavigatorLocationChanged);
+ connect(m_urlNavigator, &KUrlNavigator::historyChanged,
+ this, &DolphinViewContainer::slotHistoryChanged);
+ connect(m_urlNavigator, &KUrlNavigator::returnPressed,
+ this, &DolphinViewContainer::slotReturnPressed);
+ connect(m_urlNavigator, &KUrlNavigator::urlsDropped,
+ m_view, &DolphinView::dropUrls);
+
+ // Initialize status bar
+ m_statusBar = new DolphinStatusBar(this);
+ m_statusBar->setUrl(m_view->url());
+ m_statusBar->setZoomLevel(m_view->zoomLevel());
+ connect(m_view, &DolphinView::urlChanged,
+ m_statusBar, &DolphinStatusBar::setUrl);
+ connect(m_view, &DolphinView::zoomLevelChanged,
+ m_statusBar, &DolphinStatusBar::setZoomLevel);
+ connect(m_view, &DolphinView::infoMessage,
+ m_statusBar, &DolphinStatusBar::setText);
+ connect(m_view, &DolphinView::operationCompletedMessage,
+ m_statusBar, &DolphinStatusBar::setText);
+ connect(m_statusBar, &DolphinStatusBar::stopPressed,
+ this, &DolphinViewContainer::stopDirectoryLoading);
+ connect(m_statusBar, &DolphinStatusBar::zoomLevelChanged,
+ this, &DolphinViewContainer::slotStatusBarZoomLevelChanged);