[Pkg-owncloud-commits] [owncloud-client] 145/484: SocketAPI: don't trim the command #3297

Sandro Knauß hefee-guest at moszumanska.debian.org
Wed Dec 16 00:37:31 UTC 2015


This is an automated email from the git hooks/post-receive script.

hefee-guest pushed a commit to branch master
in repository owncloud-client.

commit 39289a3164e645b2084ff01ca76af472650d6576
Author: Olivier Goffart <ogoffart at woboq.com>
Date:   Mon Oct 26 10:06:10 2015 +0100

    SocketAPI: don't trim the command #3297
---
 src/gui/socketapi.cpp | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/gui/socketapi.cpp b/src/gui/socketapi.cpp
index 5305d00..75190f7 100644
--- a/src/gui/socketapi.cpp
+++ b/src/gui/socketapi.cpp
@@ -164,14 +164,15 @@ void SocketApi::slotReadSocket()
     Q_ASSERT(socket);
 
     while(socket->canReadLine()) {
-        QString line = QString::fromUtf8(socket->readLine()).trimmed();
-        QString command = line.split(":").first();
+        QString line = QString::fromUtf8(socket->readLine());
+        line.chop(1); // remove the '\n'
+        QString command = line.split(":").value(0);
         QString function = QString(QLatin1String("command_")).append(command);
 
         QString functionWithArguments = function + QLatin1String("(QString,QIODevice*)");
         int indexOfMethod = this->metaObject()->indexOfMethod(functionWithArguments.toAscii());
 
-        QString argument = line.remove(0, command.length()+1).trimmed();
+        QString argument = line.remove(0, command.length()+1);
         if(indexOfMethod != -1) {
             QMetaObject::invokeMethod(this, function.toAscii(), Q_ARG(QString, argument), Q_ARG(QIODevice*, socket));
         } else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud-client.git



More information about the Pkg-owncloud-commits mailing list