PageRenderTime 82ms CodeModel.GetById 40ms app.highlight 3ms RepoModel.GetById 37ms app.codeStats 0ms

/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
 3#include <QInputDialog>
 4
 5#include "utils/logger.h"
 6
 7
 8TomahawkOAuthTwitter::TomahawkOAuthTwitter( QNetworkAccessManager *nam, QObject* parent )
 9    : OAuthTwitter( QByteArray::fromBase64( "QzR2NFdmYTIxcmZJRGNrNEhNUjNB" ), QByteArray::fromBase64( "elhTalU2Ympydmc2VVZNSlg0SnVmcUh5amozaWV4dFkxNFNSOXVCRUFv" ), parent )
10{
11    setNetworkAccessManager( nam );
12}
13
14
15int
16TomahawkOAuthTwitter::authorizationWidget()
17{
18    bool ok;
19    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);
20    if (ok)
21        return i;
22
23    return 0;
24}
25
26void
27TomahawkOAuthTwitter::error()
28{
29    qDebug() << Q_FUNC_INFO;
30    setOAuthToken( QString().toLatin1() );
31    setOAuthTokenSecret( QString().toLatin1() );
32}