- DolphinViewContainer* cont = m_viewTab[i].primaryView;
-
- cont->setUrl(group.readEntry(tabProperty("Primary URL", i)));
- const bool editable = group.readEntry(tabProperty("Primary Editable", i), false);
- cont->urlNavigator()->setUrlEditable(editable);
-
- cont = m_viewTab[i].secondaryView;
- const QString secondaryUrl = group.readEntry(tabProperty("Secondary URL", i));
- if (!secondaryUrl.isEmpty()) {
- if (!cont) {
- // a secondary view should be shown, but no one is available
- // currently -> create a new view
- toggleSplitView();
- cont = m_viewTab[i].secondaryView;
- Q_ASSERT(cont);
- }
-
- // The right view must be activated before the URL is set. Changing
- // the URL in the right view will emit the right URL navigator's
- // urlChanged(KUrl) signal, which is connected to the changeUrl(KUrl)
- // slot. That slot will change the URL in the left view if it is still
- // active. See https://bugs.kde.org/show_bug.cgi?id=330047.
- setActiveViewContainer(cont);
-
- cont->setUrl(secondaryUrl);
- const bool editable = group.readEntry(tabProperty("Secondary Editable", i), false);
- cont->urlNavigator()->setUrlEditable(editable);
- } else if (cont) {
- // no secondary view should be shown, but the default setting shows
- // one already -> close the view
- toggleSplitView();
- }
+ const QByteArray state = group.readEntry("Tab " % QString::number(i), QByteArray());
+ DolphinTabPage* tabPage = m_viewTab.at(i);
+ tabPage->restoreState(state);