void QTweetUserShow::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QTweetUser userInfo = QTweetConvert::variantMapToUserInfo(json.toMap()); emit parsedUserInfo(userInfo); } else { qDebug() << "QTweetUserShow Json parser error: " << errorMsg; emit error(QTweetJsonError(errorMsg, json.toByteArray())); } }
/** * Fetches twitter user information * @param userid id of user to fetch information in string */ void UserInfo::fetch(const QString &userid) { bool ok; qint64 id = userid.toLongLong(&ok); if (ok) { QTweetUserShow* userShow = new QTweetUserShow(m_oauthTwitter, this); userShow->fetch(id); connect(userShow, SIGNAL(parsedUserInfo(QTweetUser)), this, SLOT(finishedFetch(QTweetUser))); } }
void QTweetUserShow::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QTweetUser userInfo = QTweetConvert::variantMapToUserInfo(json.toMap()); emit parsedUserInfo(userInfo); } else { qDebug() << "QTweetUserShow Json parser error: " << errorMsg; setLastErrorMessage(errorMsg); emit error(JsonParsingError, errorMsg); } }
/** * Fetches twitter user information * @param screenName screenname of the user to fetch information */ void UserInfo::fetchByName(const QString &screenName) { QTweetUserShow* userShow = new QTweetUserShow(m_oauthTwitter, this); userShow->fetch(screenName); connect(userShow, SIGNAL(parsedUserInfo(QTweetUser)), this, SLOT(finishedFetch(QTweetUser))); }
/** * Fetches twitter user information * @param userid id of user to fetch information */ void UserInfo::fetch(qint64 userid) { QTweetUserShow* userShow = new QTweetUserShow(m_oauthTwitter, this); userShow->fetch(userid); connect(userShow, SIGNAL(parsedUserInfo(QTweetUser)), this, SLOT(finishedFetch(QTweetUser))); }