[prev in list] [next in list] [prev in thread] [next in thread]
List: kdevelop-bugs
Subject: [Bug 260663] Open documents get closed after performing a review
From: Dmitry <dmitry.risenberg () gmail ! com>
Date: 2010-12-27 22:29:31
Message-ID: 20101227222931.7218478BDA () immanuel ! kde ! org
[Download RAW message or body]
https://bugs.kde.org/show_bug.cgi?id=260663
Dmitry <dmitry.risenberg@gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
--- Comment #1 from Dmitry <dmitry risenberg gmail com> 2010-12-27 23:29:30 ---
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);
--
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic