[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 245279] History (back button) in documentation viewer doesn't
From:       Nicolás Alvarez <nicolas.alvarez () gmail ! com>
Date:       2010-07-27 20:01:46
Message-ID: 20100727200146.6ACF855B34 () immanuel ! kde ! org
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=245279





--- Comment #2 from Nicolás Alvarez <nicolas alvarez gmail com>  2010-07-27 22:01:45 ---
commit 776ebc2360fb54d5f2e3aed75ff7be9b7527e07b
Author: Nicolà ¡s Alvarez <nicolas.alvarez@gmail.com>
Date:   Fri Jul 23 21:08:55 2010 -0300

    backport to stable: Fix behavior of page history in the documentation
viewer.

    BUG:245279

diff --git a/shell/documentationview.cpp b/shell/documentationview.cpp
index fe4e0e1..71486f3 100644
--- a/shell/documentationview.cpp
+++ b/shell/documentationview.cpp
@@ -180,6 +180,15 @@ void DocumentationView::addHistory(KSharedPtr<
KDevelop::IDocumentation > doc)
 {
     mBack->setEnabled( !mHistory.isEmpty() );
     mForward->setEnabled(false);
+
+    // clear all history following the current item, unless we're already
+    // at the end (otherwise this code crashes when history is empty, which
+    // happens when addHistory is first called on startup to add the
+    // homepage)
+    if (mCurrent+1 < mHistory.end()) {
+        mHistory.erase(mCurrent+1, mHistory.end());
+    }
+
     mHistory.append(doc);
     mCurrent=mHistory.end()-1;
 }

-- 
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