void MainWindow::requestFailedWithFacebookError(const FBError &error, bool handled)
{
    qDebug() << "facebook error is " << error.code() << " - " << error.description();

    // If it's a permissions error, request permission.
    if (error.code() == 250) {
        // Find permission requested
        // XXX: is there any easier way to do this?
        QString permission = error.description().split(QChar(' ')).last();
        qDebug() << "About to request " << permission;

        // Note: this is deallocated in the relevant slots.
        FBPermissionDialog *d = new FBPermissionDialog(FaceBrick::instance()->session());
        connect(d, SIGNAL(dialogDidSucceed()), this, SLOT(permissionGranted()));
        connect(d, SIGNAL(dialogDidCancel()), this, SLOT(permissionDeniedOrCancelled()));
        connect(d, SIGNAL(dialogDidFailWithError(FBError)), this, SLOT(permissionRequestFailedWithError(FBError)));
        d->setPermissionToRequest(permission);
        d->load();
        d->show();
    } else if (!handled) {
        // If it wasn't handled elsewhere, let the user know
#ifdef Q_WS_MAEMO_5
        QMaemo5InformationBox::information(this, tr("Facebook error: %1 (%2)").arg(error.code()).arg(error.description()));
#endif
    }

    sender()->deleteLater();
}
void MainWindow::permissionRequestFailedWithError(const FBError &error)
{
#ifdef Q_WS_MAEMO_5
    QMaemo5InformationBox::information(this, tr("Error requesting Facebook permission: %1 (%2)").arg(error.code()).arg(error.description()));
#endif
    qDebug() << "Permission request failed! Error code: " << error.code() << ": " << error.description();
    sender()->deleteLater();

    // Don't try do anything smart like calling requestFailedWithFacebookError,
    // because it might just end up getting us back here.
}
Exemple #3
0
void AuthApp::requestFailedWithFacebookError ( const FBError& aError )
{
    qDebug() << "facebook error is " << aError.code() << " - " << aError.description();
}
void MainWindow::newsFeedLoadingError(const FBError &error)
{
#ifdef Q_WS_MAEMO_5
    setAttribute(Qt::WA_Maemo5ShowProgressIndicator, false);
    QMaemo5InformationBox::information(this, tr("Error loading newsfeed: %1 (%2)").arg(error.code()).arg(error.description()));
#endif
    m_updatingNewsFeed = false;
    requestFailedWithFacebookError(error, true);
}