]> cloud.milkyroute.net Git - dolphin.git/blob - src/dolphinviewcontainer.cpp
Provide a default name when adding a search query to the places panel
[dolphin.git] / src / dolphinviewcontainer.cpp
1 /***************************************************************************
2 * Copyright (C) 2007 by Peter Penz <peter.penz19@gmail.com> *
3 * *
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. *
8 * *
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. *
13 * *
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 ***************************************************************************/
19
20 #include "dolphinviewcontainer.h"
21 #include <KProtocolManager>
22
23 #include <QApplication>
24 #include <QKeyEvent>
25 #include <QItemSelection>
26 #include <QBoxLayout>
27 #include <QTimer>
28 #include <QScrollBar>
29
30 #include <KDesktopFile>
31 #include <KFileItemDelegate>
32 #include <KFilePlacesModel>
33 #include <KLocale>
34 #include <KIconEffect>
35 #include <KIO/NetAccess>
36 #include <KIO/PreviewJob>
37 #include <KMessageWidget>
38 #include <KNewFileMenu>
39 #include <konqmimedata.h>
40 #include <konq_operations.h>
41 #include <KShell>
42 #include <KUrl>
43 #include <KUrlComboBox>
44 #include <KUrlNavigator>
45 #include <KRun>
46
47 #include "dolphin_generalsettings.h"
48 #include "filterbar/filterbar.h"
49 #include "search/dolphinsearchbox.h"
50 #include "statusbar/dolphinstatusbar.h"
51 #include "views/draganddrophelper.h"
52 #include "views/viewmodecontroller.h"
53 #include "views/viewproperties.h"
54
55 DolphinViewContainer::DolphinViewContainer(const KUrl& url, QWidget* parent) :
56 QWidget(parent),
57 m_topLayout(0),
58 m_urlNavigator(0),
59 m_searchBox(0),
60 m_messageWidget(0),
61 m_view(0),
62 m_filterBar(0),
63 m_statusBar(0),
64 m_statusBarTimer(0),
65 m_statusBarTimestamp(),
66 m_autoGrabFocus(true)
67 {
68 hide();
69
70 m_topLayout = new QVBoxLayout(this);
71 m_topLayout->setSpacing(0);
72 m_topLayout->setMargin(0);
73
74 m_urlNavigator = new KUrlNavigator(new KFilePlacesModel(this), url, this);
75 connect(m_urlNavigator, SIGNAL(urlsDropped(KUrl,QDropEvent*)),
76 this, SLOT(dropUrls(KUrl,QDropEvent*)));
77 connect(m_urlNavigator, SIGNAL(activated()),
78 this, SLOT(activate()));
79 connect(m_urlNavigator->editor(), SIGNAL(completionModeChanged(KGlobalSettings::Completion)),
80 this, SLOT(saveUrlCompletionMode(KGlobalSettings::Completion)));
81
82 const GeneralSettings* settings = GeneralSettings::self();
83 m_urlNavigator->setUrlEditable(settings->editableUrl());
84 m_urlNavigator->setShowFullPath(settings->showFullPath());
85 m_urlNavigator->setHomeUrl(KUrl(settings->homeUrl()));
86 KUrlComboBox* editor = m_urlNavigator->editor();
87 editor->setCompletionMode(KGlobalSettings::Completion(settings->urlCompletionMode()));
88
89 m_searchBox = new DolphinSearchBox(this);
90 m_searchBox->hide();
91 connect(m_searchBox, SIGNAL(closeRequest()), this, SLOT(closeSearchBox()));
92 connect(m_searchBox, SIGNAL(searchRequest()), this, SLOT(startSearching()));
93 connect(m_searchBox, SIGNAL(returnPressed(QString)), this, SLOT(requestFocus()));
94
95 m_messageWidget = new KMessageWidget(this);
96 m_messageWidget->setCloseButtonVisible(true);
97 m_messageWidget->hide();
98
99 m_view = new DolphinView(url, this);
100 connect(m_view, SIGNAL(urlChanged(KUrl)), m_urlNavigator, SLOT(setUrl(KUrl)));
101 connect(m_view, SIGNAL(writeStateChanged(bool)), this, SIGNAL(writeStateChanged(bool)));
102 connect(m_view, SIGNAL(requestItemInfo(KFileItem)), this, SLOT(showItemInfo(KFileItem)));
103 connect(m_view, SIGNAL(itemActivated(KFileItem)), this, SLOT(slotItemActivated(KFileItem)));
104 connect(m_view, SIGNAL(redirection(KUrl,KUrl)), this, SLOT(redirect(KUrl,KUrl)));
105 connect(m_view, SIGNAL(directoryLoadingStarted()), this, SLOT(slotDirectoryLoadingStarted()));
106 connect(m_view, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotDirectoryLoadingCompleted()));
107 connect(m_view, SIGNAL(itemCountChanged()), this, SLOT(delayedStatusBarUpdate()));
108 connect(m_view, SIGNAL(directoryLoadingProgress(int)), this, SLOT(updateDirectoryLoadingProgress(int)));
109 connect(m_view, SIGNAL(directorySortingProgress(int)), this, SLOT(updateDirectorySortingProgress(int)));
110 connect(m_view, SIGNAL(selectionChanged(KFileItemList)), this, SLOT(delayedStatusBarUpdate()));
111 connect(m_view, SIGNAL(urlAboutToBeChanged(KUrl)), this, SLOT(slotViewUrlAboutToBeChanged(KUrl)));
112 connect(m_view, SIGNAL(errorMessage(QString)), this, SLOT(showErrorMessage(QString)));
113
114 connect(m_urlNavigator, SIGNAL(urlAboutToBeChanged(KUrl)),
115 this, SLOT(slotUrlNavigatorLocationAboutToBeChanged(KUrl)));
116 connect(m_urlNavigator, SIGNAL(urlChanged(KUrl)),
117 this, SLOT(slotUrlNavigatorLocationChanged(KUrl)));
118 connect(m_urlNavigator, SIGNAL(historyChanged()),
119 this, SLOT(slotHistoryChanged()));
120
121 // Initialize status bar
122 m_statusBar = new DolphinStatusBar(this);
123 m_statusBar->setUrl(m_view->url());
124 m_statusBar->setZoomLevel(m_view->zoomLevel());
125 connect(m_view, SIGNAL(urlChanged(KUrl)), m_statusBar, SLOT(setUrl(KUrl)));
126 connect(m_view, SIGNAL(zoomLevelChanged(int,int)), m_statusBar, SLOT(setZoomLevel(int)));
127 connect(m_view, SIGNAL(infoMessage(QString)), m_statusBar, SLOT(setText(QString)));
128 connect(m_view, SIGNAL(operationCompletedMessage(QString)), m_statusBar, SLOT(setText(QString)));
129 connect(m_statusBar, SIGNAL(stopPressed()), this, SLOT(stopDirectoryLoading()));
130 connect(m_statusBar, SIGNAL(zoomLevelChanged(int)), this, SLOT(slotStatusBarZoomLevelChanged(int)));
131
132 m_statusBarTimer = new QTimer(this);
133 m_statusBarTimer->setSingleShot(true);
134 m_statusBarTimer->setInterval(300);
135 connect(m_statusBarTimer, SIGNAL(timeout()), this, SLOT(updateStatusBar()));
136
137 KIO::FileUndoManager* undoManager = KIO::FileUndoManager::self();
138 connect(undoManager, SIGNAL(jobRecordingFinished(CommandType)),
139 this, SLOT(delayedStatusBarUpdate()));
140
141 // Initialize filter bar
142 m_filterBar = new FilterBar(this);
143 m_filterBar->setVisible(settings->filterBar());
144 connect(m_filterBar, SIGNAL(filterChanged(QString)),
145 this, SLOT(setNameFilter(QString)));
146 connect(m_filterBar, SIGNAL(closeRequest()),
147 this, SLOT(closeFilterBar()));
148 connect(m_view, SIGNAL(urlChanged(KUrl)),
149 m_filterBar, SLOT(clear()));
150
151 m_topLayout->addWidget(m_urlNavigator);
152 m_topLayout->addWidget(m_searchBox);
153 m_topLayout->addWidget(m_messageWidget);
154 m_topLayout->addWidget(m_view);
155 m_topLayout->addWidget(m_filterBar);
156 m_topLayout->addWidget(m_statusBar);
157
158 setSearchModeEnabled(isSearchUrl(url));
159 }
160
161 DolphinViewContainer::~DolphinViewContainer()
162 {
163 }
164
165 KUrl DolphinViewContainer::url() const
166 {
167 return m_view->url();
168 }
169
170 void DolphinViewContainer::setActive(bool active)
171 {
172 m_urlNavigator->setActive(active);
173 m_view->setActive(active);
174 }
175
176 bool DolphinViewContainer::isActive() const
177 {
178 Q_ASSERT(m_view->isActive() == m_urlNavigator->isActive());
179 return m_view->isActive();
180 }
181
182 void DolphinViewContainer::setAutoGrabFocus(bool grab)
183 {
184 m_autoGrabFocus = grab;
185 }
186
187 bool DolphinViewContainer::autoGrabFocus() const
188 {
189 return m_autoGrabFocus;
190 }
191
192 const DolphinStatusBar* DolphinViewContainer::statusBar() const
193 {
194 return m_statusBar;
195 }
196
197 DolphinStatusBar* DolphinViewContainer::statusBar()
198 {
199 return m_statusBar;
200 }
201
202 const KUrlNavigator* DolphinViewContainer::urlNavigator() const
203 {
204 return m_urlNavigator;
205 }
206
207 KUrlNavigator* DolphinViewContainer::urlNavigator()
208 {
209 return m_urlNavigator;
210 }
211
212 const DolphinView* DolphinViewContainer::view() const
213 {
214 return m_view;
215 }
216
217 DolphinView* DolphinViewContainer::view()
218 {
219 return m_view;
220 }
221
222 void DolphinViewContainer::showMessage(const QString& msg, MessageType type)
223 {
224 if (msg.isEmpty()) {
225 return;
226 }
227
228 m_messageWidget->setText(msg);
229
230 switch (type) {
231 case Information: m_messageWidget->setMessageType(KMessageWidget::Information); break;
232 case Warning: m_messageWidget->setMessageType(KMessageWidget::Warning); break;
233 case Error: m_messageWidget->setMessageType(KMessageWidget::Error); break;
234 default:
235 Q_ASSERT(false);
236 break;
237 }
238
239 m_messageWidget->setWordWrap(false);
240 const int unwrappedWidth = m_messageWidget->sizeHint().width();
241 m_messageWidget->setWordWrap(unwrappedWidth > size().width());
242
243 m_messageWidget->animatedShow();
244 }
245
246 void DolphinViewContainer::readSettings()
247 {
248 if (GeneralSettings::modifiedStartupSettings()) {
249 // The startup settings should only get applied if they have been
250 // modified by the user. Otherwise keep the (possibly) different current
251 // settings of the URL navigator and the filterbar.
252 m_urlNavigator->setUrlEditable(GeneralSettings::editableUrl());
253 m_urlNavigator->setShowFullPath(GeneralSettings::showFullPath());
254 m_urlNavigator->setHomeUrl(KUrl(GeneralSettings::homeUrl()));
255 setFilterBarVisible(GeneralSettings::filterBar());
256 }
257
258 m_view->readSettings();
259 m_statusBar->readSettings();
260 }
261
262 bool DolphinViewContainer::isFilterBarVisible() const
263 {
264 return m_filterBar->isVisible();
265 }
266
267 void DolphinViewContainer::setSearchModeEnabled(bool enabled)
268 {
269 if (enabled == isSearchModeEnabled()) {
270 if (enabled && !m_searchBox->hasFocus()) {
271 m_searchBox->setFocus();
272 m_searchBox->selectAll();
273 }
274 return;
275 }
276
277 m_searchBox->setVisible(enabled);
278 m_urlNavigator->setVisible(!enabled);
279
280 if (enabled) {
281 KUrl url = m_urlNavigator->locationUrl();
282 m_searchBox->setText(QString());
283 m_searchBox->setReadOnly(isSearchUrl(url), url);
284
285 // Remember the most recent non-search URL as search path
286 // of the search-box, so that it can be restored
287 // when switching back to the URL navigator.
288 int index = m_urlNavigator->historyIndex();
289 const int historySize = m_urlNavigator->historySize();
290 while (isSearchUrl(url) && (index < historySize)) {
291 ++index;
292 url = m_urlNavigator->locationUrl(index);
293 }
294
295 if (!isSearchUrl(url)) {
296 m_searchBox->setSearchPath(url);
297 }
298 } else {
299 m_view->setViewPropertiesContext(QString());
300
301 // Restore the URL for the URL navigator. If Dolphin has been
302 // started with a search-URL, the home URL is used as fallback.
303 const KUrl url = m_searchBox->searchPath();
304 if (url.isValid() && !url.isEmpty()) {
305 if (isSearchUrl(url)) {
306 m_urlNavigator->goHome();
307 } else {
308 m_urlNavigator->setLocationUrl(url);
309 }
310 }
311 }
312 }
313
314 bool DolphinViewContainer::isSearchModeEnabled() const
315 {
316 return m_searchBox->isVisible();
317 }
318
319 QString DolphinViewContainer::placesText() const
320 {
321 QString text;
322
323 if (isSearchModeEnabled()) {
324 text = m_searchBox->searchPath().fileName() + QLatin1String(": ") + m_searchBox->text();
325 } else {
326 text = url().fileName();
327 if (text.isEmpty()) {
328 text = url().host();
329 }
330 }
331
332 return text;
333 }
334
335 void DolphinViewContainer::setUrl(const KUrl& newUrl)
336 {
337 if (newUrl != m_urlNavigator->locationUrl()) {
338 m_urlNavigator->setLocationUrl(newUrl);
339 }
340 }
341
342 void DolphinViewContainer::setFilterBarVisible(bool visible)
343 {
344 Q_ASSERT(m_filterBar);
345 if (visible) {
346 m_filterBar->show();
347 m_filterBar->setFocus();
348 m_filterBar->selectAll();
349 } else {
350 closeFilterBar();
351 }
352 }
353
354 void DolphinViewContainer::delayedStatusBarUpdate()
355 {
356 if (m_statusBarTimer->isActive() && (m_statusBarTimestamp.elapsed() > 2000)) {
357 // No update of the statusbar has been done during the last 2 seconds,
358 // although an update has been requested. Trigger an immediate update.
359 m_statusBarTimer->stop();
360 updateStatusBar();
361 } else {
362 // Invoke updateStatusBar() with a small delay. This assures that
363 // when a lot of delayedStatusBarUpdates() are done in a short time,
364 // no bottleneck is given.
365 m_statusBarTimer->start();
366 }
367 }
368
369 void DolphinViewContainer::updateStatusBar()
370 {
371 m_statusBarTimestamp.start();
372
373 const QString text = m_view->statusBarText();
374 m_statusBar->setDefaultText(text);
375 m_statusBar->resetToDefaultText();
376 }
377
378 void DolphinViewContainer::updateDirectoryLoadingProgress(int percent)
379 {
380 if (m_statusBar->progressText().isEmpty()) {
381 m_statusBar->setProgressText(i18nc("@info:progress", "Loading folder..."));
382 }
383 m_statusBar->setProgress(percent);
384 }
385
386 void DolphinViewContainer::updateDirectorySortingProgress(int percent)
387 {
388 if (m_statusBar->progressText().isEmpty()) {
389 m_statusBar->setProgressText(i18nc("@info:progress", "Sorting..."));
390 }
391 m_statusBar->setProgress(percent);
392 }
393
394 void DolphinViewContainer::slotDirectoryLoadingStarted()
395 {
396 if (isSearchUrl(url())) {
397 // Search KIO-slaves usually don't provide any progress information. Give
398 // a hint to the user that a searching is done:
399 updateStatusBar();
400 m_statusBar->setProgressText(i18nc("@info", "Searching..."));
401 m_statusBar->setProgress(-1);
402 } else {
403 // Trigger an undetermined progress indication. The progress
404 // information in percent will be triggered by the percent() signal
405 // of the directory lister later.
406 updateDirectoryLoadingProgress(-1);
407 }
408 }
409
410 void DolphinViewContainer::slotDirectoryLoadingCompleted()
411 {
412 if (!m_statusBar->progressText().isEmpty()) {
413 m_statusBar->setProgressText(QString());
414 m_statusBar->setProgress(100);
415 }
416
417 if (isSearchUrl(url()) && m_view->itemsCount() == 0) {
418 // The dir lister has been completed on a Nepomuk-URI and no items have been found. Instead
419 // of showing the default status bar information ("0 items") a more helpful information is given:
420 m_statusBar->setText(i18nc("@info:status", "No items found."));
421 } else {
422 updateStatusBar();
423 }
424 }
425
426 void DolphinViewContainer::slotItemActivated(const KFileItem& item)
427 {
428 // It is possible to activate items on inactive views by
429 // drag & drop operations. Assure that activating an item always
430 // results in an active view.
431 m_view->setActive(true);
432
433 KUrl url = item.targetUrl();
434
435 if (item.isDir()) {
436 m_view->setUrl(url);
437 return;
438 }
439
440 if (GeneralSettings::browseThroughArchives() && item.isFile() && url.isLocalFile()) {
441 // Generic mechanism for redirecting to tar:/<path>/ when clicking on a tar file,
442 // zip:/<path>/ when clicking on a zip file, etc.
443 // The .protocol file specifies the mimetype that the kioslave handles.
444 // Note that we don't use mimetype inheritance since we don't want to
445 // open OpenDocument files as zip folders...
446 const QString protocol = KProtocolManager::protocolForArchiveMimetype(item.mimetype());
447 if (!protocol.isEmpty()) {
448 url.setProtocol(protocol);
449 m_view->setUrl(url);
450 return;
451 }
452 }
453
454 if (item.mimetype() == QLatin1String("application/x-desktop")) {
455 // Redirect to the URL in Type=Link desktop files
456 KDesktopFile desktopFile(url.toLocalFile());
457 if (desktopFile.hasLinkType()) {
458 url = desktopFile.readUrl();
459 m_view->setUrl(url);
460 return;
461 }
462 }
463
464 item.run();
465 }
466
467 void DolphinViewContainer::showItemInfo(const KFileItem& item)
468 {
469 if (item.isNull()) {
470 m_statusBar->resetToDefaultText();
471 } else {
472 const QString text = item.isDir() ? item.text() : item.getStatusBarInfo();
473 m_statusBar->setText(text);
474 }
475 }
476
477 void DolphinViewContainer::closeFilterBar()
478 {
479 m_filterBar->hide();
480 m_filterBar->clear();
481 m_view->setFocus();
482 emit showFilterBarChanged(false);
483 }
484
485 void DolphinViewContainer::setNameFilter(const QString& nameFilter)
486 {
487 m_view->setNameFilter(nameFilter);
488 delayedStatusBarUpdate();
489 }
490
491 void DolphinViewContainer::activate()
492 {
493 setActive(true);
494 }
495
496 void DolphinViewContainer::slotViewUrlAboutToBeChanged(const KUrl& url)
497 {
498 // URL changes of the view can happen in two ways:
499 // 1. The URL navigator gets changed and will trigger the view to update its URL
500 // 2. The URL of the view gets changed and will trigger the URL navigator to update
501 // its URL (e.g. by clicking on an item)
502 // In this scope the view-state may only get saved in case 2:
503 if (url != m_urlNavigator->locationUrl()) {
504 saveViewState();
505 }
506 }
507
508 void DolphinViewContainer::slotUrlNavigatorLocationAboutToBeChanged(const KUrl& url)
509 {
510 // URL changes of the view can happen in two ways:
511 // 1. The URL navigator gets changed and will trigger the view to update its URL
512 // 2. The URL of the view gets changed and will trigger the URL navigator to update
513 // its URL (e.g. by clicking on an item)
514 // In this scope the view-state may only get saved in case 1:
515 if (url != m_view->url()) {
516 saveViewState();
517 }
518 }
519
520 void DolphinViewContainer::slotUrlNavigatorLocationChanged(const KUrl& url)
521 {
522 if (KProtocolManager::supportsListing(url)) {
523 setSearchModeEnabled(isSearchUrl(url));
524 m_view->setUrl(url);
525
526 if (m_autoGrabFocus && isActive() && !isSearchUrl(url)) {
527 // When an URL has been entered, the view should get the focus.
528 // The focus must be requested asynchronously, as changing the URL might create
529 // a new view widget.
530 QTimer::singleShot(0, this, SLOT(requestFocus()));
531 }
532 } else if (KProtocolManager::isSourceProtocol(url)) {
533 QString app = "konqueror";
534 if (url.protocol().startsWith(QLatin1String("http"))) {
535 showMessage(i18nc("@info:status",
536 "Dolphin does not support web pages, the web browser has been launched"),
537 Information);
538
539 const KConfigGroup config(KSharedConfig::openConfig("kdeglobals"), "General");
540 const QString browser = config.readEntry("BrowserApplication");
541 if (!browser.isEmpty()) {
542 app = browser;
543 if (app.startsWith('!')) {
544 // a literal command has been configured, remove the '!' prefix
545 app = app.mid(1);
546 }
547 }
548 } else {
549 showMessage(i18nc("@info:status",
550 "Protocol not supported by Dolphin, Konqueror has been launched"),
551 Information);
552 }
553
554 const QString secureUrl = KShell::quoteArg(url.pathOrUrl());
555 const QString command = app + ' ' + secureUrl;
556 KRun::runCommand(command, app, app, this);
557 } else {
558 showMessage(i18nc("@info:status", "Invalid protocol"), Error);
559 }
560 }
561
562 void DolphinViewContainer::dropUrls(const KUrl& destination, QDropEvent* event)
563 {
564 const QString error = DragAndDropHelper::dropUrls(KFileItem(), destination, event);
565 if (!error.isEmpty()) {
566 showMessage(error, Error);
567 }
568 }
569
570 void DolphinViewContainer::redirect(const KUrl& oldUrl, const KUrl& newUrl)
571 {
572 Q_UNUSED(oldUrl);
573 const bool block = m_urlNavigator->signalsBlocked();
574 m_urlNavigator->blockSignals(true);
575
576 // Assure that the location state is reset for redirection URLs. This
577 // allows to skip redirection URLs when going back or forward in the
578 // URL history.
579 m_urlNavigator->saveLocationState(QByteArray());
580 m_urlNavigator->setLocationUrl(newUrl);
581 setSearchModeEnabled(isSearchUrl(newUrl));
582
583 m_urlNavigator->blockSignals(block);
584 }
585
586 void DolphinViewContainer::requestFocus()
587 {
588 m_view->setFocus();
589 }
590
591 void DolphinViewContainer::saveUrlCompletionMode(KGlobalSettings::Completion completion)
592 {
593 GeneralSettings::setUrlCompletionMode(completion);
594 }
595
596 void DolphinViewContainer::slotHistoryChanged()
597 {
598 QByteArray locationState = m_urlNavigator->locationState();
599 if (!locationState.isEmpty()) {
600 QDataStream stream(&locationState, QIODevice::ReadOnly);
601 m_view->restoreState(stream);
602 }
603 }
604
605 void DolphinViewContainer::startSearching()
606 {
607 const KUrl url = m_searchBox->urlForSearching();
608 if (url.isValid() && !url.isEmpty()) {
609 m_view->setViewPropertiesContext("search");
610 m_urlNavigator->setLocationUrl(url);
611 }
612 }
613
614 void DolphinViewContainer::closeSearchBox()
615 {
616 setSearchModeEnabled(false);
617 }
618
619 void DolphinViewContainer::stopDirectoryLoading()
620 {
621 m_view->stopLoading();
622 m_statusBar->setProgress(100);
623 }
624
625 void DolphinViewContainer::slotStatusBarZoomLevelChanged(int zoomLevel)
626 {
627 m_view->setZoomLevel(zoomLevel);
628 }
629
630 void DolphinViewContainer::showErrorMessage(const QString& msg)
631 {
632 showMessage(msg, Error);
633 }
634
635 bool DolphinViewContainer::isSearchUrl(const KUrl& url) const
636 {
637 const QString protocol = url.protocol();
638 return protocol.contains("search") || (protocol == QLatin1String("nepomuk"));
639 }
640
641 void DolphinViewContainer::saveViewState()
642 {
643 QByteArray locationState;
644 QDataStream stream(&locationState, QIODevice::WriteOnly);
645 m_view->saveState(stream);
646 m_urlNavigator->saveLocationState(locationState);
647 }
648
649 #include "dolphinviewcontainer.moc"