[rkward-cvs] SF.net SVN: rkward: [826] trunk/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Sun Oct 8 17:28:44 UTC 2006
Revision: 826
http://svn.sourceforge.net/rkward/?rev=826&view=rev
Author: tfry
Date: 2006-10-08 10:28:33 -0700 (Sun, 08 Oct 2006)
Log Message:
-----------
small cleanups
Modified Paths:
--------------
trunk/rkward/TODO
trunk/rkward/rkward/khelpdlg.cpp
trunk/rkward/rkward/khelpdlg.h
trunk/rkward/rkward/rbackend/rembedinternal.cpp
trunk/rkward/rkward/rbackend/rinterface.cpp
trunk/rkward/rkward/rbackend/rthread.cpp
trunk/rkward/rkward/rbackend/rthread.h
Modified: trunk/rkward/TODO
===================================================================
--- trunk/rkward/TODO 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/TODO 2006-10-08 17:28:33 UTC (rev 826)
@@ -11,13 +11,14 @@
- produce many readline calls (e.g. "for (i in 1:10) readline()") repeatedly and cancel all of them.
- Sometimes only the readine is interrupted, sometimes the whole command (might be R's fault? But works fine in plain R)
- Occasionally this seems to leave R in a bad (semi-crashed) state
- - Can't we just return 0 from RReadConsole?
+ - Can't we just return 0 from RReadConsole? We do, but it doesn't help. Maybe in this case we need to send the SIGINT from within the callback (in the backend thread)?
- There is definitely a memory leak in handling output!
- Produce lots and lots of output -> watch mem usage grow
- Probably the RKConsole is to blame (run outside console -> no significant increase)
- Maybe the kate-part needs to be reset (syntax parse tree) every once in a while?
- - A call to "browser ()" *will* crash rkward. I suppose it's a long jump out of the tryEval context.
- - Maybe overwrite browser () with an error message to avoid the crash
+ - A call to "browser ()" *will* crash rkward.
+ - I suppose it's a long jump out of the tryEval context.
+ - do_browser() seems to guard against that. Instead, it's likely that the console io buffer is used, but not set up
- investigate why exactly this happens, and whether it's fixable in R or rkward
Compilation / technical
@@ -111,6 +112,10 @@
- .rk.get.available.packages ()
- use external (file) storage for cache to save mem
- can the mutex be made non-recursive? I think so, but don't recall
+ - .rk.get.meta ()
+ - this is surprisingly inefficient, and may account for 5% of startup time (due to being called on all objects while initializing the object list)
+ - use a vector with named rows instead of a dataframe
+ - this is an incompatible change, and will require some porting script
General code:
- use constBegin (), constEnd ()
Modified: trunk/rkward/rkward/khelpdlg.cpp
===================================================================
--- trunk/rkward/rkward/khelpdlg.cpp 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/rkward/khelpdlg.cpp 2006-10-08 17:28:33 UTC (rev 826)
@@ -2,7 +2,7 @@
khelpdlg - description
-------------------
begin : Fri Feb 25 2005
- copyright : (C) 2005 by Thomas Friedrichsmeier
+ copyright : (C) 2005, 2006 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -133,12 +133,12 @@
}
QString agrep = "FALSE";
- if (fuzzyCheckBox->isChecked ()==TRUE) {
+ if (fuzzyCheckBox->isChecked ()) {
agrep="NULL";
}
QString ignoreCase = "TRUE";
- if(caseSensitiveCheckBox->isChecked ()==TRUE) {
+ if(caseSensitiveCheckBox->isChecked ()) {
ignoreCase="FALSE";
}
@@ -174,7 +174,6 @@
return;
}
- chain=0;
QString s="help(\"";
s.append (item->text (0));
s.append ("\", htmlhelp=TRUE, package= \"");
Modified: trunk/rkward/rkward/khelpdlg.h
===================================================================
--- trunk/rkward/rkward/khelpdlg.h 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/rkward/khelpdlg.h 2006-10-08 17:28:33 UTC (rev 826)
@@ -2,7 +2,7 @@
khelpdlg - description
-------------------
begin : Fri Feb 25 2005
- copyright : (C) 2005 by Thomas Friedrichsmeier
+ copyright : (C) 2005, 2006 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
@@ -36,11 +36,11 @@
@author Pierre Ecochard */
class KHelpDlg : public QWidget, public RCommandReceiver {
- Q_OBJECT
+ Q_OBJECT
public:
- KHelpDlg (QWidget* parent = 0, const char* name = 0);
- ~KHelpDlg ();
- void rCommandDone (RCommand *command);
+ KHelpDlg (QWidget* parent = 0, const char* name = 0);
+ ~KHelpDlg ();
+ void rCommandDone (RCommand *command);
/** small convenience function to get context help for RKCommandEditorWindow and RKConsole.
@param context_line The current line
@@ -52,15 +52,13 @@
void slotFindButtonClicked();
void slotResultsListDblClicked( QListViewItem *item, const QPoint &, int );
private:
- QComboBox* field;
- QComboBox* fieldsList;
- QComboBox* packagesList;
- QCheckBox* caseSensitiveCheckBox;
- QCheckBox* fuzzyCheckBox;
- QPushButton* findButton;
- QListView* resultsList;
-
- RCommandChain *chain;
+ QComboBox* field;
+ QComboBox* fieldsList;
+ QComboBox* packagesList;
+ QCheckBox* caseSensitiveCheckBox;
+ QCheckBox* fuzzyCheckBox;
+ QPushButton* findButton;
+ QListView* resultsList;
};
#endif
Modified: trunk/rkward/rkward/rbackend/rembedinternal.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rembedinternal.cpp 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/rkward/rbackend/rembedinternal.cpp 2006-10-08 17:28:33 UTC (rev 826)
@@ -87,10 +87,11 @@
args.chars_b = (char **) (&buf);
args.int_a = buflen;
args.int_b = hist; // actually, we ignore hist
+ args.int_c = 1; // not cancelled
REmbedInternal::this_pointer->handleStandardCallback (&args);
// default implementation seems to return 1 on success, 0 on failure, contrary to some documentation. see unix/std-sys.c
- if (buf) return 1;
+ if (buf && args.int_c) return 1;
return 0;
}
Modified: trunk/rkward/rkward/rbackend/rinterface.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rinterface.cpp 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/rkward/rbackend/rinterface.cpp 2006-10-08 17:28:33 UTC (rev 826)
@@ -369,6 +369,7 @@
qstrcpy (*(args->chars_b), result.local8Bit ());
if (!ok) {
+ args->int_c = 0;
args->done = true; // need to do this at once. Else we risk getting stuck in the standard callback event loop
cancelCommand (runningCommand ());
return;
Modified: trunk/rkward/rkward/rbackend/rthread.cpp
===================================================================
--- trunk/rkward/rkward/rbackend/rthread.cpp 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/rkward/rbackend/rthread.cpp 2006-10-08 17:28:33 UTC (rev 826)
@@ -2,7 +2,7 @@
rthread - description
-------------------
begin : Mon Aug 2 2004
- copyright : (C) 2004 by Thomas Friedrichsmeier
+ copyright : (C) 2004, 2006 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
Modified: trunk/rkward/rkward/rbackend/rthread.h
===================================================================
--- trunk/rkward/rkward/rbackend/rthread.h 2006-10-08 16:44:13 UTC (rev 825)
+++ trunk/rkward/rkward/rbackend/rthread.h 2006-10-08 17:28:33 UTC (rev 826)
@@ -2,7 +2,7 @@
rthread - description
-------------------
begin : Mon Aug 2 2004
- copyright : (C) 2004 by Thomas Friedrichsmeier
+ copyright : (C) 2004, 2006 by Thomas Friedrichsmeier
email : tfry at users.sourceforge.net
***************************************************************************/
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