mirror of
https://invent.kde.org/system/dolphin
synced 2024-10-05 16:19:10 +00:00
Remove code for dolphin < 4.14 tab restore
The old config keys haven't been written for since KDE 4 times and has been internally marked as deprecated.
This commit is contained in:
parent
6cec386192
commit
844d1c0547
|
@ -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) {
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue