From kdevelop-bugs Tue Jul 27 20:01:46 2010 From: =?UTF-8?Q?Nicol=C3=A1s=20Alvarez=20?= Date: Tue, 27 Jul 2010 20:01:46 +0000 To: kdevelop-bugs Subject: [Bug 245279] History (back button) in documentation viewer doesn't Message-Id: <20100727200146.6ACF855B34 () immanuel ! kde ! org> X-MARC-Message: https://marc.info/?l=kdevelop-bugs&m=128026100430818 https://bugs.kde.org/show_bug.cgi?id=245279 --- Comment #2 from Nicolás Alvarez 2010-07-27 22:01:45 --- commit 776ebc2360fb54d5f2e3aed75ff7be9b7527e07b Author: Nicolás Alvarez 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