From 371be1ed0f195ae5525cba106a7c1c40729b8380 Mon Sep 17 00:00:00 2001 From: Lukas Holecek Date: Wed, 26 Dec 2012 10:01:48 +0100 Subject: [PATCH] Output of print() is stdout --- src/clipboardclient.cpp | 2 +- src/include/client_server.h | 2 -- src/scriptable.cpp | 2 +- tests/test.sh | 2 +- 4 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/clipboardclient.cpp b/src/clipboardclient.cpp index 91ce2172a..f729c2556 100644 --- a/src/clipboardclient.cpp +++ b/src/clipboardclient.cpp @@ -74,7 +74,7 @@ void ClipboardClient::readyRead() } } - if (exitCode != CommandPrint && exitCode != CommandActivateWindow) + if (exitCode != CommandActivateWindow) exit(exitCode); } } diff --git a/src/include/client_server.h b/src/include/client_server.h index 90db6885a..b2e4c36d7 100644 --- a/src/include/client_server.h +++ b/src/include/client_server.h @@ -45,8 +45,6 @@ typedef enum { CommandError, /** Bad command syntax. */ CommandBadSyntax, - /** Print */ - CommandPrint, /** Activate window */ CommandActivateWindow } CommandStatus; diff --git a/src/scriptable.cpp b/src/scriptable.cpp index 11a2ccbc1..6f243925f 100644 --- a/src/scriptable.cpp +++ b/src/scriptable.cpp @@ -862,7 +862,7 @@ void Scriptable::print(const QScriptValue &value) bytes = value.toString().toLocal8Bit(); message = &bytes; } - sendMessage(*message, CommandPrint); + sendMessage(*message, CommandSuccess); } void Scriptable::abort() diff --git a/tests/test.sh b/tests/test.sh index feaa0caf2..e93c4e329 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -312,7 +312,7 @@ run importtab "$tmp" && ok || fail log "checking imported tab content" - assert "run eval 'for (i = 0; i < 1000; ++i) {tab(\"test2\");a=read(i);tab(\"test3\");b=read(i);if(str(a)!=str(b))break;};i'" 1000 && + assert "run eval 'for (i = 0; i < 1000; ++i) {tab(\"test2\");a=read(i);tab(\"test3\");b=read(i);if(str(a)!=str(b))break;}; print(i)'" 1000 && ok || fail TAB=test2