Advertisement
Guest User

Untitled

a guest
Oct 19th, 2013
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.94 KB | None | 0 0
  1. void TestClass::walletIsOpen( bool walletIsOpen )
  2. {
  3.     if( walletIsOpen ){
  4.         QVector<lxqt::Wallet::walletKeyValues> s = m_wallet->readAllKeyValues() ;
  5.         size_t j = s.size() ;
  6.         for( size_t i = 0 ; i < j ; i++ ){
  7.             const QString& key      = s.at( i ).getKey() ;
  8.             const QByteArray& value = s.at( i ).getValue() ;
  9.             qDebug() << "key=" << key << ":value=" << value ;
  10.         }
  11.     }else{
  12.         qDebug() << "failed to open wallet" ;
  13.     }
  14.  
  15.     /*
  16.      * Delete the wallet object when done with it
  17.      */
  18.     m_wallet->deleteLater() ;
  19. }
  20.  
  21. void TestClass::testWallet()
  22. {
  23.     /*
  24.      * open a default backend( internal one )
  25.      */
  26.     m_wallet = lxqt::Wallet::getWalletBackend() ;
  27.  
  28.     /*
  29.      * set the QObject with "walletIsOpen(bool)" slot
  30.      */
  31.     m_wallet->setInterfaceObject( this ) ;
  32.  
  33.     /*
  34.      * open a wallet.
  35.      * This method will return the result of the attempt though a slot on an object set above.
  36.      */
  37.     m_wallet->open( "test_wallet_name","test_application_name" ) ;
  38. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement