#include "filterbar/filterbar.h"
#include "search/dolphinsearchbox.h"
#include "statusbar/dolphinstatusbar.h"
-#include "views/dolphinplacesmodel.h"
#include "views/draganddrophelper.h"
#include "views/viewmodecontroller.h"
#include "views/viewproperties.h"
m_topLayout->setSpacing(0);
m_topLayout->setMargin(0);
- m_urlNavigator = new KUrlNavigator(DolphinPlacesModel::instance(), url, this);
+ m_urlNavigator = new KUrlNavigator(new KFilePlacesModel(this), url, this);
connect(m_urlNavigator, SIGNAL(urlsDropped(KUrl,QDropEvent*)),
this, SLOT(dropUrls(KUrl,QDropEvent*)));
connect(m_urlNavigator, SIGNAL(activated()),
connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(delayedStatusBarUpdate()));
connect(m_view, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotViewUrlAboutToBeChanged(KUrl)));
connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString)));
+ connect(m_view, SIGNAL(urlIsFileError(KUrl)), this, SLOT(slotUrlIsFileError(KUrl)));
connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(KUrl)),
this, SLOT(slotUrlNavigatorLocationAboutToBeChanged(KUrl)));
return m_searchBox->isVisible();
}
+QString DolphinViewContainer::placesText() const
+{
+ QString text;
+
+ if (isSearchModeEnabled()) {
+ text = m_searchBox->searchPath().fileName() + QLatin1String(": ") + m_searchBox->text();
+ } else {
+ text = url().fileName();
+ if (text.isEmpty()) {
+ text = url().host();
+ }
+ }
+
+ return text;
+}
+
void DolphinViewContainer::setUrl(const KUrl& newUrl)
{
if (newUrl != m_urlNavigator->locationUrl()) {
}
}
+void DolphinViewContainer::slotUrlIsFileError(const KUrl& url)
+{
+ const KFileItem item(KFileItem::Unknown, KFileItem::Unknown, url);
+ slotItemActivated(item);
+}
+
void DolphinViewContainer::slotItemActivated(const KFileItem& item)
{
// It is possible to activate items on inactive views by
} else if (KProtocolManager::isSourceProtocol(url)) {
QString app = "konqueror";
if (url.protocol().startsWith(QLatin1String("http"))) {
- showMessage(i18nc("@info:status",
+ showMessage(i18nc("@info:status", // krazy:exclude=qmethods
"Dolphin does not support web pages, the web browser has been launched"),
Information);