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

List:       kde-commits
Subject:    kdepim/certmanager/lib/backends/qgpgme
From:       Marc Mutz <Marc.Mutz () uni-bielefeld ! de>
Date:       2004-05-05 11:39:18
Message-ID: 20040505113918.EEFCD9A8B () office ! kde ! org
[Download RAW message or body]

CVS commit by mutz: 

Sopport for more tokens. Don't return QString::null on unknonw tokens, but the token \
itself, since for some operations, it's a filename.


  M +30 -2     qgpgmeprogresstokenmapper.cpp   1.2
  M +1 -0      qgpgmeprogresstokenmapper.h   1.2


--- kdepim/certmanager/lib/backends/qgpgme/qgpgmeprogresstokenmapper.cpp  #1.1:1.2
@@ -51,4 +51,12 @@ struct Desc {
 };
 
+static const struct Desc pk_dsa[] = {
+  { 0, I18N_NOOP("Generating DSA key..."), false, false }
+};
+
+static const struct Desc pk_elg[] = {
+  { 0, I18N_NOOP("Generating ElGamal key..."), false, false }
+};
+
 static const struct Desc primegen[] = {
   // FIXME: add all type's?
@@ -56,4 +64,12 @@ static const struct Desc primegen[] = {
 };
 
+static const struct Desc need_entropy[] = {
+  { 0, I18N_NOOP("Waiting for new entropy from random number generator (you might \
want to excercise the harddisks or move the mouse)..."), false, false } +};
+
+static const struct Desc tick[] = {
+  { 0, I18N_NOOP("Please wait..."), false, false }
+};
+
 static const struct Desc starting_agent[] = {
   { 0, I18N_NOOP("Starting gpg-agent (you should consider starting a global instance \
instead)..."), false, false } @@ -66,5 +82,9 @@ static const struct {
 } tokens[] = {
 #define make_token(x) { #x, x, sizeof(x) / sizeof(*x) }
+  make_token(pk_dsa),
+  make_token(pk_elg),
   make_token(primegen),
+  make_token(need_entropy),
+  make_token(tick),
   make_token(starting_agent)
 #undef make_token
@@ -105,4 +125,11 @@ static const Map & makeMap() { // return
 }
 
+QString Kleo::QGpgMEProgressTokenMapper::map( const char * tokenUtf8, int subtoken, \
int cur, int tot ) const { +  if ( !tokenUtf8 || !*tokenUtf8 )
+    return QString::null;
+
+  return map( QString::fromUtf8( tokenUtf8 ), subtoken, cur, tot );
+}
+
 QString Kleo::QGpgMEProgressTokenMapper::map( const QString & token, int subtoken, \
int cur, int tot ) const {  static const Map & tokenMap = makeMap();
@@ -109,10 +137,10 @@ QString Kleo::QGpgMEProgressTokenMapper:
   const Map::const_iterator it1 = tokenMap.find( token.lower() );
   if ( it1 == tokenMap.end() )
-    return QString::null;
+    return token;
   std::map<int,Desc>::const_iterator it2 = it1->second.find( subtoken );
   if ( it2 == it1->second.end() )
     it2 = it1->second.find( 0 );
   if ( it2 == it1->second.end() )
-    return QString::null;
+    return token;
   const Desc & desc = it2->second;
   QString result = i18n( desc.display );

--- kdepim/certmanager/lib/backends/qgpgme/qgpgmeprogresstokenmapper.h  #1.1:1.2
@@ -46,4 +46,5 @@ namespace Kleo {
     static const QGpgMEProgressTokenMapper * instance();
 
+    QString map( const char * token, int subtoken, int current, int total ) const;
     QString map( const QString & token, int subtoken, int current, int total ) \
const;  


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

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