OS X: Simplify string

Avoid arg() where not necessary. Also fixes the build when disabling
implicit ASCII<->QString conversions.
This commit is contained in:
Frank Osterfeld 2016-07-28 11:35:25 +02:00
parent eae3ce6636
commit 5b6389b567
1 changed files with 1 additions and 2 deletions

View File

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