void QTweetHomeTimeline::parseJsonFinished(const QJsonDocument &jsonDoc) { if (jsonDoc.isArray()) { QList<QTweetStatus> statuses = QTweetConvert::jsonArrayToStatusList(jsonDoc.array()); emit parsedStatuses(statuses); } }
void QTweetRetweetByMe::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QList<QTweetStatus> statuses = variantToStatusList(json); emit parsedStatuses(statuses); } else { qDebug() << "QTweetRetweetByMe JSON parser error: " << errorMsg; } }
void QTweetRetweetToMe::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QList<QTweetStatus> statuses = QTweetConvert::variantToStatusList(json); emit parsedStatuses(statuses); } else { qDebug() << "QTweetRetweetToMe JSON parser error: " << errorMsg; emit error(QTweetJsonError(errorMsg, json.toByteArray())); } }
void QTweetMentions::parsingJsonFinished(const QVariant &json, bool ok, const QString &errorMsg) { if (ok) { QList<QTweetStatus> statuses = QTweetConvert::variantToStatusList(json); emit parsedStatuses(statuses); } else { qDebug() << "QTweetMentions JSON parser error: " << errorMsg; setLastErrorMessage(errorMsg); emit error(JsonParsingError, errorMsg); } }
/** * Fetches last 200 mentions. * @reimp */ void MentionsQmlListModel::fetchLastTweets() { qint64 lastMentionID = 0; QSqlQuery query; query.exec("SELECT id FROM status WHERE mention == 1 ORDER BY id DESC LIMIT 1"); if (query.next()) lastMentionID = query.value(0).toLongLong(); QTweetMentions *mentions = new QTweetMentions(m_oauthTwitter); mentions->fetch(lastMentionID, 0, 200); connect(mentions, SIGNAL(parsedStatuses(QList<QTweetStatus>)), this, SLOT(finishedFetchTweets(QList<QTweetStatus>))); connect(mentions, SIGNAL(error(ErrorCode,QString)), this, SLOT(errorFetchingTweets())); }