예제 #1
0
dialogOauthSetup::dialogOauthSetup(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::dialogOauthSetup)
{
    ui->setupUi(this);





    profileimageUrl = "";

    if (genericHelper::getOAuthAccessToken().length() > 3) {
        tw = new TwitchApi(this, genericHelper::getOAuthAccessToken());
    } else {
        tw = new TwitchApi(this, "");
    }


    // init the image loader
    imgl = new imageLoader(this);





    QObject::connect(tw, SIGNAL(twitchReady(const QJsonDocument)), this, SLOT(on_AuthSuccess(const QJsonDocument)));
    QObject::connect(tw, SIGNAL(networkError(QString)), this, SLOT(errorPopup(QString)));
    QObject::connect(imgl, SIGNAL(downloaded()), this, SLOT(loadProfileImage()));



}
예제 #2
0
void InstagramView::load(InstagramPostData args){
	_args = args;
	_isLoading = true;
	
	// Format caption
	string tail;
	
	if(_args.caption.size() > 200){
		_args.caption = _args.caption.substr(0, 200);
		tail = "...";
	}else{
		tail = "";
	}
	
	string c = splitInLines(_args.caption , 30);
	_args.caption = c + tail;
	loadProfileImage();
}