Summary: | Open documents get closed after performing a review | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Dmitry <dmitry.risenberg> |
Component: | general | Assignee: | kdevelop-bugs-null |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | 4.1.60 | ||
Target Milestone: | 4.2.0 | ||
Platform: | Compiled Sources | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Dmitry
2010-12-18 22:27:04 UTC
commit 619aa3830d965e29bdbeae7ba377eed0c5493569 branch 1.2 Author: Dmitry Risenberg <dmitry.risenberg@gmail.com> Date: Sat Dec 25 14:07:19 2010 +0300 Do not mess with other active working sets when calling for a review. BUG: 260663 diff --git a/plugins/patchreview/patchreview.cpp b/plugins/patchreview/patchreview.cpp index 4b4b393..3575636 100644 --- a/plugins/patchreview/patchreview.cpp +++ b/plugins/patchreview/patchreview.cpp @@ -66,6 +66,8 @@ std::string*/ #include <sublime/controller.h> #include <sublime/mainwindow.h> #include <sublime/area.h> +#include <sublime/document.h> +#include <sublime/view.h> #include <interfaces/iprojectcontroller.h> #include "diffsettings.h" #include <interfaces/iplugincontroller.h> @@ -1441,9 +1443,8 @@ void PatchReviewPlugin::updateReview() if(QFileInfo(absoluteUrl.path()).exists() && absoluteUrl.path() != "/dev/null") { - if (!documents.contains(absoluteUrl)) { - ICore::self()->documentController()->openDocument(absoluteUrl); - } else { + ICore::self()->documentController()->openDocument(absoluteUrl); + if (documents.contains(absoluteUrl)) { documents.remove(absoluteUrl); } seekHunk(true, absoluteUrl); //Jump to the first changed position @@ -1454,9 +1455,13 @@ void PatchReviewPlugin::updateReview() } } - // close documents we didn't open again - foreach(IDocument* doc, documents.values()) { - doc->close(); + // Close views for documents that were loaded from the working set, but are not in the patch + QList<IDocument*> documentsList = documents.values(); + foreach(Sublime::View* view, w->area()->views()) { + IDocument* doc = dynamic_cast<IDocument*>(view->document()); + if(doc && documentsList.contains(doc)) { + w->area()->closeView(view); + } } Q_ASSERT(futureActiveDoc); |