/src/sip/twitter/tomahawkoauthtwitter.cpp

http://github.com/tomahawk-player/tomahawk · C++ · 32 lines · 24 code · 8 blank · 0 comment · 1 complexity · 42892bdbc9ed79b4985066812da639c9 MD5 · raw file

  1. #include "tomahawkoauthtwitter.h"
  2. #include <QInputDialog>
  3. #include "utils/logger.h"
  4. TomahawkOAuthTwitter::TomahawkOAuthTwitter( QNetworkAccessManager *nam, QObject* parent )
  5. : OAuthTwitter( QByteArray::fromBase64( "QzR2NFdmYTIxcmZJRGNrNEhNUjNB" ), QByteArray::fromBase64( "elhTalU2Ympydmc2VVZNSlg0SnVmcUh5amozaWV4dFkxNFNSOXVCRUFv" ), parent )
  6. {
  7. setNetworkAccessManager( nam );
  8. }
  9. int
  10. TomahawkOAuthTwitter::authorizationWidget()
  11. {
  12. bool ok;
  13. int i = QInputDialog::getInt(0, tr( "Twitter PIN" ), tr( "After authenticating on Twitter's web site,\nenter the displayed PIN number here:" ), 0, 0, 2147483647, 1, &ok);
  14. if (ok)
  15. return i;
  16. return 0;
  17. }
  18. void
  19. TomahawkOAuthTwitter::error()
  20. {
  21. qDebug() << Q_FUNC_INFO;
  22. setOAuthToken( QString().toLatin1() );
  23. setOAuthTokenSecret( QString().toLatin1() );
  24. }