[rkward-cvs] SF.net SVN: rkward:[3939] trunk/rkward/rkward

tfry at users.sourceforge.net tfry at users.sourceforge.net
Fri Oct 14 07:38:22 UTC 2011


Revision: 3939
          http://rkward.svn.sourceforge.net/rkward/?rev=3939&view=rev
Author:   tfry
Date:     2011-10-14 07:38:22 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
Don't keep the help search window disabled, if the help search command fails (and don't make the command fail, if there are no results)

Modified Paths:
--------------
    trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_help.R
    trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp

Modified: trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_help.R
===================================================================
--- trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_help.R	2011-10-13 18:58:48 UTC (rev 3938)
+++ trunk/rkward/rkward/rbackend/rpackages/rkward/R/internal_help.R	2011-10-14 07:38:22 UTC (rev 3939)
@@ -39,6 +39,6 @@
 ".rk.get.search.results" <- function (pattern, ...) {
 	H=as.data.frame (help.search(pattern, ...)$matches)
 	# NOTE: The field "Type" was added in R 2.14.0. For earlier versions of R, only help pages were returned as results of help.search()
-	if (is.null (H$Type)) H$Type <- "help"
+	if ((dim (H)[1] > 0) && (is.null (H$Type))) H$Type <- "help"
 	c (as.character (H$topic), as.character (H$title), as.character(H$Package), as.character(H$Type))
 }

Modified: trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp	2011-10-13 18:58:48 UTC (rev 3938)
+++ trunk/rkward/rkward/windows/rkhelpsearchwindow.cpp	2011-10-14 07:38:22 UTC (rev 3939)
@@ -242,14 +242,15 @@
 void RKHelpSearchWindow::rCommandDone (RCommand *command) {
 	RK_TRACE (APP);
 	if (command->getFlags () == HELP_SEARCH) {
+		QStringList res;
 		if (command->failed ()) {
 			RK_ASSERT (false);
-			return;
+		} else {
+			RK_ASSERT (command->getDataType () == RData::StringVector);
+			res = command->getStringVector ();
 		}
-		RK_ASSERT (command->getDataType () == RData::StringVector);
+		results->setResults (res);
 
-		results->setResults (command->getStringVector ());
-
 		for (int i = 0; i < COL_COUNT; ++i) results_view->resizeColumnToContents (i);
 		setEnabled(true);
 	} else if (command->getFlags () == GET_HELP) {

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