Changeset View
Changeset View
Standalone View
Standalone View
shell/documentcontroller.cpp
Show First 20 Lines • Show All 1172 Lines • ▼ Show 20 Line(s) | 1172 | { | |||
---|---|---|---|---|---|
1173 | // There is no right child group, so the right side should be filled with the currently active views | 1173 | // There is no right child group, so the right side should be filled with the currently active views | ||
1174 | activeViewToSecondChild = true; | 1174 | activeViewToSecondChild = true; | ||
1175 | }else{ | 1175 | }else{ | ||
1176 | QStringList separatorsAndParens = separators; | 1176 | QStringList separatorsAndParens = separators; | ||
1177 | separatorsAndParens << QStringLiteral("[") << QStringLiteral("]"); | 1177 | separatorsAndParens << QStringLiteral("[") << QStringLiteral("]"); | ||
1178 | // Check if the second child-set contains an unterminated separator, which means that the active views should end up there | 1178 | // Check if the second child-set contains an unterminated separator, which means that the active views should end up there | ||
1179 | for(int pos = pickSeparator+1; pos < urlsWithSeparators.size(); ++pos) | 1179 | for(int pos = pickSeparator+1; pos < urlsWithSeparators.size(); ++pos) | ||
1180 | if( separators.contains(urlsWithSeparators[pos]) && (pos == urlsWithSeparators.size()-1 || | 1180 | if( separators.contains(urlsWithSeparators[pos]) && (pos == urlsWithSeparators.size()-1 || | ||
1181 | separatorsAndParens.contains(urlsWithSeparators[pos-1]) || | | |||
1182 | separatorsAndParens.contains(urlsWithSeparators[pos-1])) ) | 1181 | separatorsAndParens.contains(urlsWithSeparators[pos-1])) ) | ||
1183 | activeViewToSecondChild = true; | 1182 | activeViewToSecondChild = true; | ||
1184 | } | 1183 | } | ||
1185 | 1184 | | |||
1186 | Qt::Orientation orientation = urlsWithSeparators[pickSeparator] == QLatin1String("/") ? Qt::Horizontal : Qt::Vertical; | 1185 | Qt::Orientation orientation = urlsWithSeparators[pickSeparator] == QLatin1String("/") ? Qt::Horizontal : Qt::Vertical; | ||
1187 | 1186 | | |||
1188 | if(!index->isSplit()) | 1187 | if(!index->isSplit()) | ||
1189 | { | 1188 | { | ||
Show All 25 Lines | |||||
1215 | } | 1214 | } | ||
1216 | 1215 | | |||
1217 | void DocumentController::vcsAnnotateCurrentDocument() | 1216 | void DocumentController::vcsAnnotateCurrentDocument() | ||
1218 | { | 1217 | { | ||
1219 | IDocument* doc = activeDocument(); | 1218 | IDocument* doc = activeDocument(); | ||
1220 | QUrl url = doc->url(); | 1219 | QUrl url = doc->url(); | ||
1221 | IProject* project = KDevelop::ICore::self()->projectController()->findProjectForUrl(url); | 1220 | IProject* project = KDevelop::ICore::self()->projectController()->findProjectForUrl(url); | ||
1222 | if(project && project->versionControlPlugin()) { | 1221 | if(project && project->versionControlPlugin()) { | ||
1223 | IBasicVersionControl* iface = nullptr; | 1222 | IBasicVersionControl* iface = project->versionControlPlugin()->extension<IBasicVersionControl>(); | ||
1224 | iface = project->versionControlPlugin()->extension<IBasicVersionControl>(); | | |||
1225 | auto helper = new VcsPluginHelper(project->versionControlPlugin(), iface); | 1223 | auto helper = new VcsPluginHelper(project->versionControlPlugin(), iface); | ||
1226 | connect(doc->textDocument(), &KTextEditor::Document::aboutToClose, | 1224 | connect(doc->textDocument(), &KTextEditor::Document::aboutToClose, | ||
1227 | helper, static_cast<void(VcsPluginHelper::*)(KTextEditor::Document*)>(&VcsPluginHelper::disposeEventually)); | 1225 | helper, static_cast<void(VcsPluginHelper::*)(KTextEditor::Document*)>(&VcsPluginHelper::disposeEventually)); | ||
1228 | Q_ASSERT(qobject_cast<KTextEditor::AnnotationViewInterface*>(doc->activeTextView())); | 1226 | Q_ASSERT(qobject_cast<KTextEditor::AnnotationViewInterface*>(doc->activeTextView())); | ||
1229 | // can't use new signal slot syntax here, AnnotationViewInterface is not a QObject | 1227 | // can't use new signal slot syntax here, AnnotationViewInterface is not a QObject | ||
1230 | connect(doc->activeTextView(), SIGNAL(annotationBorderVisibilityChanged(View*,bool)), | 1228 | connect(doc->activeTextView(), SIGNAL(annotationBorderVisibilityChanged(View*,bool)), | ||
1231 | helper, SLOT(disposeEventually(View*, bool))); | 1229 | helper, SLOT(disposeEventually(View*, bool))); | ||
1232 | helper->addContextDocument(url); | 1230 | helper->addContextDocument(url); | ||
Show All 11 Lines |