19 #include <QTextStream>
27 QgsDebugMsg(
"already registered an instance of QgsCredentials" );
30 smInstance = theInstance;
51 if ( mCredentialCache.contains( realm ) )
53 QPair<QString, QString> credentials = mCredentialCache.take( realm );
54 username = credentials.first;
55 password = credentials.second;
56 QgsDebugMsg( QString(
"retrieved realm:%1 username:%2 password:%3" ).arg( realm ).arg( username ).arg( password ) );
58 if ( !password.isNull() )
62 if (
request( realm, username, password, message ) )
64 QgsDebugMsg( QString(
"requested realm:%1 username:%2 password:%3" ).arg( realm ).arg( username ).arg( password ) );
69 QgsDebugMsg( QString(
"unset realm:%1" ).arg( realm ) );
76 QgsDebugMsg( QString(
"inserting realm:%1 username:%2 password:%3" ).arg( realm ).arg( username ).arg( password ) );
77 mCredentialCache.insert( realm, QPair<QString, QString>( username, password ) );
101 QTextStream in( stdin, QIODevice::ReadOnly );
102 QTextStream out( stdout, QIODevice::WriteOnly );
104 out <<
"credentials for " << realm << endl;
105 if ( !message.isEmpty() )
106 out <<
"message: " << message << endl;