1 /***************************************************************************
2 * Copyright (C) 2007 by Peter Penz <peter.penz19@gmail.com> *
4 * This program is free software; you can redistribute it and/or modify *
5 * it under the terms of the GNU General Public License as published by *
6 * the Free Software Foundation; either version 2 of the License, or *
7 * (at your option) any later version. *
9 * This program is distributed in the hope that it will be useful, *
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
12 * GNU General Public License for more details. *
14 * You should have received a copy of the GNU General Public License *
15 * along with this program; if not, write to the *
16 * Free Software Foundation, Inc., *
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
18 ***************************************************************************/
20 #include "dolphinviewcontainer.h"
22 #include "dolphin_generalsettings.h"
23 #include "dolphinplacesmodelsingleton.h"
24 #include "dolphindebug.h"
25 #include "filterbar/filterbar.h"
27 #include "search/dolphinsearchbox.h"
28 #include "statusbar/dolphinstatusbar.h"
29 #include "trash/dolphintrash.h"
30 #include "views/viewmodecontroller.h"
31 #include "views/viewproperties.h"
33 #include <KFileItemActions>
34 #include <KIO/PreviewJob>
35 #include <KLocalizedString>
36 #include <KMessageWidget>
37 #include <KProtocolManager>
40 #include <KUrlComboBox>
41 #include <KUrlNavigator>
42 #include <kio_version.h>
45 #include <QLoggingCategory>
49 #include <QVBoxLayout>
51 DolphinViewContainer::DolphinViewContainer(const QUrl
& url
, QWidget
* parent
) :
54 m_navigatorWidget(nullptr),
55 m_urlNavigator(nullptr),
56 m_emptyTrashButton(nullptr),
58 m_messageWidget(nullptr),
62 m_statusBarTimer(nullptr),
63 m_statusBarTimestamp(),
65 #ifdef KActivities_FOUND
66 , m_activityResourceInstance(0)
71 m_topLayout
= new QVBoxLayout(this);
72 m_topLayout
->setSpacing(0);
73 m_topLayout
->setMargin(0);
75 m_navigatorWidget
= new QWidget(this);
76 QHBoxLayout
* navigatorLayout
= new QHBoxLayout(m_navigatorWidget
);
77 navigatorLayout
->setSpacing(0);
78 navigatorLayout
->setMargin(0);
80 m_urlNavigator
= new KUrlNavigator(DolphinPlacesModelSingleton::instance().placesModel(), url
, this);
81 connect(m_urlNavigator
, &KUrlNavigator::activated
,
82 this, &DolphinViewContainer::activate
);
83 connect(m_urlNavigator
->editor(), &KUrlComboBox::completionModeChanged
,
84 this, &DolphinViewContainer::saveUrlCompletionMode
);
86 const GeneralSettings
* settings
= GeneralSettings::self();
87 m_urlNavigator
->setUrlEditable(settings
->editableUrl());
88 m_urlNavigator
->setShowFullPath(settings
->showFullPath());
89 m_urlNavigator
->setHomeUrl(Dolphin::homeUrl());
90 KUrlComboBox
* editor
= m_urlNavigator
->editor();
91 editor
->setCompletionMode(KCompletion::CompletionMode(settings
->urlCompletionMode()));
93 m_emptyTrashButton
= new QPushButton(QIcon::fromTheme(QStringLiteral("user-trash")), i18nc("@action:button", "Empty Trash"), this);
94 m_emptyTrashButton
->setFlat(true);
95 connect(m_emptyTrashButton
, &QPushButton::clicked
, this, [this]() { Trash::empty(this); });
96 connect(&Trash::instance(), &Trash::emptinessChanged
, m_emptyTrashButton
, &QPushButton::setDisabled
);
97 m_emptyTrashButton
->setDisabled(Trash::isEmpty());
98 m_emptyTrashButton
->hide();
100 m_searchBox
= new DolphinSearchBox(this);
102 connect(m_searchBox
, &DolphinSearchBox::activated
, this, &DolphinViewContainer::activate
);
103 connect(m_searchBox
, &DolphinSearchBox::closeRequest
, this, &DolphinViewContainer::closeSearchBox
);
104 connect(m_searchBox
, &DolphinSearchBox::searchRequest
, this, &DolphinViewContainer::startSearching
);
105 connect(m_searchBox
, &DolphinSearchBox::returnPressed
, this, &DolphinViewContainer::requestFocus
);
107 m_messageWidget
= new KMessageWidget(this);
108 m_messageWidget
->setCloseButtonVisible(true);
109 m_messageWidget
->hide();
111 m_view
= new DolphinView(url
, this);
112 connect(m_view
, &DolphinView::urlChanged
,
113 m_urlNavigator
, &KUrlNavigator::setLocationUrl
);
114 connect(m_view
, &DolphinView::urlChanged
,
115 m_messageWidget
, &KMessageWidget::hide
);
116 connect(m_view
, &DolphinView::writeStateChanged
,
117 this, &DolphinViewContainer::writeStateChanged
);
118 connect(m_view
, &DolphinView::requestItemInfo
,
119 this, &DolphinViewContainer::showItemInfo
);
120 connect(m_view
, &DolphinView::itemActivated
,
121 this, &DolphinViewContainer::slotItemActivated
);
122 connect(m_view
, &DolphinView::itemsActivated
,
123 this, &DolphinViewContainer::slotItemsActivated
);
124 connect(m_view
, &DolphinView::redirection
,
125 this, &DolphinViewContainer::redirect
);
126 connect(m_view
, &DolphinView::directoryLoadingStarted
,
127 this, &DolphinViewContainer::slotDirectoryLoadingStarted
);
128 connect(m_view
, &DolphinView::directoryLoadingCompleted
,
129 this, &DolphinViewContainer::slotDirectoryLoadingCompleted
);
130 connect(m_view
, &DolphinView::directoryLoadingCanceled
,
131 this, &DolphinViewContainer::slotDirectoryLoadingCanceled
);
132 connect(m_view
, &DolphinView::itemCountChanged
,
133 this, &DolphinViewContainer::delayedStatusBarUpdate
);
134 connect(m_view
, &DolphinView::directoryLoadingProgress
,
135 this, &DolphinViewContainer::updateDirectoryLoadingProgress
);
136 connect(m_view
, &DolphinView::directorySortingProgress
,
137 this, &DolphinViewContainer::updateDirectorySortingProgress
);
138 connect(m_view
, &DolphinView::selectionChanged
,
139 this, &DolphinViewContainer::delayedStatusBarUpdate
);
140 connect(m_view
, &DolphinView::errorMessage
,
141 this, &DolphinViewContainer::showErrorMessage
);
142 connect(m_view
, &DolphinView::urlIsFileError
,
143 this, &DolphinViewContainer::slotUrlIsFileError
);
144 connect(m_view
, &DolphinView::activated
,
145 this, &DolphinViewContainer::activate
);
147 connect(m_urlNavigator
, &KUrlNavigator::urlAboutToBeChanged
,
148 this, &DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged
);
149 connect(m_urlNavigator
, &KUrlNavigator::urlChanged
,
150 this, &DolphinViewContainer::slotUrlNavigatorLocationChanged
);
151 connect(m_urlNavigator
, &KUrlNavigator::urlSelectionRequested
,
152 this, &DolphinViewContainer::slotUrlSelectionRequested
);
153 connect(m_urlNavigator
, &KUrlNavigator::returnPressed
,
154 this, &DolphinViewContainer::slotReturnPressed
);
155 connect(m_urlNavigator
, &KUrlNavigator::urlsDropped
, this, [=](const QUrl
&destination
, QDropEvent
*event
) {
156 #if KIO_VERSION >= QT_VERSION_CHECK(5, 37, 0)
157 m_view
->dropUrls(destination
, event
, m_urlNavigator
->dropWidget());
159 // TODO: remove as soon as we can hard-depend of KF5 >= 5.37
160 m_view
->dropUrls(destination
, event
, m_view
);
164 connect(m_view
, &DolphinView::directoryLoadingCompleted
, this, [this]() {
165 m_emptyTrashButton
->setVisible(m_view
->url().scheme() == QLatin1String("trash"));
168 // Initialize status bar
169 m_statusBar
= new DolphinStatusBar(this);
170 m_statusBar
->setUrl(m_view
->url());
171 m_statusBar
->setZoomLevel(m_view
->zoomLevel());
172 connect(m_view
, &DolphinView::urlChanged
,
173 m_statusBar
, &DolphinStatusBar::setUrl
);
174 connect(m_view
, &DolphinView::zoomLevelChanged
,
175 m_statusBar
, &DolphinStatusBar::setZoomLevel
);
176 connect(m_view
, &DolphinView::infoMessage
,
177 m_statusBar
, &DolphinStatusBar::setText
);
178 connect(m_view
, &DolphinView::operationCompletedMessage
,
179 m_statusBar
, &DolphinStatusBar::setText
);
180 connect(m_statusBar
, &DolphinStatusBar::stopPressed
,
181 this, &DolphinViewContainer::stopDirectoryLoading
);
182 connect(m_statusBar
, &DolphinStatusBar::zoomLevelChanged
,
183 this, &DolphinViewContainer::slotStatusBarZoomLevelChanged
);
185 m_statusBarTimer
= new QTimer(this);
186 m_statusBarTimer
->setSingleShot(true);
187 m_statusBarTimer
->setInterval(300);
188 connect(m_statusBarTimer
, &QTimer::timeout
, this, &DolphinViewContainer::updateStatusBar
);
190 KIO::FileUndoManager
* undoManager
= KIO::FileUndoManager::self();
191 connect(undoManager
, &KIO::FileUndoManager::jobRecordingFinished
,
192 this, &DolphinViewContainer::delayedStatusBarUpdate
);
194 // Initialize filter bar
195 m_filterBar
= new FilterBar(this);
196 m_filterBar
->setVisible(settings
->filterBar());
197 connect(m_filterBar
, &FilterBar::filterChanged
,
198 this, &DolphinViewContainer::setNameFilter
);
199 connect(m_filterBar
, &FilterBar::closeRequest
,
200 this, &DolphinViewContainer::closeFilterBar
);
201 connect(m_filterBar
, &FilterBar::focusViewRequest
,
202 this, &DolphinViewContainer::requestFocus
);
203 connect(m_view
, &DolphinView::urlChanged
,
204 m_filterBar
, &FilterBar::slotUrlChanged
);
206 navigatorLayout
->addWidget(m_urlNavigator
);
207 navigatorLayout
->addWidget(m_emptyTrashButton
);
209 m_topLayout
->addWidget(m_navigatorWidget
);
210 m_topLayout
->addWidget(m_searchBox
);
211 m_topLayout
->addWidget(m_messageWidget
);
212 m_topLayout
->addWidget(m_view
);
213 m_topLayout
->addWidget(m_filterBar
);
214 m_topLayout
->addWidget(m_statusBar
);
216 setSearchModeEnabled(isSearchUrl(url
));
218 // Initialize kactivities resource instance
220 #ifdef KActivities_FOUND
221 m_activityResourceInstance
= new KActivities::ResourceInstance(
222 window()->winId(), url
);
223 m_activityResourceInstance
->setParent(this);
227 DolphinViewContainer::~DolphinViewContainer()
231 QUrl
DolphinViewContainer::url() const
233 return m_view
->url();
236 void DolphinViewContainer::setActive(bool active
)
238 m_searchBox
->setActive(active
);
239 m_urlNavigator
->setActive(active
);
240 m_view
->setActive(active
);
242 #ifdef KActivities_FOUND
244 m_activityResourceInstance
->notifyFocusedIn();
246 m_activityResourceInstance
->notifyFocusedOut();
251 bool DolphinViewContainer::isActive() const
253 Q_ASSERT(m_view
->isActive() == m_urlNavigator
->isActive());
254 return m_view
->isActive();
257 void DolphinViewContainer::setAutoGrabFocus(bool grab
)
259 m_autoGrabFocus
= grab
;
262 bool DolphinViewContainer::autoGrabFocus() const
264 return m_autoGrabFocus
;
267 QString
DolphinViewContainer::currentSearchText() const
269 return m_searchBox
->text();
272 const DolphinStatusBar
* DolphinViewContainer::statusBar() const
277 DolphinStatusBar
* DolphinViewContainer::statusBar()
282 const KUrlNavigator
* DolphinViewContainer::urlNavigator() const
284 return m_urlNavigator
;
287 KUrlNavigator
* DolphinViewContainer::urlNavigator()
289 return m_urlNavigator
;
292 const DolphinView
* DolphinViewContainer::view() const
297 DolphinView
* DolphinViewContainer::view()
302 void DolphinViewContainer::showMessage(const QString
& msg
, MessageType type
)
308 m_messageWidget
->setText(msg
);
311 case Information
: m_messageWidget
->setMessageType(KMessageWidget::Information
); break;
312 case Warning
: m_messageWidget
->setMessageType(KMessageWidget::Warning
); break;
313 case Error
: m_messageWidget
->setMessageType(KMessageWidget::Error
); break;
319 m_messageWidget
->setWordWrap(false);
320 const int unwrappedWidth
= m_messageWidget
->sizeHint().width();
321 m_messageWidget
->setWordWrap(unwrappedWidth
> size().width());
323 if (m_messageWidget
->isVisible()) {
324 m_messageWidget
->hide();
326 m_messageWidget
->animatedShow();
329 void DolphinViewContainer::readSettings()
331 if (GeneralSettings::modifiedStartupSettings()) {
332 // The startup settings should only get applied if they have been
333 // modified by the user. Otherwise keep the (possibly) different current
334 // settings of the URL navigator and the filterbar.
335 m_urlNavigator
->setUrlEditable(GeneralSettings::editableUrl());
336 m_urlNavigator
->setShowFullPath(GeneralSettings::showFullPath());
337 m_urlNavigator
->setHomeUrl(Dolphin::homeUrl());
338 setFilterBarVisible(GeneralSettings::filterBar());
341 m_view
->readSettings();
342 m_statusBar
->readSettings();
345 bool DolphinViewContainer::isFilterBarVisible() const
347 return m_filterBar
->isVisible();
350 void DolphinViewContainer::setSearchModeEnabled(bool enabled
)
352 if (enabled
== isSearchModeEnabled()) {
353 if (enabled
&& !m_searchBox
->hasFocus()) {
354 m_searchBox
->setFocus();
355 m_searchBox
->selectAll();
360 m_searchBox
->setVisible(enabled
);
361 m_navigatorWidget
->setVisible(!enabled
);
364 const QUrl
& locationUrl
= m_urlNavigator
->locationUrl();
365 m_searchBox
->fromSearchUrl(locationUrl
);
367 m_view
->setViewPropertiesContext(QString());
369 // Restore the URL for the URL navigator. If Dolphin has been
370 // started with a search-URL, the home URL is used as fallback.
371 QUrl url
= m_searchBox
->searchPath();
372 if (url
.isEmpty() || !url
.isValid() || isSearchUrl(url
)) {
373 url
= Dolphin::homeUrl();
375 m_urlNavigator
->setLocationUrl(url
);
379 bool DolphinViewContainer::isSearchModeEnabled() const
381 return m_searchBox
->isVisible();
384 QString
DolphinViewContainer::placesText() const
388 if (isSearchModeEnabled()) {
389 text
= i18n("Search for %1 in %2", m_searchBox
->text(), m_searchBox
->searchPath().fileName());
391 text
= url().fileName();
392 if (text
.isEmpty()) {
395 if (text
.isEmpty()) {
396 text
= url().scheme();
403 void DolphinViewContainer::reload()
406 m_messageWidget
->hide();
409 void DolphinViewContainer::setUrl(const QUrl
& newUrl
)
411 if (newUrl
!= m_urlNavigator
->locationUrl()) {
412 m_urlNavigator
->setLocationUrl(newUrl
);
415 #ifdef KActivities_FOUND
416 m_activityResourceInstance
->setUri(newUrl
);
420 void DolphinViewContainer::setFilterBarVisible(bool visible
)
422 Q_ASSERT(m_filterBar
);
425 m_filterBar
->setFocus();
426 m_filterBar
->selectAll();
432 void DolphinViewContainer::delayedStatusBarUpdate()
434 if (m_statusBarTimer
->isActive() && (m_statusBarTimestamp
.elapsed() > 2000)) {
435 // No update of the statusbar has been done during the last 2 seconds,
436 // although an update has been requested. Trigger an immediate update.
437 m_statusBarTimer
->stop();
440 // Invoke updateStatusBar() with a small delay. This assures that
441 // when a lot of delayedStatusBarUpdates() are done in a short time,
442 // no bottleneck is given.
443 m_statusBarTimer
->start();
447 void DolphinViewContainer::updateStatusBar()
449 m_statusBarTimestamp
.start();
451 const QString text
= m_view
->statusBarText();
452 m_statusBar
->setDefaultText(text
);
453 m_statusBar
->resetToDefaultText();
456 void DolphinViewContainer::updateDirectoryLoadingProgress(int percent
)
458 if (m_statusBar
->progressText().isEmpty()) {
459 m_statusBar
->setProgressText(i18nc("@info:progress", "Loading folder..."));
461 m_statusBar
->setProgress(percent
);
464 void DolphinViewContainer::updateDirectorySortingProgress(int percent
)
466 if (m_statusBar
->progressText().isEmpty()) {
467 m_statusBar
->setProgressText(i18nc("@info:progress", "Sorting..."));
469 m_statusBar
->setProgress(percent
);
472 void DolphinViewContainer::slotDirectoryLoadingStarted()
474 if (isSearchUrl(url())) {
475 // Search KIO-slaves usually don't provide any progress information. Give
476 // a hint to the user that a searching is done:
478 m_statusBar
->setProgressText(i18nc("@info", "Searching..."));
479 m_statusBar
->setProgress(-1);
481 // Trigger an undetermined progress indication. The progress
482 // information in percent will be triggered by the percent() signal
483 // of the directory lister later.
484 updateDirectoryLoadingProgress(-1);
488 void DolphinViewContainer::slotDirectoryLoadingCompleted()
490 if (!m_statusBar
->progressText().isEmpty()) {
491 m_statusBar
->setProgressText(QString());
492 m_statusBar
->setProgress(100);
495 if (isSearchUrl(url()) && m_view
->itemsCount() == 0) {
496 // The dir lister has been completed on a Baloo-URI and no items have been found. Instead
497 // of showing the default status bar information ("0 items") a more helpful information is given:
498 m_statusBar
->setText(i18nc("@info:status", "No items found."));
504 void DolphinViewContainer::slotDirectoryLoadingCanceled()
506 if (!m_statusBar
->progressText().isEmpty()) {
507 m_statusBar
->setProgressText(QString());
508 m_statusBar
->setProgress(100);
511 m_statusBar
->setText(QString());
514 void DolphinViewContainer::slotUrlIsFileError(const QUrl
& url
)
516 const KFileItem
item(url
);
518 // Find out if the file can be opened in the view (for example, this is the
519 // case if the file is an archive). The mime type must be known for that.
520 item
.determineMimeType();
521 const QUrl
& folderUrl
= DolphinView::openItemAsFolderUrl(item
, true);
522 if (!folderUrl
.isEmpty()) {
525 slotItemActivated(item
);
529 void DolphinViewContainer::slotItemActivated(const KFileItem
& item
)
531 // It is possible to activate items on inactive views by
532 // drag & drop operations. Assure that activating an item always
533 // results in an active view.
534 m_view
->setActive(true);
536 const QUrl
& url
= DolphinView::openItemAsFolderUrl(item
, GeneralSettings::browseThroughArchives());
537 if (!url
.isEmpty()) {
542 KRun
*run
= new KRun(item
.targetUrl(), this);
543 run
->setShowScriptExecutionPrompt(true);
546 void DolphinViewContainer::slotItemsActivated(const KFileItemList
& items
)
548 Q_ASSERT(items
.count() >= 2);
550 KFileItemActions
fileItemActions(this);
551 fileItemActions
.runPreferredApplications(items
, QString());
554 void DolphinViewContainer::showItemInfo(const KFileItem
& item
)
557 m_statusBar
->resetToDefaultText();
559 m_statusBar
->setText(item
.getStatusBarInfo());
563 void DolphinViewContainer::closeFilterBar()
565 m_filterBar
->closeFilterBar();
567 emit
showFilterBarChanged(false);
570 void DolphinViewContainer::setNameFilter(const QString
& nameFilter
)
572 m_view
->setNameFilter(nameFilter
);
573 delayedStatusBarUpdate();
576 void DolphinViewContainer::activate()
581 void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const QUrl
&)
586 void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl
& url
)
590 if (KProtocolManager::supportsListing(url
)) {
591 setSearchModeEnabled(isSearchUrl(url
));
593 tryRestoreViewState();
595 if (m_autoGrabFocus
&& isActive() && !isSearchUrl(url
)) {
596 // When an URL has been entered, the view should get the focus.
597 // The focus must be requested asynchronously, as changing the URL might create
598 // a new view widget.
599 QTimer::singleShot(0, this, &DolphinViewContainer::requestFocus
);
601 } else if (KProtocolManager::isSourceProtocol(url
)) {
602 QString app
= QStringLiteral("konqueror");
603 if (url
.scheme().startsWith(QLatin1String("http"))) {
604 showMessage(i18nc("@info:status", // krazy:exclude=qmethods
605 "Dolphin does not support web pages, the web browser has been launched"),
608 const KConfigGroup
config(KSharedConfig::openConfig(QStringLiteral("kdeglobals")), "General");
609 const QString browser
= config
.readEntry("BrowserApplication");
610 if (!browser
.isEmpty()) {
612 if (app
.startsWith('!')) {
613 // a literal command has been configured, remove the '!' prefix
618 showMessage(i18nc("@info:status",
619 "Protocol not supported by Dolphin, Konqueror has been launched"),
623 const QString secureUrl
= KShell::quoteArg(url
.toDisplayString(QUrl::PreferLocalFile
));
624 const QString command
= app
+ ' ' + secureUrl
;
625 KRun::runCommand(command
, app
, app
, this);
627 showMessage(i18nc("@info:status", "Invalid protocol"), Error
);
631 void DolphinViewContainer::slotUrlSelectionRequested(const QUrl
& url
)
633 qCDebug(DolphinDebug
) << "slotUrlSelectionRequested: " << url
;
634 m_view
->markUrlsAsSelected({url
});
635 m_view
->markUrlAsCurrent(url
); // makes the item scroll into view
638 void DolphinViewContainer::redirect(const QUrl
& oldUrl
, const QUrl
& newUrl
)
641 const bool block
= m_urlNavigator
->signalsBlocked();
642 m_urlNavigator
->blockSignals(true);
644 // Assure that the location state is reset for redirection URLs. This
645 // allows to skip redirection URLs when going back or forward in the
647 m_urlNavigator
->saveLocationState(QByteArray());
648 m_urlNavigator
->setLocationUrl(newUrl
);
649 setSearchModeEnabled(isSearchUrl(newUrl
));
651 m_urlNavigator
->blockSignals(block
);
654 void DolphinViewContainer::requestFocus()
659 void DolphinViewContainer::saveUrlCompletionMode(KCompletion::CompletionMode completion
)
661 GeneralSettings::setUrlCompletionMode(completion
);
664 void DolphinViewContainer::slotReturnPressed()
666 if (!GeneralSettings::editableUrl()) {
667 m_urlNavigator
->setUrlEditable(false);
671 void DolphinViewContainer::startSearching()
673 const QUrl url
= m_searchBox
->urlForSearching();
674 if (url
.isValid() && !url
.isEmpty()) {
675 m_view
->setViewPropertiesContext(QStringLiteral("search"));
676 m_urlNavigator
->setLocationUrl(url
);
680 void DolphinViewContainer::closeSearchBox()
682 setSearchModeEnabled(false);
685 void DolphinViewContainer::stopDirectoryLoading()
687 m_view
->stopLoading();
688 m_statusBar
->setProgress(100);
691 void DolphinViewContainer::slotStatusBarZoomLevelChanged(int zoomLevel
)
693 m_view
->setZoomLevel(zoomLevel
);
696 void DolphinViewContainer::showErrorMessage(const QString
& msg
)
698 showMessage(msg
, Error
);
701 bool DolphinViewContainer::isSearchUrl(const QUrl
& url
) const
703 return url
.scheme().contains(QStringLiteral("search"));
706 void DolphinViewContainer::saveViewState()
708 QByteArray locationState
;
709 QDataStream
stream(&locationState
, QIODevice::WriteOnly
);
710 m_view
->saveState(stream
);
711 m_urlNavigator
->saveLocationState(locationState
);
714 void DolphinViewContainer::tryRestoreViewState()
716 QByteArray locationState
= m_urlNavigator
->locationState();
717 if (!locationState
.isEmpty()) {
718 QDataStream
stream(&locationState
, QIODevice::ReadOnly
);
719 m_view
->restoreState(stream
);