[rkward-cvs] SF.net SVN: rkward: [2107] branches/KDE4_port/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Mon Oct 22 20:46:34 UTC 2007


Revision: 2107
          http://rkward.svn.sourceforge.net/rkward/?rev=2107&view=rev
Author:   tfry
Date:     2007-10-22 13:46:34 -0700 (Mon, 22 Oct 2007)

Log Message:
-----------
Don't crash when the command history is empty

Modified Paths:
--------------
    branches/KDE4_port/rkward/rkconsole.cpp
    branches/KDE4_port/rkward/rkconsole.h

Modified: branches/KDE4_port/rkward/rkconsole.cpp
===================================================================
--- branches/KDE4_port/rkward/rkconsole.cpp	2007-10-22 20:22:52 UTC (rev 2106)
+++ branches/KDE4_port/rkward/rkconsole.cpp	2007-10-22 20:46:34 UTC (rev 2107)
@@ -682,10 +682,10 @@
 
 void RKConsole::addCommandToHistory (const QString &command) {
 	RK_TRACE (APP);
-	if (command.isEmpty () || commands_history.last() == command) return; // don't add empty or duplicate lines
+	if (command.isEmpty () || ((!commands_history.isEmpty ()) && commands_history.last() == command)) return; // don't add empty or duplicate lines
 
 	commands_history.append (command);
-	history_editing_line = QString::null;
+	history_editing_line = QString ();
 
 	if (RKSettingsModuleConsole::maxHistoryLength ()) {
 		uint c = commands_history.count ();

Modified: branches/KDE4_port/rkward/rkconsole.h
===================================================================
--- branches/KDE4_port/rkward/rkconsole.h	2007-10-22 20:22:52 UTC (rev 2106)
+++ branches/KDE4_port/rkward/rkconsole.h	2007-10-22 20:46:34 UTC (rev 2107)
@@ -23,15 +23,12 @@
 #include <ktexteditor/document.h>
 #include <ktexteditor/view.h>
 
-#include <q3ptrlist.h>
-//Added by qt3to4:
-#include <QEvent>
-#include <QKeyEvent>
-
 #include "rbackend/rcommandreceiver.h"
 #include "windows/rkcommandeditorwindow.h"
 #include "windows/rkmdiwindow.h"
 
+class QEvent;
+class QKeyEvent;
 class QStringList;
 class KAction;
 class RCommand;


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the rkward-tracker mailing list