[rkward-cvs] rkward/rkward/plugin rkcheckbox.cpp,1.5,1.6 rkcomponentmap.cpp,1.3,1.4 rkformula.cpp,1.7,1.8 rkinput.cpp,1.4,1.5 rknote.cpp,1.2,1.3 rkplugin.cpp,1.17,1.18 rkpluginbrowser.cpp,1.4,1.5 rkpluginspinbox.cpp,1.6,1.7 rkpluginwidget.cpp,1.5,1.6 rkradio.cpp,1.5,1.6 rktext.cpp,1.2,1.3 rkvarselector.cpp,1.12,1.13 rkvarslot.cpp,1.12,1.13

Thomas Friedrichsmeier tfry at users.sourceforge.net
Thu Sep 29 16:02:53 UTC 2005


Update of /cvsroot/rkward/rkward/rkward/plugin
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6449/rkward/plugin

Modified Files:
	rkcheckbox.cpp rkcomponentmap.cpp rkformula.cpp rkinput.cpp 
	rknote.cpp rkplugin.cpp rkpluginbrowser.cpp 
	rkpluginspinbox.cpp rkpluginwidget.cpp rkradio.cpp rktext.cpp 
	rkvarselector.cpp rkvarslot.cpp 
Log Message:
Code cleanups, focus: replacing "" with QString::null / QString.isEmpty (). Fix credits

Index: rkpluginwidget.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkpluginwidget.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkpluginwidget.cpp	29 Sep 2005 13:24:48 -0000	1.5
--- rkpluginwidget.cpp	29 Sep 2005 16:02:51 -0000	1.6
***************
*** 36,45 ****
  QString RKPluginWidget::complaints () {
  	RK_TRACE (PLUGIN);
! 	return "";
  }
  
  QString RKPluginWidget::value (const QString &) {
  	RK_TRACE (PLUGIN);
! 	return "";
  }
  
--- 36,45 ----
  QString RKPluginWidget::complaints () {
  	RK_TRACE (PLUGIN);
! 	return QString::null;
  }
  
  QString RKPluginWidget::value (const QString &) {
  	RK_TRACE (PLUGIN);
! 	return QString::null;
  }
  

Index: rkradio.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkradio.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkradio.cpp	29 Sep 2005 13:24:48 -0000	1.5
--- rkradio.cpp	29 Sep 2005 16:02:51 -0000	1.6
***************
*** 34,38 ****
  	label = new QLabel (element.attribute ("label", "Select one:"), this);
  	vbox->addWidget (label);
! 	depend = element.attribute ("depend", "");
  
  	// create ButtonGroup
--- 34,38 ----
  	label = new QLabel (element.attribute ("label", "Select one:"), this);
  	vbox->addWidget (label);
! 	depend = element.attribute ("depend", QString::null);
  
  	// create ButtonGroup
***************
*** 83,87 ****
  	}
  
! 	return "";
  }
  
--- 83,87 ----
  	}
  
! 	return QString::null;
  }
  
***************
*** 136,138 ****
      else return false;
  
!  }
\ No newline at end of file
--- 136,138 ----
      else return false;
  
!  }

Index: rkformula.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkformula.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** rkformula.cpp	26 Mar 2005 10:32:17 -0000	1.7
--- rkformula.cpp	29 Sep 2005 16:02:51 -0000	1.8
***************
*** 39,43 ****
  	RK_TRACE (PLUGIN);
  	QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 	depend = element.attribute ("depend", "");
  	
  	type_selector = new QButtonGroup (this);
--- 39,43 ----
  	RK_TRACE (PLUGIN);
  	QVBoxLayout *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 	depend = element.attribute ("depend", QString::null);
  	
  	type_selector = new QButtonGroup (this);
***************
*** 140,144 ****
  	mangled_names.clear ();
  	RKVariable *dep_var = 0;
! 	QString table = "";
  	if (dependent->getNumVars()) {
  		dep_var = dependent->getVariables ().first ();
--- 140,144 ----
  	mangled_names.clear ();
  	RKVariable *dep_var = 0;
! 	QString table;
  	if (dependent->getNumVars()) {
  		dep_var = dependent->getVariables ().first ();
***************
*** 201,205 ****
  QString RKFormula::mangleName (RKVariable *var) {
  	RK_TRACE (PLUGIN);
! 	if (!var) return "";
  		
  	QString dummy = var->getShortName ();
--- 201,205 ----
  QString RKFormula::mangleName (RKVariable *var) {
  	RK_TRACE (PLUGIN);
! 	if (!var) return QString::null;
  		
  	QString dummy = var->getShortName ();
***************
*** 283,287 ****
  			dummy.append (interactions[i].vars[j]->getShortName ());
  		}
! 		QListViewItem *item = new QListViewItem (parent, "", dummy);
  		interaction_map.insert (item, interactions[i]);
  	}
--- 283,287 ----
  			dummy.append (interactions[i].vars[j]->getShortName ());
  		}
! 		QListViewItem *item = new QListViewItem (parent, QString::null, dummy);
  		interaction_map.insert (item, interactions[i]);
  	}

Index: rkvarselector.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkvarselector.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkvarselector.cpp	2 Apr 2005 08:48:10 -0000	1.12
--- rkvarselector.cpp	29 Sep 2005 16:02:51 -0000	1.13
***************
*** 34,38 ****
  	RKGlobals::rObjectList ()->updateFromR ();
  	QVBoxLayout  *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 	depend = element.attribute ("depend", "");
  	
  	label = new QLabel (element.attribute ("label", "Select Variable(s)"), this);
--- 34,38 ----
  	RKGlobals::rObjectList ()->updateFromR ();
  	QVBoxLayout  *vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
! 	depend = element.attribute ("depend", QString::null);
  	
  	label = new QLabel (element.attribute ("label", "Select Variable(s)"), this);

Index: rkinput.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkinput.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rkinput.cpp	29 Sep 2005 13:24:48 -0000	1.4
--- rkinput.cpp	29 Sep 2005 16:02:51 -0000	1.5
***************
*** 18,22 ****
  	vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
  	label = new QLabel (element.attribute ("label", "Enter your text"), this);
! 	QString initial = element.attribute ("initial","") ;
  	textedit = new QTextEdit ( initial ,
  	QString::null,this, element.attribute ("id")) ;
--- 18,22 ----
  	vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
  	label = new QLabel (element.attribute ("label", "Enter your text"), this);
! 	QString initial = element.attribute ("initial", QString::null) ;
  	textedit = new QTextEdit ( initial ,
  	QString::null,this, element.attribute ("id")) ;

Index: rkvarslot.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkvarslot.cpp,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** rkvarslot.cpp	29 Sep 2005 13:24:48 -0000	1.12
--- rkvarslot.cpp	29 Sep 2005 16:02:51 -0000	1.13
***************
*** 44,48 ****
  
  	
! 	select = new QPushButton ("", this);
  	select->setPixmap(SmallIcon("1rightarrow"));
  
--- 44,48 ----
  
  	
! 	select = new QPushButton (QString::null, this);
  	select->setPixmap(SmallIcon("1rightarrow"));
  
***************
*** 83,87 ****
  	// further infos
  	source_id = element.attribute ("source");
! 	depend = element.attribute ("depend", "");
  	classes = element.attribute ("classes", "all");
  	if (classes=="frame") classes = "data.frame matrix list array";
--- 83,87 ----
  	// further infos
  	source_id = element.attribute ("source");
! 	depend = element.attribute ("depend", QString::null);
  	classes = element.attribute ("classes", "all");
  	if (classes=="frame") classes = "data.frame matrix list array";
***************
*** 113,117 ****
  		if (num_vars) {
  			if (!source->containsObject (item_map[0])) {
! 				line_edit->setText ("");
  				item_map.remove (0);
  				num_vars = 0;
--- 113,117 ----
  		if (num_vars) {
  			if (!source->containsObject (item_map[0])) {
! 				line_edit->setText (QString::null);
  				item_map.remove (0);
  				num_vars = 0;
***************
*** 174,178 ****
  			if (source->numSelectedVars() == 1) {
  				RKVariable *sel = source->selectedVars ().first ();
! 				if (belongToClasses(sel->makeClassString(""))){
  					line_edit->setText (sel->getShortName ());
  					item_map.insert (0, sel);
--- 174,178 ----
  			if (source->numSelectedVars() == 1) {
  				RKVariable *sel = source->selectedVars ().first ();
! 				if (belongToClasses(sel->makeClassString (QString::null))){
  					line_edit->setText (sel->getShortName ());
  					item_map.insert (0, sel);
***************
*** 183,187 ****
  			}else if (source->numSelectedContainer() == 1 ){
  				RContainerObject *sel = source->selectedContainer().first ();
! 				if (belongToClasses(sel->makeClassString(""))){
  					line_edit->setText (sel->getShortName ());
  					cont_map.insert (0, sel);
--- 183,187 ----
  			}else if (source->numSelectedContainer() == 1 ){
  				RContainerObject *sel = source->selectedContainer().first ();
! 				if (belongToClasses(sel->makeClassString(QString::null))){
  					line_edit->setText (sel->getShortName ());
  					cont_map.insert (0, sel);
***************
*** 194,198 ****
  			
  		} else {
! 			line_edit->setText ("");
  			item_map.remove (0);
  			cont_map.remove (0);
--- 194,198 ----
  			
  		} else {
! 			line_edit->setText (QString::null);
  			item_map.remove (0);
  			cont_map.remove (0);
***************
*** 230,234 ****
  				}
  				if (dupli) duplicate = false ; 
! 				if (!duplicate && belongToClasses(sel->makeClassString(""))) {
  					QString string; 
          				string = string.setNum( ordre);  
--- 230,234 ----
  				}
  				if (dupli) duplicate = false ; 
! 				if (!duplicate && belongToClasses(sel->makeClassString(QString::null))) {
  					QString string; 
          				string = string.setNum( ordre);  
***************
*** 251,255 ****
  				}
  				if (dupli) duplicate = false ; 
! 				if (!duplicate && belongToClasses(selcont->makeClassString(""))) {
  					QString string; 
          				string = string.setNum( ordre);  
--- 251,255 ----
  				}
  				if (dupli) duplicate = false ; 
! 				if (!duplicate && belongToClasses(selcont->makeClassString(QString::null))) {
  					QString string; 
          				string = string.setNum( ordre);  
***************
*** 320,324 ****
  			}
  		} else {
! 			return "";
  		}
  	} else {
--- 320,324 ----
  			}
  		} else {
! 			return QString::null;
  		}
  	} else {
***************
*** 352,356 ****
  	RK_TRACE (PLUGIN);
  
! 	if (isSatisfied ()) return "";
  	return i18n (" - You have to select a variable for the \"" + label->text () + "\"-field\n");
  }
--- 352,356 ----
  	RK_TRACE (PLUGIN);
  
! 	if (isSatisfied ()) return QString::null;
  	return i18n (" - You have to select a variable for the \"" + label->text () + "\"-field\n");
  }

Index: rkcomponentmap.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcomponentmap.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** rkcomponentmap.cpp	11 Sep 2005 22:06:31 -0000	1.3
--- rkcomponentmap.cpp	29 Sep 2005 16:02:51 -0000	1.4
***************
*** 46,50 ****
  	if (xml->highestError () >= DL_ERROR) return (0);
  
! 	QString prefix = QFileInfo (plugin_map_file).dirPath (true) + "/" + xml->getStringAttribute(document_element, "base_prefix", "", DL_WARNING);
  	QString cnamespace = xml->getStringAttribute(document_element, "namespace", "rkward", DL_WARNING) + "::";
  
--- 46,50 ----
  	if (xml->highestError () >= DL_ERROR) return (0);
  
! 	QString prefix = QFileInfo (plugin_map_file).dirPath (true) + "/" + xml->getStringAttribute(document_element, "base_prefix", QString::null, DL_WARNING);
  	QString cnamespace = xml->getStringAttribute(document_element, "namespace", "rkward", DL_WARNING) + "::";
  
***************
*** 54,59 ****
  
  	for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
! 		QString filename = prefix + xml->getStringAttribute((*it), "file", "", DL_WARNING);
! 		QString id = cnamespace + xml->getStringAttribute((*it), "id", "", DL_WARNING);
  		int type = xml->getMultiChoiceAttribute ((*it), "type", "standard", 0, DL_WARNING);
  
--- 54,59 ----
  
  	for (XMLChildList::const_iterator it=list.begin (); it != list.end (); ++it) {
! 		QString filename = prefix + xml->getStringAttribute((*it), "file", QString::null, DL_WARNING);
! 		QString id = cnamespace + xml->getStringAttribute((*it), "id", QString::null, DL_WARNING);
  		int type = xml->getMultiChoiceAttribute ((*it), "type", "standard", 0, DL_WARNING);
  

Index: rkpluginspinbox.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkpluginspinbox.cpp,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** rkpluginspinbox.cpp	29 Sep 2005 13:24:48 -0000	1.6
--- rkpluginspinbox.cpp	29 Sep 2005 16:02:51 -0000	1.7
***************
*** 32,36 ****
  	label = new QLabel (element.attribute ("label", "Enter value:"), this);
  	vbox->addWidget (label);
! 	depend = element.attribute ("depend", "");
  
  	spinbox = new RKSpinBox (this);
--- 32,36 ----
  	label = new QLabel (element.attribute ("label", "Enter value:"), this);
  	vbox->addWidget (label);
! 	depend = element.attribute ("depend", QString::null);
  
  	spinbox = new RKSpinBox (this);

Index: rknote.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rknote.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rknote.cpp	29 Sep 2005 13:24:48 -0000	1.2
--- rknote.cpp	29 Sep 2005 16:02:51 -0000	1.3
***************
*** 24,28 ****
  	label = new QLabel (element.attribute ("label", "Select one:"), this);
  	vbox->addWidget (label);
! 	depend = element.attribute ("depend", "");
  
  
--- 24,28 ----
  	label = new QLabel (element.attribute ("label", "Select one:"), this);
  	vbox->addWidget (label);
! 	depend = element.attribute ("depend", QString::null);
  
  

Index: rkplugin.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkplugin.cpp,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** rkplugin.cpp	29 Sep 2005 13:24:48 -0000	1.17
--- rkplugin.cpp	29 Sep 2005 16:02:51 -0000	1.18
***************
*** 510,514 ****
  		changed ();
  	} else {
! 		RKGlobals::rInterface ()->issueCommand (new RCommand (current_code, RCommand::Plugin, "", this));
  		script_backend_chain = RKGlobals::rInterface ()->startChain ();
  		backend->printout (BACKEND_DONT_CARE);
--- 510,514 ----
  		changed ();
  	} else {
! 		RKGlobals::rInterface ()->issueCommand (new RCommand (current_code, RCommand::Plugin, QString::null, this));
  		script_backend_chain = RKGlobals::rInterface ()->startChain ();
  		backend->printout (BACKEND_DONT_CARE);
***************
*** 569,573 ****
  		backend->resetOutput ();
  	} else if (flags == BACKEND_FOR_SUBMISSION) {
! 		RKGlobals::rInterface ()->issueCommand (new RCommand (backend->retrieveOutput (), RCommand::Plugin | RCommand::DirectToOutput, "", this), script_backend_chain);
  		backend->resetOutput ();
  	}
--- 569,573 ----
  		backend->resetOutput ();
  	} else if (flags == BACKEND_FOR_SUBMISSION) {
! 		RKGlobals::rInterface ()->issueCommand (new RCommand (backend->retrieveOutput (), RCommand::Plugin | RCommand::DirectToOutput, QString::null, this), script_backend_chain);
  		backend->resetOutput ();
  	}
***************
*** 599,603 ****
  
  	if (should_updatecode) {
! 		current_code = "";
  		codeDisplay->setText ("Processing. Please wait.");
  		script_backend_chain = RKGlobals::rInterface ()->startChain ();
--- 599,603 ----
  
  	if (should_updatecode) {
! 		current_code = QString::null;
  		codeDisplay->setText ("Processing. Please wait.");
  		script_backend_chain = RKGlobals::rInterface ()->startChain ();
***************
*** 651,660 ****
  void RKPlugin::doRCall (const QString &call) {
  	RK_TRACE (PLUGIN);
! 	RKGlobals::rInterface ()->issueCommand (new RCommand (call, RCommand::Plugin | RCommand::PluginCom, "", this, R_FOR_PHP_FLAG), script_backend_chain);
  }
  
  void RKPlugin::getRVector (const QString &call) {
  	RK_TRACE (PLUGIN);
! 	RKGlobals::rInterface ()->issueCommand (new RCommand (call, RCommand::Plugin | RCommand::PluginCom | RCommand::GetStringVector, "", this, R_FOR_PHP_FLAG), script_backend_chain);
  }
  
--- 651,660 ----
  void RKPlugin::doRCall (const QString &call) {
  	RK_TRACE (PLUGIN);
! 	RKGlobals::rInterface ()->issueCommand (new RCommand (call, RCommand::Plugin | RCommand::PluginCom, QString::null, this, R_FOR_PHP_FLAG), script_backend_chain);
  }
  
  void RKPlugin::getRVector (const QString &call) {
  	RK_TRACE (PLUGIN);
! 	RKGlobals::rInterface ()->issueCommand (new RCommand (call, RCommand::Plugin | RCommand::PluginCom | RCommand::GetStringVector, QString::null, this, R_FOR_PHP_FLAG), script_backend_chain);
  }
  

Index: rkpluginbrowser.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkpluginbrowser.cpp,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** rkpluginbrowser.cpp	29 Sep 2005 13:24:48 -0000	1.4
--- rkpluginbrowser.cpp	29 Sep 2005 16:02:51 -0000	1.5
***************
*** 26,31 ****
  	vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
  	label = new QLabel (element.attribute ("label", "Enter your text"), this);
! 	textedit = new QTextEdit ( element.attribute ("initial" ,"") ,
! 	QString::null,this, element.attribute ("id")) ;
  	button = new QPushButton (i18n("Browse..."),this);
  //	size = element.attribute ("size", "small");
--- 26,30 ----
  	vbox = new QVBoxLayout (this, RKGlobals::spacingHint ());
  	label = new QLabel (element.attribute ("label", "Enter your text"), this);
! 	textedit = new QTextEdit ( element.attribute ("initial", QString::null), QString::null,this, element.attribute ("id")) ;
  	button = new QPushButton (i18n("Browse..."),this);
  //	size = element.attribute ("size", "small");
***************
*** 34,38 ****
  	vbox->addWidget (button);
  	type = element.attribute("type","file") ;
! 	filter = element.attribute("filter","") ;
  	connect(textedit,SIGNAL(textChanged()),SLOT(textChanged()));
  	connect(button,SIGNAL(clicked()),SLOT(slotPopingup()));
--- 33,37 ----
  	vbox->addWidget (button);
  	type = element.attribute("type","file") ;
! 	filter = element.attribute("filter", QString::null) ;
  	connect(textedit,SIGNAL(textChanged()),SLOT(textChanged()));
  	connect(button,SIGNAL(clicked()),SLOT(slotPopingup()));
***************
*** 97,101 ****
  	RK_TRACE (PLUGIN);
  	if (type == "file") {
! 		QString filename= KFileDialog:: getOpenFileName("",filter,0,"") ; 
  		textedit ->setText(filename);
  		emit(changed());}
--- 96,100 ----
  	RK_TRACE (PLUGIN);
  	if (type == "file") {
! 		QString filename= KFileDialog:: getOpenFileName(QString::null,filter,0, QString::null) ; 
  		textedit ->setText(filename);
  		emit(changed());}
***************
*** 105,109 ****
  		emit(changed());}
  	else if (type=="files"){
! 		QStringList filenames =KFileDialog:: getOpenFileNames("",filter,0,"") ; 
  		QString filename = filenames.join( "\n" );
  		textedit ->setText(filename);
--- 104,108 ----
  		emit(changed());}
  	else if (type=="files"){
! 		QStringList filenames =KFileDialog:: getOpenFileNames(QString::null,filter,0,QString::null);
  		QString filename = filenames.join( "\n" );
  		textedit ->setText(filename);

Index: rktext.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rktext.cpp,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** rktext.cpp	22 Sep 2004 14:06:10 -0000	1.2
--- rktext.cpp	29 Sep 2005 16:02:51 -0000	1.3
***************
*** 35,39 ****
  	for (unsigned int i=0; i < lines.count (); i++) {
  		QString line = lines[i].stripWhiteSpace ();
! 		if (line != "") {
  			text.append (line + "\n");
  		}
--- 35,39 ----
  	for (unsigned int i=0; i < lines.count (); i++) {
  		QString line = lines[i].stripWhiteSpace ();
! 		if (!line.isEmpty ()) {
  			text.append (line + "\n");
  		}

Index: rkcheckbox.cpp
===================================================================
RCS file: /cvsroot/rkward/rkward/rkward/plugin/rkcheckbox.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -C2 -d -r1.5 -r1.6
*** rkcheckbox.cpp	29 Sep 2005 13:24:48 -0000	1.5
--- rkcheckbox.cpp	29 Sep 2005 16:02:51 -0000	1.6
***************
*** 33,38 ****
    isOk =false;
  	value_if_checked = element.attribute ("value", "1");
! 	value_if_unchecked = element.attribute ("value_unchecked", "");
! 	depend = element.attribute ("depend", "");
  	
  	if (element.attribute ("checked") == "true") {
--- 33,38 ----
    isOk =false;
  	value_if_checked = element.attribute ("value", "1");
! 	value_if_unchecked = element.attribute ("value_unchecked", QString::null);
! 	depend = element.attribute ("depend", QString::null);
  	
  	if (element.attribute ("checked") == "true") {





More information about the rkward-tracker mailing list