]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Remove code for dolphin < 4.14 tab restore
authorAlexander Lohnau <alexander.lohnau@gmx.de>
Fri, 23 Apr 2021 17:43:55 +0000 (19:43 +0200)
committerMéven Car <meven29@gmail.com>
Sat, 24 Apr 2021 17:16:27 +0000 (17:16 +0000)
The old config keys haven't been written for since KDE 4 times
and has been internally marked as deprecated.

src/dolphintabpage.cpp
src/dolphintabpage.h
src/dolphintabwidget.cpp

index 36049fa9744605986e63fbf13fcf0178c9ede253..33c77c42ad2bb8127f7e1657d2c90c2e70b89117 100644 (file)
@@ -328,48 +328,6 @@ void DolphinTabPage::restoreState(const QByteArray& state)
     m_splitter->restoreState(splitterState);
 }
 
-void DolphinTabPage::restoreStateV1(const QByteArray& state)
-{
-    if (state.isEmpty()) {
-        return;
-    }
-
-    QByteArray sd = state;
-    QDataStream stream(&sd, QIODevice::ReadOnly);
-
-    bool isSplitViewEnabled = false;
-    stream >> isSplitViewEnabled;
-    setSplitViewEnabled(isSplitViewEnabled, WithoutAnimation);
-
-    QUrl primaryUrl;
-    stream >> primaryUrl;
-    m_primaryViewContainer->setUrl(primaryUrl);
-    bool primaryUrlEditable;
-    stream >> primaryUrlEditable;
-    m_primaryViewContainer->urlNavigatorInternalWithHistory()->setUrlEditable(primaryUrlEditable);
-
-    if (isSplitViewEnabled) {
-        QUrl secondaryUrl;
-        stream >> secondaryUrl;
-        m_secondaryViewContainer->setUrl(secondaryUrl);
-        bool secondaryUrlEditable;
-        stream >> secondaryUrlEditable;
-        m_secondaryViewContainer->urlNavigatorInternalWithHistory()->setUrlEditable(secondaryUrlEditable);
-    }
-
-    stream >> m_primaryViewActive;
-    if (m_primaryViewActive) {
-        m_primaryViewContainer->setActive(true);
-    } else {
-        Q_ASSERT(m_splitViewEnabled);
-        m_secondaryViewContainer->setActive(true);
-    }
-
-    QByteArray splitterState;
-    stream >> splitterState;
-    m_splitter->restoreState(splitterState);
-}
-
 void DolphinTabPage::setActive(bool active)
 {
     if (active) {
index a9b7f81335955016454806a10954d782fa3e0b0e..57a0c33440552091d71059d590133d59a58551ca 100644 (file)
@@ -128,15 +128,6 @@ public:
      */
     void restoreState(const QByteArray& state);
 
-    /**
-     * Restores all tab related properties (urls, splitter layout, ...) from
-     * the given \a state.
-     *
-     * @deprecated The first tab state version has no version number, we keep
-     *             this method to restore old states (<= Dolphin 4.14.x).
-     */
-    Q_DECL_DEPRECATED void restoreStateV1(const QByteArray& state);
-
     /**
      * Set whether the tab page is active
      *
index 0a024235ba248eb33f8ad088afc5496069d55606..cfb695e7db24a05a1f3a931f0823859ff917adf3 100644 (file)
@@ -87,15 +87,8 @@ void DolphinTabWidget::readProperties(const KConfigGroup& group)
         if (i >= count()) {
             openNewActivatedTab();
         }
-        if (group.hasKey("Tab Data " % QString::number(i))) {
-            // Tab state created with Dolphin > 4.14.x
-            const QByteArray state = group.readEntry("Tab Data " % QString::number(i), QByteArray());
-            tabPageAt(i)->restoreState(state);
-        } else {
-            // Tab state created with Dolphin <= 4.14.x
-            const QByteArray state = group.readEntry("Tab " % QString::number(i), QByteArray());
-            tabPageAt(i)->restoreStateV1(state);
-        }
+        const QByteArray state = group.readEntry("Tab Data " % QString::number(i), QByteArray());
+        tabPageAt(i)->restoreState(state);
     }
 
     const int index = group.readEntry("Active Tab Index", 0);