[rkward-cvs] SF.net SVN: rkward:[3709] trunk/rkward/rkward/windows/rkhelpsearchwindow. cpp

tfry at users.sourceforge.net tfry at users.sourceforge.net
Wed Aug 3 08:56:04 UTC 2011


Revision: 3709
          http://rkward.svn.sourceforge.net/rkward/?rev=3709&view=rev
Author:   tfry
Date:     2011-08-03 08:56:03 +0000 (Wed, 03 Aug 2011)

Log Message:
-----------
Fixes to help type handling.

Modified Paths:
--------------
    trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp

Modified: trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp	2011-08-03 08:42:56 UTC (rev 3708)
+++ trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp	2011-08-03 08:56:03 UTC (rev 3709)
@@ -168,7 +168,7 @@
 	else if (type == "vignette") command = "vignette(";
 
 	command.append (RObject::rQuote (function_name));
-	if (!package.isEmpty ()) command.append (", package=" + package);
+	if (!package.isEmpty ()) command.append (", package=" + RObject::rQuote (package));
 	command.append (")");
 
 	RKGlobals::rInterface ()->issueCommand (command, RCommand::App | RCommand::GetStringVector, i18n ("Find HTML help for %1").arg (function_name), this, GET_HELP);
@@ -305,19 +305,15 @@
 	// easier typing
 	int row = index.row ();
 	int col = index.column ();
-	if (result_count) {
+	if (result_count && (row < result_count)) {
 		if (role == Qt::DisplayRole || role == Qt::ToolTipRole) {
-			if (row < result_count) {
-				if (col == COL_TOPIC) return topics[row];
-				if (col == COL_TITLE) return titles[row];
-				if (col == COL_PACKAGE) return packages[row];
-			} else {
-				RK_ASSERT (false);
-			}
+			if (col == COL_TOPIC) return topics[row];
+			if (col == COL_TITLE) return titles[row];
+			if (col == COL_PACKAGE) return packages[row];
 		} else if ((col == 0) && (role == Qt::DecorationRole)) {
-			if (types[col] == "help") return RKStandardIcons::getIcon (RKStandardIcons::WindowHelp);
-			if (types[col] == "demo") return RKStandardIcons::getIcon (RKStandardIcons::WindowCommandEditor);
-			if (types[col] == "vignette") return RKStandardIcons::getIcon (RKStandardIcons::DocumentPDF);
+			if (types[row] == "help") return RKStandardIcons::getIcon (RKStandardIcons::WindowHelp);
+			if (types[row] == "demo") return RKStandardIcons::getIcon (RKStandardIcons::WindowCommandEditor);
+			if (types[row] == "vignette") return RKStandardIcons::getIcon (RKStandardIcons::DocumentPDF);
 		}
 	} else {
 		RK_ASSERT (false);


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