Merge pull request #26 from teo/master

When returning OtherError on Mac, provide the Keychain OSStatus code and description as error string.
This commit is contained in:
Frank Osterfeld 2013-11-21 00:28:52 -08:00
commit 155178882a
2 changed files with 25 additions and 17 deletions

View File

@ -28,8 +28,10 @@ static QString strForStatus( OSStatus os ) {
const Releaser<CFStringRef> str( SecCopyErrorMessageString( os, 0 ) ); const Releaser<CFStringRef> str( SecCopyErrorMessageString( os, 0 ) );
const char * const buf = CFStringGetCStringPtr( str.value, kCFStringEncodingUTF8 ); const char * const buf = CFStringGetCStringPtr( str.value, kCFStringEncodingUTF8 );
if ( !buf ) if ( !buf )
return QString(); return QObject::tr( "%1 (OSStatus %2)" )
return QString::fromUtf8( buf, strlen( buf ) ); .arg( "OSX Keychain Error" ).arg( os );
return QObject::tr( "%1 (OSStatus %2)" )
.arg( QString::fromUtf8( buf, strlen( buf ) ) ).arg( os );
} }
static OSStatus readPw( QByteArray* pw, static OSStatus readPw( QByteArray* pw,

View File

@ -14,47 +14,47 @@
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="264"/> <location filename="../keychain_dbus.cpp" line="267"/>
<source>No keychain service available</source> <source>No keychain service available</source>
<translation>Kein Schlüsselbund-Dienst verfügbar</translation> <translation>Kein Schlüsselbund-Dienst verfügbar</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="266"/> <location filename="../keychain_dbus.cpp" line="269"/>
<source>Could not open wallet: %1; %2</source> <source>Could not open wallet: %1; %2</source>
<translation>Konnte Brieftasche nicht öffnen: %1; %2</translation> <translation>Konnte Brieftasche nicht öffnen: %1; %2</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="313"/> <location filename="../keychain_dbus.cpp" line="315"/>
<source>Access to keychain denied</source> <source>Access to keychain denied</source>
<translation>Zugriff auf Schlüsselbund verweigert</translation> <translation>Zugriff auf Schlüsselbund verweigert</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="334"/> <location filename="../keychain_dbus.cpp" line="336"/>
<source>Could not determine data type: %1; %2</source> <source>Could not determine data type: %1; %2</source>
<translation>Datentyp kann nicht ermittelt werden: %1: %2</translation> <translation>Datentyp kann nicht ermittelt werden: %1: %2</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="352"/> <location filename="../keychain_dbus.cpp" line="354"/>
<source>Unsupported entry type &apos;Map&apos;</source> <source>Unsupported entry type &apos;Map&apos;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="355"/> <location filename="../keychain_dbus.cpp" line="357"/>
<source>Unknown kwallet entry type &apos;%1&apos;</source> <source>Unknown kwallet entry type &apos;%1&apos;</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="370"/> <location filename="../keychain_dbus.cpp" line="372"/>
<source>Could not read password: %1; %2</source> <source>Could not read password: %1; %2</source>
<translation>Passwort konnte nicht ausgelesen werden: %1; %2</translation> <translation>Passwort konnte nicht ausgelesen werden: %1; %2</translation>
</message> </message>
<message> <message>
<location filename="../keychain_mac.cpp" line="74"/> <location filename="../keychain_mac.cpp" line="76"/>
<source>Password not found</source> <source>Password not found</source>
<translation>Passwort nicht gefunden</translation> <translation>Passwort nicht gefunden</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="343"/> <location filename="../keychain_dbus.cpp" line="345"/>
<location filename="../keychain_win.cpp" line="27"/> <location filename="../keychain_win.cpp" line="27"/>
<source>Entry not found</source> <source>Entry not found</source>
<translation>Eintrag nicht gefunden</translation> <translation>Eintrag nicht gefunden</translation>
@ -68,24 +68,24 @@
<context> <context>
<name>QKeychain::WritePasswordJobPrivate</name> <name>QKeychain::WritePasswordJobPrivate</name>
<message> <message>
<location filename="../keychain_dbus.cpp" line="391"/> <location filename="../keychain_dbus.cpp" line="393"/>
<location filename="../keychain_dbus.cpp" line="399"/> <location filename="../keychain_dbus.cpp" line="401"/>
<source>Unknown error</source> <source>Unknown error</source>
<translation>Unbekannter Fehler</translation> <translation>Unbekannter Fehler</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="414"/> <location filename="../keychain_dbus.cpp" line="416"/>
<source>D-Bus is not running</source> <source>D-Bus is not running</source>
<translation type="unfinished"></translation> <translation type="unfinished"></translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="426"/> <location filename="../keychain_dbus.cpp" line="457"/>
<location filename="../keychain_dbus.cpp" line="502"/> <location filename="../keychain_dbus.cpp" line="533"/>
<source>Could not open wallet: %1; %2</source> <source>Could not open wallet: %1; %2</source>
<translation>Konnte Brieftasche nicht öffnen: %1; %2</translation> <translation>Konnte Brieftasche nicht öffnen: %1; %2</translation>
</message> </message>
<message> <message>
<location filename="../keychain_dbus.cpp" line="480"/> <location filename="../keychain_dbus.cpp" line="511"/>
<source>Access to keychain denied</source> <source>Access to keychain denied</source>
<translation>Zugriff auf Schlüsselbund verweigert</translation> <translation>Zugriff auf Schlüsselbund verweigert</translation>
</message> </message>
@ -167,5 +167,11 @@
<source>Unknown error</source> <source>Unknown error</source>
<translation>Unbekannter Fehler</translation> <translation>Unbekannter Fehler</translation>
</message> </message>
<message>
<location filename="../keychain_mac.cpp" line="31"/>
<location filename="../keychain_mac.cpp" line="33"/>
<source>%1 (OSStatus %2)</source>
<translation type="unfinished"></translation>
</message>
</context> </context>
</TS> </TS>