Changeset View
Changeset View
Standalone View
Standalone View
kate/kateviewmanager.cpp
Show First 20 Lines • Show All 1134 Lines • ▼ Show 20 Line(s) | |||||
1135 | 1135 | | |||
1136 | void KateViewManager::restoreSplitter(const KConfigBase *configBase, const QString &group, | 1136 | void KateViewManager::restoreSplitter(const KConfigBase *configBase, const QString &group, | ||
1137 | QSplitter *parent, const QString &viewConfGrp) | 1137 | QSplitter *parent, const QString &viewConfGrp) | ||
1138 | { | 1138 | { | ||
1139 | KConfigGroup config(configBase, group); | 1139 | KConfigGroup config(configBase, group); | ||
1140 | 1140 | | |||
1141 | parent->setOrientation((Qt::Orientation)config.readEntry("Orientation", int(Qt::Horizontal))); | 1141 | parent->setOrientation((Qt::Orientation)config.readEntry("Orientation", int(Qt::Horizontal))); | ||
1142 | 1142 | | |||
1143 | QStringList children = config.readEntry("Children", QStringList()); | 1143 | const QStringList children = config.readEntry("Children", QStringList()); | ||
1144 | for (QStringList::Iterator it = children.begin(); it != children.end(); ++it) { | 1144 | for (const auto& str : children) { | ||
1145 | // for a viewspace, create it and open all documents therein. | 1145 | // for a viewspace, create it and open all documents therein. | ||
1146 | if ((*it).startsWith(viewConfGrp + QStringLiteral("-ViewSpace"))) { | 1146 | if (str.startsWith(viewConfGrp + QStringLiteral("-ViewSpace"))) { | ||
1147 | KateViewSpace *vs = new KateViewSpace(this, nullptr); | 1147 | KateViewSpace *vs = new KateViewSpace(this, nullptr); | ||
1148 | m_viewSpaceList.append(vs); | 1148 | m_viewSpaceList.append(vs); | ||
1149 | // make active so that the view created in restoreConfig has this | 1149 | // make active so that the view created in restoreConfig has this | ||
1150 | // new view space as parent. | 1150 | // new view space as parent. | ||
1151 | setActiveSpace(vs); | 1151 | setActiveSpace(vs); | ||
1152 | 1152 | | |||
1153 | parent->addWidget(vs); | 1153 | parent->addWidget(vs); | ||
1154 | vs->restoreConfig(this, configBase, *it); | 1154 | vs->restoreConfig(this, configBase, str); | ||
1155 | vs->show(); | 1155 | vs->show(); | ||
1156 | } else { | 1156 | } else { | ||
1157 | // for a splitter, recurse | 1157 | // for a splitter, recurse | ||
1158 | auto newContainer = new QSplitter(parent); | 1158 | auto newContainer = new QSplitter(parent); | ||
1159 | 1159 | | |||
1160 | // we don't allow full collapse, see bug 366014 | 1160 | // we don't allow full collapse, see bug 366014 | ||
1161 | newContainer->setChildrenCollapsible(false); | 1161 | newContainer->setChildrenCollapsible(false); | ||
1162 | 1162 | | |||
1163 | restoreSplitter(configBase, *it, newContainer, viewConfGrp); | 1163 | restoreSplitter(configBase, str, newContainer, viewConfGrp); | ||
1164 | } | 1164 | } | ||
1165 | } | 1165 | } | ||
1166 | 1166 | | |||
1167 | // set sizes | 1167 | // set sizes | ||
1168 | parent->setSizes(config.readEntry("Sizes", QList<int>())); | 1168 | parent->setSizes(config.readEntry("Sizes", QList<int>())); | ||
1169 | parent->show(); | 1169 | parent->show(); | ||
1170 | } | 1170 | } | ||
1171 | 1171 | | |||
▲ Show 20 Lines • Show All 85 Lines • Show Last 20 Lines |