[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    playground/utils/kdelirc
From:       Michael Zanetti <michael_zanetti () gmx ! net>
Date:       2008-12-02 12:19:19
Message-ID: 1228220359.680013.8313.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 891513 by mzanetti:

replaced single-char QStrings with QChars



 M  +5 -5      irkick/irkick.cpp  
 M  +3 -3      irkick/klircclient.cpp  
 M  +6 -6      kcmlirc/addaction.cpp  
 M  +7 -7      kcmlirc/editaction.cpp  
 M  +1 -1      kdelirc/prototype.cpp  


--- trunk/playground/utils/kdelirc/irkick/irkick.cpp #891512:891513
@@ -226,7 +226,7 @@
 			// go through all the (ordered) window pids
 			for(int i = 0; i < s.size(); i++) {
 				int p = KWindowSystem::windowInfo(s.at(i),NET::WMPid).win();
-				QString id = action.program() + "-" + QString().setNum(p);
+				QString id = action.program() + '-' + QString().setNum(p);
 				if(programs.contains(id))
 				{	programs.clear();
 					programs += id;
@@ -240,7 +240,7 @@
 			// go through all the (ordered) window pids
 			for(int i = 0; i < s.size(); ++i) {
 				int p = KWindowSystem::windowInfo(s.at(i),NET::WMPid).win();
-				QString id = action.program() + "-" + QString().setNum(p);
+				QString id = action.program() + '-' + QString().setNum(p);
 				if(programs.contains(id)) {
 					programs.clear();
 					programs += id;
@@ -278,7 +278,7 @@
 			KToolInvocation::startServiceByDesktopName(sname);
 		} else if(action.program().contains(QRegExp("org.[a-zA-Z0-9]*."))){
 			QString runCommand = action.program();
-			runCommand.replace(QRegExp("org.[a-zA-Z0-9]*."), "");
+			runCommand.remove(QRegExp("org.[a-zA-Z0-9]*."));
 			kDebug() << "runCommand" << runCommand;
 			KToolInvocation::startServiceByDesktopName(runCommand);
 		}
@@ -291,9 +291,9 @@
 	{	const QString &program = *i;
 		kDebug() << "Searching DBus for program:" << program;
 		if(dBusIface->isServiceRegistered(program)){
-			kDebug() << "Sending data (" << program << ", " << "/" + action.object() << ", " \
<< action.method().prototypeNR() ; +			kDebug() << "Sending data (" << program << ", \
" << '/' + action.object() << ", " << action.method().prototypeNR() ;  
-			QDBusMessage m = QDBusMessage::createMethodCall(program, "/" + action.object(), \
"", action.method().prototypeNR()); +			QDBusMessage m = \
QDBusMessage::createMethodCall(program, '/' + action.object(), "", \
action.method().prototypeNR());  
 			for(Arguments::const_iterator j = action.arguments().begin(); j != \
action.arguments().end(); ++j) {  kDebug() << "Got argument:" << (*j).type() ;
--- trunk/playground/utils/kdelirc/irkick/klircclient.cpp #891512:891513
@@ -162,7 +162,7 @@
 					// <code> <name>
 					QString btn = readLine().mid(17);
 					if(btn.isNull()) break;
-					if(btn.startsWith("'") && btn.endsWith("'"))
+					if(btn.startsWith('\'') && btn.endsWith('\''))
 						btn = btn.mid(1, btn.length() - 2);
 					buttons.append(btn);
 				}
@@ -188,7 +188,7 @@
 			pos = line.indexOf(' ');
 			if (pos < 0) return;
 			QString btn = line.left(pos);
-			if(btn.startsWith("'") && btn.endsWith("'"))
+			if(btn.startsWith('\'') && btn.endsWith('\''))
 				btn = btn.mid(1, btn.length() - 2);
 			line.remove(0, pos + 1);
 			kDebug() << "Command received!";
@@ -230,7 +230,7 @@
 
 void KLircClient::sendCommand(const QString &command)
 {
-    QByteArray cmd = QFile::encodeName( command + "\n" );;
+    QByteArray cmd = QFile::encodeName( command + '\n' );;
     theSocket->write( cmd );
 }
 
--- trunk/playground/utils/kdelirc/kcmlirc/addaction.cpp #891512:891513
@@ -280,8 +280,8 @@
 
 const QStringList AddAction::getFunctions(const QString app, const QString obj)
 {
-	kDebug() << "creating Interface with: " << app << "/" + obj << \
                "org.freedesktop.DBus.Introspectable";
-	QDBusInterface *dBusIface = new QDBusInterface(app, "/" + obj, \
"org.freedesktop.DBus.Introspectable"); +	kDebug() << "creating Interface with: " << \
app << '/' + obj << "org.freedesktop.DBus.Introspectable"; +	QDBusInterface \
*dBusIface = new QDBusInterface(app, '/' + obj, \
"org.freedesktop.DBus.Introspectable");  QDBusReply<QString> response = \
dBusIface->call("Introspect");  
 	kDebug() << response;
@@ -306,7 +306,7 @@
 				if(subChild.tagName() == QLatin1String("method")){
 					QString method = subChild.attribute(QLatin1String("name"));
 					kDebug() << "Method: " << method;
-					function = "QString " + method + "(";
+					function = "QString " + method + '(';
 					QDomElement arg = subChild.firstChildElement();
 					QString argStr;
 					while(!arg.isNull()){
@@ -334,19 +334,19 @@
 									QString helper = arg.attribute("name");
 									arg = arg.nextSiblingElement();
 									argStr += arg.attribute(QLatin1String("value"));
-									argStr += " " + helper;
+									argStr += ' ' + helper;
 									arg = arg.nextSiblingElement();
 									continue;
 								} else {
 									argStr += arg.attribute(QLatin1String("type"));
 								}
-								argStr += " " + arg.attribute(QLatin1String("name"));
+								argStr += ' ' + arg.attribute(QLatin1String("name"));
 								kDebug() << "Arg: " << argStr;
 							}
 						}
 						arg = arg.nextSiblingElement();
 					}
-					function +=  argStr + ")";
+					function +=  argStr + ')';
 					ret += function;
 				}
 				subChild = subChild.nextSiblingElement();
--- trunk/playground/utils/kdelirc/kcmlirc/editaction.cpp #891512:891513
@@ -169,7 +169,7 @@
 		}
 		theArguments->setEnabled(p.count());
 		for(int i = 0; i < p.count(); i++)
-		{	theArguments->addItem(p[i].comment() + " (" + p[i].type() + ")");
+		{	theArguments->addItem(p[i].comment() + " (" + p[i].type() + ')');
 			arguments[i].convert(QVariant::nameToType(p[i].type().toLocal8Bit()));
 		}
 		if(p.count()) updateArgument(0); else updateArgument(-1);
@@ -185,7 +185,7 @@
 		}
 		theArguments->setEnabled(p.count());
 		for(int i = 0; i < p.count(); i++)
-		{	theArguments->addItem(QString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? \
p.type(i) : p.name(i) + " (" + p.type(i) + ")")); \
+		{	theArguments->addItem(QString().setNum(i + 1) + ": " + (p.name(i).isEmpty() ? \
p.type(i) : p.name(i) + " (" + p.type(i) + ')'));  \
arguments[i].convert(QVariant::nameToType(p.type(i).toLocal8Bit()));  }
 		if(p.count()) updateArgument(0); else updateArgument(-1);
@@ -392,7 +392,7 @@
 {
 	theDCOPFunctions->clear();
 
- 	QDBusInterface *dBusIface = new \
QDBusInterface(nameProgramMap[theDCOPApplications->currentText()], "/" + \
theDCOPObjects->currentText(), "org.freedesktop.DBus.Introspectable"); + \
QDBusInterface *dBusIface = new \
QDBusInterface(nameProgramMap[theDCOPApplications->currentText()], '/' + \
theDCOPObjects->currentText(), "org.freedesktop.DBus.Introspectable");  \
QDBusReply<QString> response = dBusIface->call("Introspect");  
 	QDomDocument domDoc;
@@ -415,7 +415,7 @@
 				if(subChild.tagName() == QLatin1String("method")){
 					QString method = subChild.attribute(QLatin1String("name"));
 					kDebug() << "Method: " << method;
-					function = "QString " + method + "(";
+					function = "QString " + method + '(';
 					QDomElement arg = subChild.firstChildElement();
 					QString argStr;
 					while(!arg.isNull()){
@@ -443,19 +443,19 @@
 									QString helper = arg.attribute("name");
 									arg = arg.nextSiblingElement();
 									argStr += arg.attribute(QLatin1String("value"));
-									argStr += " " + helper;
+									argStr += ' ' + helper;
 									arg = arg.nextSiblingElement();
 									continue;
 								} else {
 									argStr += arg.attribute(QLatin1String("type"));
 								}
-								argStr += " " + arg.attribute(QLatin1String("name"));
+								argStr += ' ' + arg.attribute(QLatin1String("name"));
 								kDebug() << "Arg: " << argStr;
 							}
 						}
 						arg = arg.nextSiblingElement();
 					}
-					function +=  argStr + ")";
+					function +=  argStr + ')';
 					theDCOPFunctions->addItem(function);
 				}
 				subChild = subChild.nextSiblingElement();
--- trunk/playground/utils/kdelirc/kdelirc/prototype.cpp #891512:891513
@@ -33,7 +33,7 @@
 {
 	QString ret = "";
 	for(int i = 0; i < theTypes.count(); i++)
-		ret += (i ? ", " : "") + theTypes[i] + " " + theNames[i];
+		ret += (i ? ", " : "") + theTypes[i] + ' ' + theNames[i];
 	return ret;
 }
 


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic