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

List:       kde-commits
Subject:    aegypten_branch: kdepim/certmanager/lib/backends/qgpgme
From:       David Faure <faure () kde ! org>
Date:       2004-03-31 22:24:57
Message-ID: 20040331222457.680D799CD () office ! kde ! org
[Download RAW message or body]

CVS commit by faure: 

Use utf8 when speaking to gpgconf and when gpgconf speaks to us (Aegypten issue 130).


  M +7 -6      qgpgmecryptoconfig.cpp   1.16.2.7


--- kdepim/certmanager/lib/backends/qgpgme/qgpgmecryptoconfig.cpp  #1.16.2.6:1.16.2.7
@@ -42,4 +42,5 @@
 #include <qfile.h>
 #include <stdlib.h>
+#include <qtextcodec.h>
 
 // Just for the Q_ASSERT in the dtor. Not thread-safe, but who would
@@ -71,5 +72,5 @@ void QGpgMECryptoConfig::runGpgConf( boo
   // Run gpgconf --list-components to make the list of components
 
-  KProcIO proc;
+  KProcIO proc( QTextCodec::codecForName( "utf8" ) );
   proc << "gpgconf"; // must be in the PATH
   proc << "--list-components";
@@ -160,5 +161,5 @@ void QGpgMECryptoConfigComponent::runGpg
   // Run gpgconf --list-options <component>, and create all groups and entries for \
that component  
-  KProcIO proc;
+  KProcIO proc( QTextCodec::codecForName( "utf8" ) );
   proc << "gpgconf"; // must be in the PATH
   proc << "--list-options";
@@ -259,5 +260,5 @@ void QGpgMECryptoConfigComponent::sync( 
         }
         line += '\n';
-        QCString line8bit = line.latin1(); // latin1 is correct here, it's all \
escaped (and KProcIO uses latin1 when reading). +        QCString line8bit = \
                line.utf8(); // encode with utf8, and KProcIO uses utf8 when reading.
         tmpFile.file()->writeBlock( line8bit.data(), line8bit.size()-1 /*no 0*/ );
         dirtyEntries.append( it.current() );
@@ -295,5 +296,5 @@ void QGpgMECryptoConfigComponent::sync( 
   if ( rc == -1 )
   {
-    QString wmsg = i18n( "Couldn't start gpgconf\nCheck that gpgconf is in the PATH \
and that it can be started" ); +    QString wmsg = i18n( "Could not start \
gpgconf\nCheck that gpgconf is in the PATH and that it can be started" );  \
kdWarning(5150) << wmsg << endl;  KMessageBox::error(0, wmsg);
@@ -343,5 +344,5 @@ static QString gpgconf_unescape( const Q
 {
   // Looks like it's the same rules as KURL.
-  return KURL::decode_string( str );
+  return KURL::decode_string( str, 106 );
 }
 
@@ -349,5 +350,5 @@ static QString gpgconf_escape( const QSt
 {
   // Escape special chars (including ':' and '%')
-  QString enc = KURL::encode_string( str );
+  QString enc = KURL::encode_string( str, 106 ); // and convert to utf8 first (to \
get %12%34 for one special char)  // Also encode commas, for lists.
   enc.replace( ',', "%2c" );


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

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