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

List:       kde-bugs-dist
Subject:    [Bug 245279] History (back button) in documentation viewer doesn't
From:       Nicolás Alvarez  <nicolas.alvarez () gmail ! com>
Date:       2010-07-26 20:22:40
Message-ID: 20100726202241.52B035530B () immanuel ! kde ! org
[Download RAW message or body]

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


Nicolás Alvarez <nicolas.alvarez@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED




--- Comment #1 from Nicolás Alvarez <nicolas alvarez gmail com>  2010-07-26 22:22:32 ---
commit 9611a4c2ad0f5430f2fa4a69e53e389458426b35
Author: Nicolà ¡s Alvarez <nicolas.alvarez@gmail.com>
Date:   Fri Jul 23 21:08:55 2010 -0300

    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 watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic