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

List:       kde-commits
Subject:    playground/pim/kblogger/src/profiles
From:       Antonio Aloisio <antonio.aloisio () gmail ! com>
Date:       2008-04-30 12:07:28
Message-ID: 1209557248.815698.25584.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 802733 by aloisio:

Fix and sort profileConfigDialog::readPasswordFromWallet()
Note: The password will be readed from the wallet after that the url is getted from \
the konfig

 M  +11 -9     profileconfigdialog.cpp  
 M  +2 -1      profilelist.cpp  


--- trunk/playground/pim/kblogger/src/profiles/profileconfigdialog.cpp #802732:802733
@@ -52,6 +52,12 @@
 
     setupUi(this);
 
+    //Open Wallet
+    mWallet = KWallet::Wallet::openWallet( "kdewallet", this->winId() );
+    Q_ASSERT( mWallet );
+    mWallet->createFolder( "kblogger" );
+    mWallet->setFolder( "kblogger" );
+
     // initialize the combo box for the blog types
     // new code to use the BlogList
     // NOTE: this means reording the BlogList int index breaks old configurations!
@@ -67,14 +73,7 @@
     connect(passwordLineEdit, SIGNAL( textChanged(const QString &) ), this, SLOT( \
                enableFetchBlogId() ) );
     connect(kcfg_Type, SIGNAL( activated( int ) ), this, SLOT( enableFetchBlogId() ) \
);  
-    mWallet = KWallet::Wallet::openWallet( "kdewallet", this->winId() );
-    if ( mWallet ) {
-        mWallet->createFolder( "kblogger" );
-        mWallet->setFolder( "kblogger" );
-        kDebug() << "Wallet successfully opened.";
-        readPasswordFromWallet();
-    }
-
+    
     connect(parent, SIGNAL(okClicked()),
             this, SLOT(savePasswordToWallet()));
     connect(parent, SIGNAL(applyClicked()),
@@ -96,7 +95,10 @@
 void ProfileConfigDialog::readPasswordFromWallet()
 {
     kDebug() << kcfg_Url->text();
-    if ( !mWallet ) return;
+    if ( kcfg_Url->text().isEmpty() ){
+        kError() << "ERROR: The password of a empty url cannot be retrieved from the \
wallet"; +    }
+
     QString buffer;
     mWallet->readPassword( kcfg_Url->text() + '_' + kcfg_User->text(), buffer );
     kDebug() << "Password from Wallet: " << buffer;
--- trunk/playground/pim/kblogger/src/profiles/profilelist.cpp #802732:802733
@@ -191,7 +191,8 @@
     //and fills any kfg_ fields in profileConfigDialog
     // replace Account_ with Account: 
     dialog->addPage(profileConfigDialog, account.replace("_", ": ") , \
                "system-users");
-
+    //readPasswordFromWallet use the kfl_url field to get the password from the \
wallet +    profileConfigDialog->readPasswordFromWallet();
     dialog->setAttribute( Qt::WA_DeleteOnClose );
     dialog->exec();
 }


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

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