[rkward-cvs] SF.net SVN: rkward: [1046] trunk/rkward/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Tue Jan 2 13:40:22 UTC 2007
Revision: 1046
http://svn.sourceforge.net/rkward/?rev=1046&view=rev
Author: tfry
Date: 2007-01-02 05:40:21 -0800 (Tue, 02 Jan 2007)
Log Message:
-----------
krazy fixes
Modified Paths:
--------------
trunk/rkward/rkward/rkconsole.cpp
trunk/rkward/rkward/rkconsole.h
trunk/rkward/rkward/rkward.cpp
trunk/rkward/rkward/robjectviewer.cpp
Modified: trunk/rkward/rkward/rkconsole.cpp
===================================================================
--- trunk/rkward/rkward/rkconsole.cpp 2007-01-02 13:24:57 UTC (rev 1045)
+++ trunk/rkward/rkward/rkconsole.cpp 2007-01-02 13:40:21 UTC (rev 1046)
@@ -184,12 +184,12 @@
if (para < doc->numLines() - 1 || pos < prefix.length ()){
int t=(int)pos;if(prefix.length()>pos) t=prefix.length();
view->setCursorPosition (doc->numLines() -1, t);
- return(TRUE);
+ return(true);
}
if (current_command) {
e->ignore ();
- return TRUE;
+ return true;
}
if (hasSelectedText()
@@ -199,7 +199,7 @@
copy();
}
- return TRUE;
+ return true;
}
if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) {
@@ -212,14 +212,14 @@
pos=selectionInterfaceExt(doc)->selEndCol (); //There is already a selection, we take it into account.
selectionInterface(doc)->setSelection(doc->numLines()-1,prefix.length (),doc->numLines()-1, pos);
cursorAtTheBeginning ();
- return TRUE;
+ return true;
}
else if (e->state () == Qt::ShiftButton && e->key () == Qt::Key_Left){
if(pos<=prefix.length ()){
- return TRUE;
+ return true;
} else {
view->shiftCursorLeft ();
- return FALSE;
+ return false;
}
}
else if (e->key () == Qt::Key_Up) {
@@ -232,34 +232,34 @@
}
else if (e->key () == Qt::Key_Left){
if(pos<=prefix.length ()){
- return TRUE;
+ return true;
} else {
view->cursorLeft();
- return TRUE;
+ return true;
}
}
else if (e->key () == Qt::Key_Backspace){
if(pos<=prefix.length ()){
- return TRUE;
+ return true;
} else {
view->backspace();
- return TRUE;
+ return true;
}
}
else if (e->key () == Qt::Key_Tab){
doTabCompletion ();
- return TRUE;
+ return true;
}
else if (e->key () == Qt::Key_Home){
cursorAtTheBeginning ();
- return TRUE;
+ return true;
}
else if (e->key() == Qt::Key_Delete) {
view->keyDelete();
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
bool RKConsole::provideContext (unsigned int line_rev, QString *context, int *cursor_position) {
@@ -362,7 +362,7 @@
return (doc->textLine (doc->numLines () - 1).mid (prefix.length ()));
}
-void RKConsole::setCurrentCommand (QString command) {
+void RKConsole::setCurrentCommand (const QString &command) {
RK_TRACE (APP);
editInterface(doc)->removeText (doc->numLines() - 1, 0, doc->numLines() - 1, editInterface(doc)->textLine(doc->numLines() - 1).length());
editInterface(doc)->insertText (doc->numLines() - 1, 0, prefix + command);
@@ -389,7 +389,7 @@
addCommandToHistory (current_line);
if (command_incomplete) {
- command.prepend (incomplete_command + "\n");
+ command.prepend (incomplete_command + '\n');
}
doc->insertText (doc->numLines () - 1, editInterface (doc)->lineLength (doc->numLines () -1), "\n");
@@ -456,7 +456,7 @@
uint c = (uint) doc->numLines();
// TODO: WORKAROUND: Somehow, when removing paragraph 0, the QTextEdit scrolls to the top in between (yes, this also happens when using removeParagaph (0)). Since this may happen very often in newOutput, we're a bit sloppy, and only remove lines after a certain threshold (20) is exceeded. When the command is finished, this will be cleaned up automatically.
if (c > (RKSettingsModuleConsole::maxConsoleLines () + 20)) {
- view->setUpdatesEnabled (false); // major performace boost while removing lines!
+ view->setUpdatesEnabled (false); // major performance boost while removing lines!
//TODO : deal with the case when there is already a selection
selectionInterface (doc)->setSelection (0, 0, c - RKSettingsModuleConsole::maxConsoleLines (), 0);
selectionInterface (doc)->removeSelectedText ();
@@ -467,7 +467,7 @@
output_continuation = true;
}
-void RKConsole::submitBatch (QString batch) {
+void RKConsole::submitBatch (const QString &batch) {
RK_TRACE (APP);
// splitting batch, not allowing empty entries.
// TODO: hack something so we can have empty entries.
@@ -486,7 +486,7 @@
}
setUpdatesEnabled (true);
}
- editInterface(doc)->insertText (doc->numLines ()-1, 0, prefix); // somehow, it seems to be safer to do this after removing superflous lines, than before
+ editInterface(doc)->insertText (doc->numLines ()-1, 0, prefix); // somehow, it seems to be safer to do this after removing superfluous lines, than before
cursorAtTheEnd ();
}
@@ -554,7 +554,7 @@
return (selectionInterface (doc)->hasSelection ());
}
-void RKConsole::unplugAction(QString action, KActionCollection* ac) {
+void RKConsole::unplugAction(const QString &action, KActionCollection* ac) {
KAction* a = ac->action(action.latin1 ());
if( a ){
a->setEnabled(false);
@@ -639,7 +639,7 @@
} else {
QString text = command->command ();
text.replace ("\n", QString ("\n") + iprefix);
- doc->insertText (doc->numLines () - 1, QString (nprefix).length (), text + "\n");
+ doc->insertText (doc->numLines () - 1, QString (nprefix).length (), text + '\n');
command->addReceiver (this);
command->addTypeFlag (RCommand::Console);
current_command = command;
Modified: trunk/rkward/rkward/rkconsole.h
===================================================================
--- trunk/rkward/rkward/rkconsole.h 2007-01-02 13:24:57 UTC (rev 1045)
+++ trunk/rkward/rkward/rkconsole.h 2007-01-02 13:40:21 UTC (rev 1046)
@@ -56,7 +56,7 @@
/** Submits a batch of commands, line by line.
\param batch a QString containing the batch of commands to be executed */
- void submitBatch (QString batch);
+ void submitBatch (const QString &batch);
/** Returns the command currently being edited (not executed yet) */
QString currentCommand ();
/** Returns the current cursor position. Returns the column on which is the cursor. */
@@ -114,7 +114,7 @@
void cursorAtTheBeginning ();
/** Sets the current command. This is used from commandsListUp (), and commandsListDown ();
\param command the new command */
- void setCurrentCommand (QString command);
+ void setCurrentCommand (const QString &command);
/** Add a new line, and try to submit the next item in a batch of (pasted) commands. If there is no batch, only add the new line. */
void tryNextInBatch (bool add_new_line = true);
/** Add given command to command history. Also checks, wether the history is longer than max length, and chops it if so. */
@@ -128,7 +128,7 @@
/** This function unplugs a KAction
\param action the KAction to be unplugged
\param ac the action collection from which to retrieve the KAction*/
- void unplugAction (QString action, KActionCollection* ac);
+ void unplugAction (const QString &action, KActionCollection* ac);
bool output_continuation;
Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp 2007-01-02 13:24:57 UTC (rev 1045)
+++ trunk/rkward/rkward/rkward.cpp 2007-01-02 13:40:21 UTC (rev 1046)
@@ -427,7 +427,7 @@
// do this last, since we may be setting some different config-group(s) in the process
RKSettings::loadSettings (config);
- // explicitely hide the KMdiTaskBar. It could get in the way (and not quite sure, why it shows up on some systems)
+ // explicitly hide the KMdiTaskBar. It could get in the way (and not quite sure, why it shows up on some systems)
KToolBar *mditask = (KToolBar*) child ("KMdiTaskBar", "KToolBar");
if (mditask) mditask->hide ();
}
Modified: trunk/rkward/rkward/robjectviewer.cpp
===================================================================
--- trunk/rkward/rkward/robjectviewer.cpp 2007-01-02 13:24:57 UTC (rev 1045)
+++ trunk/rkward/rkward/robjectviewer.cpp 2007-01-02 13:40:21 UTC (rev 1046)
@@ -55,7 +55,7 @@
}
view_area->append (i18n("\nResult of 'print (") + object->getFullName () + i18n(")':\n"));
- RCommand *command = new RCommand ("print (" + object->getFullName () + ")", RCommand::App, QString::null, this);
+ RCommand *command = new RCommand ("print (" + object->getFullName () + ')', RCommand::App, QString::null, this);
RKGlobals::rInterface ()->issueCommand (command, 0);
caption = i18n("Object Viewer: ") + object->getShortName ();
@@ -72,7 +72,7 @@
view_area->append (command->output ());
if (command->hasError ()) {
- view_area->append (i18n("\nSome errors occured: ") + command->error ());
+ view_area->append (i18n("\nSome errors occurred: ") + command->error ());
}
}
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