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

x2go pushed a commit to branch feature/libssh-api-upgrade
in repository x2goclient.

commit b1e826edfef57650de4ccbe48d2967a15ed0587b
Author: Mihai Moldovan <io...@ionic.de>
Date:   Sat Jan 28 18:34:46 2017 +0100

    src/sshmasterconnection.cpp: use QString::arg () to insert function name 
and thus deduplicate error translation messages.
    
    Also re-add the full stop sign and remove it when needed for x2goDebug.
---
 debian/changelog            |    3 +++
 src/sshmasterconnection.cpp |   31 ++++++++++++++++---------------
 2 files changed, 19 insertions(+), 15 deletions(-)

diff --git a/debian/changelog b/debian/changelog
index cc91bbc..2b3098f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -606,6 +606,9 @@ x2goclient (4.1.0.0-0x2go1) UNRELEASED; urgency=medium
     - src/sshmasterconnection.cpp: replace deprecated channel_free () function
       with ssh_channel_free (). Might break on ancient systems, but we don't
       care.
+    - src/sshmasterconnection.cpp: use QString::arg () to insert function name
+      and thus deduplicate error translation messages. Also re-add the full
+      stop sign and remove it when needed for x2goDebug.
 
   [ Bernard Cafarelli ]
   * New upstream version (4.1.0.0):
diff --git a/src/sshmasterconnection.cpp b/src/sshmasterconnection.cpp
index 21ab275..6469cd7 100644
--- a/src/sshmasterconnection.cpp
+++ b/src/sshmasterconnection.cpp
@@ -1559,11 +1559,12 @@ void SshMasterConnection::channelLoop()
 
                 if (!channel) {
                     QString err = ssh_get_error (my_ssh_session);
-                    QString error_msg = tr ("ssh_channel_new failed");
-                    emit ioErr (channelConnections[i].creator, error_msg + 
".", err);
+                    /*: Argument in this context will be a function name. */
+                    QString error_msg = tr ("%1 failed.").arg 
("ssh_channel_new");
+                    emit ioErr (channelConnections[i].creator, error_msg, err);
 
 #ifdef DEBUG
-                    x2goDebug << errorMsg << ": " << err << endl;
+                    x2goDebug << error_msg.left (error_msg.size () - 1) << ": 
" << err << endl;
 #endif
 
                     continue;
@@ -1584,10 +1585,10 @@ void SshMasterConnection::channelLoop()
                                                     channelConnections.at ( i 
).localPort ) != SSH_OK )
                     {
                         QString err=ssh_get_error ( my_ssh_session );
-                        QString errorMsg=tr ( "ssh_channel_open_forward 
failed" );
-                        emit ioErr ( channelConnections[i].creator, errorMsg + 
".", err );
+                        QString errorMsg=tr ( "%1 failed." ).arg 
("ssh_channel_open_forward");
+                        emit ioErr ( channelConnections[i].creator, errorMsg, 
err );
 #ifdef DEBUG
-                        x2goDebug<<errorMsg<<": "<<err<<endl;
+                        x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": 
"<<err<<endl;
 #endif
                     }
 #ifdef DEBUG
@@ -1605,19 +1606,19 @@ void SshMasterConnection::channelLoop()
                     if ( ssh_channel_open_session ( channel ) !=SSH_OK )
                     {
                         QString err=ssh_get_error ( my_ssh_session );
-                        QString errorMsg=tr ( "ssh_channel_open_session 
failed" );
-                        emit ioErr ( channelConnections[i].creator, errorMsg + 
".", err );
+                        QString errorMsg=tr ( "%1 failed." ).arg 
("ssh_channel_open_session");
+                        emit ioErr ( channelConnections[i].creator, errorMsg, 
err );
 #ifdef DEBUG
-                        x2goDebug<<errorMsg<<": "<<err<<endl;
+                        x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": 
"<<err<<endl;
 #endif
                     }
                     else if ( ssh_channel_request_exec ( channel, 
channelConnections[i].command.toLatin1() ) != SSH_OK )
                     {
                         QString err=ssh_get_error ( my_ssh_session );
-                        QString errorMsg=tr ( "ssh_channel_request_exec 
failed" );
-                        emit ioErr ( channelConnections[i].creator, errorMsg + 
".", err );
+                        QString errorMsg=tr ( "%1 failed." ).arg 
("ssh_channel_request_exec");
+                        emit ioErr ( channelConnections[i].creator, errorMsg, 
err );
 #ifdef DEBUG
-                        x2goDebug<<errorMsg<<": "<<err<<endl;
+                        x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": 
"<<err<<endl;
 #endif
                     }
 #ifdef DEBUG
@@ -1749,10 +1750,10 @@ void SshMasterConnection::channelLoop()
                     if ( ssh_channel_write ( channel, buffer, nbytes ) 
!=nbytes )
                     {
                         QString err=ssh_get_error ( my_ssh_session );
-                        QString errorMsg=tr ( "ssh_channel_write failed" );
-                        emit ioErr ( channelConnections[i].creator, errorMsg + 
".", err );
+                        QString errorMsg=tr ( "%1 failed." ).arg 
("ssh_channel_write");
+                        emit ioErr ( channelConnections[i].creator, errorMsg, 
err );
 #ifdef DEBUG
-                        x2goDebug<<errorMsg<<": "<<err<<endl;
+                        x2goDebug<<errorMsg.left (errorMsg.size () - 1)<<": 
"<<err<<endl;
 #endif
                         finalize ( i );
                         continue;

--
Alioth's /srv/git/code.x2go.org/x2goclient.git//..//_hooks_/post-receive-email 
on /srv/git/code.x2go.org/x2goclient.git
_______________________________________________
x2go-commits mailing list
x2go-commits@lists.x2go.org
http://lists.x2go.org/listinfo/x2go-commits

Reply via email to