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"
21 #include <KProtocolManager>
25 #include <QVBoxLayout>
27 #include <KFileItemActions>
28 #include <KFilePlacesModel>
29 #include <KLocalizedString>
30 #include <KIO/NetAccess>
31 #include <KIO/PreviewJob>
32 #include <KMessageWidget>
33 #include <konq_operations.h>
36 #include <KUrlComboBox>
37 #include <KUrlNavigator>
40 #ifdef KActivities_FOUND
43 #include "dolphin_generalsettings.h"
44 #include "filterbar/filterbar.h"
45 #include "search/dolphinsearchbox.h"
46 #include "statusbar/dolphinstatusbar.h"
47 #include "views/draganddrophelper.h"
48 #include "views/viewmodecontroller.h"
49 #include "views/viewproperties.h"
51 DolphinViewContainer::DolphinViewContainer(const QUrl
& url
, QWidget
* parent
) :
61 m_statusBarTimestamp(),
62 m_autoGrabFocus(true),
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_urlNavigator
= new KUrlNavigator(new KFilePlacesModel(this), url
, this);
76 connect(m_urlNavigator
, &KUrlNavigator::urlsDropped
,
77 this, &DolphinViewContainer::dropUrls
);
78 connect(m_urlNavigator
, &KUrlNavigator::activated
,
79 this, &DolphinViewContainer::activate
);
80 connect(m_urlNavigator
->editor(), &KUrlComboBox::completionModeChanged
,
81 this, &DolphinViewContainer::saveUrlCompletionMode
);
83 const GeneralSettings
* settings
= GeneralSettings::self();
84 m_urlNavigator
->setUrlEditable(settings
->editableUrl());
85 m_urlNavigator
->setShowFullPath(settings
->showFullPath());
86 m_urlNavigator
->setHomeUrl(QUrl::fromLocalFile(settings
->homeUrl()));
87 KUrlComboBox
* editor
= m_urlNavigator
->editor();
88 editor
->setCompletionMode(KCompletion::CompletionMode(settings
->urlCompletionMode()));
90 m_searchBox
= new DolphinSearchBox(this);
92 connect(m_searchBox
, &DolphinSearchBox::activated
, this, &DolphinViewContainer::activate
);
93 connect(m_searchBox
, &DolphinSearchBox::closeRequest
, this, &DolphinViewContainer::closeSearchBox
);
94 connect(m_searchBox
, &DolphinSearchBox::searchRequest
, this, &DolphinViewContainer::startSearching
);
95 connect(m_searchBox
, &DolphinSearchBox::returnPressed
, this, &DolphinViewContainer::requestFocus
);
97 m_messageWidget
= new KMessageWidget(this);
98 m_messageWidget
->setCloseButtonVisible(true);
99 m_messageWidget
->hide();
101 m_view
= new DolphinView(url
, this);
102 connect(m_view
, &DolphinView::urlChanged
,
103 m_urlNavigator
, &KUrlNavigator::setUrl
);
104 connect(m_view
, &DolphinView::urlChanged
,
105 m_messageWidget
, &KMessageWidget::hide
);
106 connect(m_view
, &DolphinView::directoryLoadingCompleted
,
107 m_messageWidget
, &KMessageWidget::hide
);
108 connect(m_view
, &DolphinView::writeStateChanged
,
109 this, &DolphinViewContainer::writeStateChanged
);
110 connect(m_view
, &DolphinView::requestItemInfo
,
111 this, &DolphinViewContainer::showItemInfo
);
112 connect(m_view
, &DolphinView::itemActivated
,
113 this, &DolphinViewContainer::slotItemActivated
);
114 connect(m_view
, &DolphinView::itemsActivated
,
115 this, &DolphinViewContainer::slotItemsActivated
);
116 connect(m_view
, &DolphinView::redirection
,
117 this, &DolphinViewContainer::redirect
);
118 connect(m_view
, &DolphinView::directoryLoadingStarted
,
119 this, &DolphinViewContainer::slotDirectoryLoadingStarted
);
120 connect(m_view
, &DolphinView::directoryLoadingCompleted
,
121 this, &DolphinViewContainer::slotDirectoryLoadingCompleted
);
122 connect(m_view
, &DolphinView::directoryLoadingCanceled
,
123 this, &DolphinViewContainer::slotDirectoryLoadingCanceled
);
124 connect(m_view
, &DolphinView::itemCountChanged
,
125 this, &DolphinViewContainer::delayedStatusBarUpdate
);
126 connect(m_view
, &DolphinView::directoryLoadingProgress
,
127 this, &DolphinViewContainer::updateDirectoryLoadingProgress
);
128 connect(m_view
, &DolphinView::directorySortingProgress
,
129 this, &DolphinViewContainer::updateDirectorySortingProgress
);
130 connect(m_view
, &DolphinView::selectionChanged
,
131 this, &DolphinViewContainer::delayedStatusBarUpdate
);
132 connect(m_view
, &DolphinView::urlAboutToBeChanged
,
133 this, &DolphinViewContainer::slotViewUrlAboutToBeChanged
);
134 connect(m_view
, &DolphinView::errorMessage
,
135 this, &DolphinViewContainer::showErrorMessage
);
136 connect(m_view
, &DolphinView::urlIsFileError
,
137 this, &DolphinViewContainer::slotUrlIsFileError
);
138 connect(m_view
, &DolphinView::activated
,
139 this, &DolphinViewContainer::activate
);
141 connect(m_urlNavigator
, &KUrlNavigator::urlAboutToBeChanged
,
142 this, &DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged
);
143 connect(m_urlNavigator
, &KUrlNavigator::urlChanged
,
144 this, &DolphinViewContainer::slotUrlNavigatorLocationChanged
);
145 connect(m_urlNavigator
, &KUrlNavigator::historyChanged
,
146 this, &DolphinViewContainer::slotHistoryChanged
);
147 connect(m_urlNavigator
, &KUrlNavigator::returnPressed
,
148 this, &DolphinViewContainer::slotReturnPressed
);
150 // Initialize status bar
151 m_statusBar
= new DolphinStatusBar(this);
152 m_statusBar
->setUrl(m_view
->url());
153 m_statusBar
->setZoomLevel(m_view
->zoomLevel());
154 connect(m_view
, &DolphinView::urlChanged
,
155 m_statusBar
, &DolphinStatusBar::setUrl
);
156 connect(m_view
, &DolphinView::zoomLevelChanged
,
157 m_statusBar
, &DolphinStatusBar::setZoomLevel
);
158 connect(m_view
, &DolphinView::infoMessage
,
159 m_statusBar
, &DolphinStatusBar::setText
);
160 connect(m_view
, &DolphinView::operationCompletedMessage
,
161 m_statusBar
, &DolphinStatusBar::setText
);
162 connect(m_statusBar
, &DolphinStatusBar::stopPressed
,
163 this, &DolphinViewContainer::stopDirectoryLoading
);
164 connect(m_statusBar
, &DolphinStatusBar::zoomLevelChanged
,
165 this, &DolphinViewContainer::slotStatusBarZoomLevelChanged
);
167 m_statusBarTimer
= new QTimer(this);
168 m_statusBarTimer
->setSingleShot(true);
169 m_statusBarTimer
->setInterval(300);
170 connect(m_statusBarTimer
, &QTimer::timeout
, this, &DolphinViewContainer::updateStatusBar
);
172 KIO::FileUndoManager
* undoManager
= KIO::FileUndoManager::self();
173 connect(undoManager
, &KIO::FileUndoManager::jobRecordingFinished
,
174 this, &DolphinViewContainer::delayedStatusBarUpdate
);
176 // Initialize filter bar
177 m_filterBar
= new FilterBar(this);
178 m_filterBar
->setVisible(settings
->filterBar());
179 connect(m_filterBar
, &FilterBar::filterChanged
,
180 this, &DolphinViewContainer::setNameFilter
);
181 connect(m_filterBar
, &FilterBar::closeRequest
,
182 this, &DolphinViewContainer::closeFilterBar
);
183 connect(m_filterBar
, &FilterBar::focusViewRequest
,
184 this, &DolphinViewContainer::requestFocus
);
185 connect(m_view
, &DolphinView::urlChanged
,
186 m_filterBar
, &FilterBar::slotUrlChanged
);
188 m_topLayout
->addWidget(m_urlNavigator
);
189 m_topLayout
->addWidget(m_searchBox
);
190 m_topLayout
->addWidget(m_messageWidget
);
191 m_topLayout
->addWidget(m_view
);
192 m_topLayout
->addWidget(m_filterBar
);
193 m_topLayout
->addWidget(m_statusBar
);
195 setSearchModeEnabled(isSearchUrl(url
));
197 // Initialize kactivities resource instance
199 #ifdef KActivities_FOUND
200 m_activityResourceInstance
= new KActivities::ResourceInstance(
201 window()->winId(), url
);
202 m_activityResourceInstance
->setParent(this);
206 DolphinViewContainer::~DolphinViewContainer()
210 QUrl
DolphinViewContainer::url() const
212 return m_view
->url();
215 void DolphinViewContainer::setActive(bool active
)
217 m_searchBox
->setActive(active
);
218 m_urlNavigator
->setActive(active
);
219 m_view
->setActive(active
);
221 #ifdef KActivities_FOUND
223 m_activityResourceInstance
->notifyFocusedIn();
225 m_activityResourceInstance
->notifyFocusedOut();
230 bool DolphinViewContainer::isActive() const
232 Q_ASSERT(m_view
->isActive() == m_urlNavigator
->isActive());
233 return m_view
->isActive();
236 void DolphinViewContainer::setAutoGrabFocus(bool grab
)
238 m_autoGrabFocus
= grab
;
241 bool DolphinViewContainer::autoGrabFocus() const
243 return m_autoGrabFocus
;
246 const DolphinStatusBar
* DolphinViewContainer::statusBar() const
251 DolphinStatusBar
* DolphinViewContainer::statusBar()
256 const KUrlNavigator
* DolphinViewContainer::urlNavigator() const
258 return m_urlNavigator
;
261 KUrlNavigator
* DolphinViewContainer::urlNavigator()
263 return m_urlNavigator
;
266 const DolphinView
* DolphinViewContainer::view() const
271 DolphinView
* DolphinViewContainer::view()
276 void DolphinViewContainer::showMessage(const QString
& msg
, MessageType type
)
282 m_messageWidget
->setText(msg
);
285 case Information
: m_messageWidget
->setMessageType(KMessageWidget::Information
); break;
286 case Warning
: m_messageWidget
->setMessageType(KMessageWidget::Warning
); break;
287 case Error
: m_messageWidget
->setMessageType(KMessageWidget::Error
); break;
293 m_messageWidget
->setWordWrap(false);
294 const int unwrappedWidth
= m_messageWidget
->sizeHint().width();
295 m_messageWidget
->setWordWrap(unwrappedWidth
> size().width());
297 if (m_messageWidget
->isVisible()) {
298 m_messageWidget
->hide();
300 m_messageWidget
->animatedShow();
303 void DolphinViewContainer::readSettings()
305 if (GeneralSettings::modifiedStartupSettings()) {
306 // The startup settings should only get applied if they have been
307 // modified by the user. Otherwise keep the (possibly) different current
308 // settings of the URL navigator and the filterbar.
309 m_urlNavigator
->setUrlEditable(GeneralSettings::editableUrl());
310 m_urlNavigator
->setShowFullPath(GeneralSettings::showFullPath());
311 m_urlNavigator
->setHomeUrl(QUrl::fromLocalFile(GeneralSettings::homeUrl()));
312 setFilterBarVisible(GeneralSettings::filterBar());
315 m_view
->readSettings();
316 m_statusBar
->readSettings();
319 bool DolphinViewContainer::isFilterBarVisible() const
321 return m_filterBar
->isVisible();
324 void DolphinViewContainer::setSearchModeEnabled(bool enabled
)
326 if (enabled
== isSearchModeEnabled()) {
327 if (enabled
&& !m_searchBox
->hasFocus()) {
328 m_searchBox
->setFocus();
329 m_searchBox
->selectAll();
334 m_searchBox
->setVisible(enabled
);
335 m_urlNavigator
->setVisible(!enabled
);
338 const QUrl
& locationUrl
= m_urlNavigator
->locationUrl();
339 m_searchBox
->fromSearchUrl(locationUrl
);
341 m_view
->setViewPropertiesContext(QString());
343 // Restore the URL for the URL navigator. If Dolphin has been
344 // started with a search-URL, the home URL is used as fallback.
345 QUrl url
= m_searchBox
->searchPath();
346 if (url
.isEmpty() || !url
.isValid() || isSearchUrl(url
)) {
347 url
= QUrl::fromLocalFile(GeneralSettings::self()->homeUrl());
349 m_urlNavigator
->setLocationUrl(url
);
353 bool DolphinViewContainer::isSearchModeEnabled() const
355 return m_searchBox
->isVisible();
358 QString
DolphinViewContainer::placesText() const
362 if (isSearchModeEnabled()) {
363 text
= m_searchBox
->searchPath().fileName() + QLatin1String(": ") + m_searchBox
->text();
365 text
= url().fileName();
366 if (text
.isEmpty()) {
374 void DolphinViewContainer::setUrl(const QUrl
& newUrl
)
376 if (newUrl
!= m_urlNavigator
->locationUrl()) {
377 m_urlNavigator
->setLocationUrl(newUrl
);
380 #ifdef KActivities_FOUND
381 m_activityResourceInstance
->setUri(newUrl
);
385 void DolphinViewContainer::setFilterBarVisible(bool visible
)
387 Q_ASSERT(m_filterBar
);
390 m_filterBar
->setFocus();
391 m_filterBar
->selectAll();
397 void DolphinViewContainer::delayedStatusBarUpdate()
399 if (m_statusBarTimer
->isActive() && (m_statusBarTimestamp
.elapsed() > 2000)) {
400 // No update of the statusbar has been done during the last 2 seconds,
401 // although an update has been requested. Trigger an immediate update.
402 m_statusBarTimer
->stop();
405 // Invoke updateStatusBar() with a small delay. This assures that
406 // when a lot of delayedStatusBarUpdates() are done in a short time,
407 // no bottleneck is given.
408 m_statusBarTimer
->start();
412 void DolphinViewContainer::updateStatusBar()
414 m_statusBarTimestamp
.start();
416 const QString text
= m_view
->statusBarText();
417 m_statusBar
->setDefaultText(text
);
418 m_statusBar
->resetToDefaultText();
421 void DolphinViewContainer::updateDirectoryLoadingProgress(int percent
)
423 if (m_statusBar
->progressText().isEmpty()) {
424 m_statusBar
->setProgressText(i18nc("@info:progress", "Loading folder..."));
426 m_statusBar
->setProgress(percent
);
429 void DolphinViewContainer::updateDirectorySortingProgress(int percent
)
431 if (m_statusBar
->progressText().isEmpty()) {
432 m_statusBar
->setProgressText(i18nc("@info:progress", "Sorting..."));
434 m_statusBar
->setProgress(percent
);
437 void DolphinViewContainer::slotDirectoryLoadingStarted()
439 if (isSearchUrl(url())) {
440 // Search KIO-slaves usually don't provide any progress information. Give
441 // a hint to the user that a searching is done:
443 m_statusBar
->setProgressText(i18nc("@info", "Searching..."));
444 m_statusBar
->setProgress(-1);
446 // Trigger an undetermined progress indication. The progress
447 // information in percent will be triggered by the percent() signal
448 // of the directory lister later.
449 updateDirectoryLoadingProgress(-1);
453 void DolphinViewContainer::slotDirectoryLoadingCompleted()
455 if (!m_statusBar
->progressText().isEmpty()) {
456 m_statusBar
->setProgressText(QString());
457 m_statusBar
->setProgress(100);
460 if (isSearchUrl(url()) && m_view
->itemsCount() == 0) {
461 // The dir lister has been completed on a Baloo-URI and no items have been found. Instead
462 // of showing the default status bar information ("0 items") a more helpful information is given:
463 m_statusBar
->setText(i18nc("@info:status", "No items found."));
469 void DolphinViewContainer::slotDirectoryLoadingCanceled()
471 if (!m_statusBar
->progressText().isEmpty()) {
472 m_statusBar
->setProgressText(QString());
473 m_statusBar
->setProgress(100);
476 m_statusBar
->setText(QString());
479 void DolphinViewContainer::slotUrlIsFileError(const QUrl
& url
)
481 const KFileItem
item(KFileItem::Unknown
, KFileItem::Unknown
, url
);
483 // Find out if the file can be opened in the view (for example, this is the
484 // case if the file is an archive). The mime type must be known for that.
485 item
.determineMimeType();
486 const QUrl
& folderUrl
= DolphinView::openItemAsFolderUrl(item
, true);
487 if (!folderUrl
.isEmpty()) {
488 m_view
->setUrl(folderUrl
);
490 slotItemActivated(item
);
494 void DolphinViewContainer::slotItemActivated(const KFileItem
& item
)
496 // It is possible to activate items on inactive views by
497 // drag & drop operations. Assure that activating an item always
498 // results in an active view.
499 m_view
->setActive(true);
501 const QUrl
& url
= DolphinView::openItemAsFolderUrl(item
, GeneralSettings::browseThroughArchives());
502 if (!url
.isEmpty()) {
507 new KRun(item
.targetUrl(), this);
510 void DolphinViewContainer::slotItemsActivated(const KFileItemList
& items
)
512 Q_ASSERT(items
.count() >= 2);
514 KFileItemActions
fileItemActions(this);
515 fileItemActions
.runPreferredApplications(items
, QString());
518 void DolphinViewContainer::showItemInfo(const KFileItem
& item
)
521 m_statusBar
->resetToDefaultText();
523 m_statusBar
->setText(item
.getStatusBarInfo());
527 void DolphinViewContainer::closeFilterBar()
529 m_filterBar
->closeFilterBar();
531 emit
showFilterBarChanged(false);
534 void DolphinViewContainer::setNameFilter(const QString
& nameFilter
)
536 m_view
->setNameFilter(nameFilter
);
537 delayedStatusBarUpdate();
540 void DolphinViewContainer::activate()
545 void DolphinViewContainer::slotViewUrlAboutToBeChanged(const QUrl
& url
)
547 // URL changes of the view can happen in two ways:
548 // 1. The URL navigator gets changed and will trigger the view to update its URL
549 // 2. The URL of the view gets changed and will trigger the URL navigator to update
550 // its URL (e.g. by clicking on an item)
551 // In this scope the view-state may only get saved in case 2:
552 if (url
!= m_urlNavigator
->locationUrl()) {
557 void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const QUrl
& url
)
559 // URL changes of the view can happen in two ways:
560 // 1. The URL navigator gets changed and will trigger the view to update its URL
561 // 2. The URL of the view gets changed and will trigger the URL navigator to update
562 // its URL (e.g. by clicking on an item)
563 // In this scope the view-state may only get saved in case 1:
564 if (url
!= m_view
->url()) {
569 void DolphinViewContainer::slotUrlNavigatorLocationChanged(const QUrl
& url
)
573 if (KProtocolManager::supportsListing(url
)) {
574 setSearchModeEnabled(isSearchUrl(url
));
577 if (m_autoGrabFocus
&& isActive() && !isSearchUrl(url
)) {
578 // When an URL has been entered, the view should get the focus.
579 // The focus must be requested asynchronously, as changing the URL might create
580 // a new view widget.
581 QTimer::singleShot(0, this, SLOT(requestFocus()));
583 } else if (KProtocolManager::isSourceProtocol(url
)) {
584 QString app
= "konqueror";
585 if (url
.scheme().startsWith(QLatin1String("http"))) {
586 showMessage(i18nc("@info:status", // krazy:exclude=qmethods
587 "Dolphin does not support web pages, the web browser has been launched"),
590 const KConfigGroup
config(KSharedConfig::openConfig("kdeglobals"), "General");
591 const QString browser
= config
.readEntry("BrowserApplication");
592 if (!browser
.isEmpty()) {
594 if (app
.startsWith('!')) {
595 // a literal command has been configured, remove the '!' prefix
600 showMessage(i18nc("@info:status",
601 "Protocol not supported by Dolphin, Konqueror has been launched"),
605 const QString secureUrl
= KShell::quoteArg(url
.toDisplayString(QUrl::PreferLocalFile
));
606 const QString command
= app
+ ' ' + secureUrl
;
607 KRun::runCommand(command
, app
, app
, this);
609 showMessage(i18nc("@info:status", "Invalid protocol"), Error
);
613 void DolphinViewContainer::dropUrls(const QUrl
& destination
, QDropEvent
* event
)
615 m_dropDestination
= destination
;
617 const QMimeData
* mimeData
= event
->mimeData();
618 QMimeData
* mimeDataCopy
= new QMimeData
;
619 foreach (const QString
& format
, mimeData
->formats()) {
620 mimeDataCopy
->setData(format
, mimeData
->data(format
));
623 m_dropEvent
.reset(new QDropEvent(event
->pos(),
624 event
->possibleActions(),
626 event
->mouseButtons(),
627 event
->keyboardModifiers()));
629 QTimer::singleShot(0, this, SLOT(dropUrlsDelayed()));
632 void DolphinViewContainer::dropUrlsDelayed()
634 if (m_dropEvent
.isNull()) {
639 DragAndDropHelper::dropUrls(KFileItem(), m_dropDestination
, m_dropEvent
.data(), error
);
640 if (!error
.isEmpty()) {
641 showMessage(error
, Error
);
644 delete m_dropEvent
->mimeData();
648 void DolphinViewContainer::redirect(const QUrl
& oldUrl
, const QUrl
& newUrl
)
651 const bool block
= m_urlNavigator
->signalsBlocked();
652 m_urlNavigator
->blockSignals(true);
654 // Assure that the location state is reset for redirection URLs. This
655 // allows to skip redirection URLs when going back or forward in the
657 m_urlNavigator
->saveLocationState(QByteArray());
658 m_urlNavigator
->setLocationUrl(newUrl
);
659 setSearchModeEnabled(isSearchUrl(newUrl
));
661 m_urlNavigator
->blockSignals(block
);
664 void DolphinViewContainer::requestFocus()
669 void DolphinViewContainer::saveUrlCompletionMode(KCompletion::CompletionMode completion
)
671 GeneralSettings::setUrlCompletionMode(completion
);
674 void DolphinViewContainer::slotHistoryChanged()
676 QByteArray locationState
= m_urlNavigator
->locationState();
677 if (!locationState
.isEmpty()) {
678 QDataStream
stream(&locationState
, QIODevice::ReadOnly
);
679 m_view
->restoreState(stream
);
683 void DolphinViewContainer::slotReturnPressed()
685 if (!GeneralSettings::editableUrl()) {
686 m_urlNavigator
->setUrlEditable(false);
690 void DolphinViewContainer::startSearching()
692 const QUrl url
= m_searchBox
->urlForSearching();
693 if (url
.isValid() && !url
.isEmpty()) {
694 m_view
->setViewPropertiesContext("search");
695 m_urlNavigator
->setLocationUrl(url
);
699 void DolphinViewContainer::closeSearchBox()
701 setSearchModeEnabled(false);
704 void DolphinViewContainer::stopDirectoryLoading()
706 m_view
->stopLoading();
707 m_statusBar
->setProgress(100);
710 void DolphinViewContainer::slotStatusBarZoomLevelChanged(int zoomLevel
)
712 m_view
->setZoomLevel(zoomLevel
);
715 void DolphinViewContainer::showErrorMessage(const QString
& msg
)
717 showMessage(msg
, Error
);
720 bool DolphinViewContainer::isSearchUrl(const QUrl
& url
) const
722 return url
.scheme().contains("search");
725 void DolphinViewContainer::saveViewState()
727 QByteArray locationState
;
728 QDataStream
stream(&locationState
, QIODevice::WriteOnly
);
729 m_view
->saveState(stream
);
730 m_urlNavigator
->saveLocationState(locationState
);