当前位置: 首页>>代码示例>>C++>>正文


C++ AccountPtr类代码示例

本文整理汇总了C++中AccountPtr的典型用法代码示例。如果您正苦于以下问题:C++ AccountPtr类的具体用法?C++ AccountPtr怎么用?C++ AccountPtr使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了AccountPtr类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: setupBrowser

void OwncloudShibbolethCredsPage::setupBrowser()
{
    if (!_browser.isNull()) {
        return;
    }
    OwncloudWizard *ocWizard = qobject_cast<OwncloudWizard *>(wizard());
    AccountPtr account = ocWizard->account();

    // we need to reset the cookie jar to drop temporary cookies (like the shib cookie)
    // i.e. if someone presses "back"
    QNetworkAccessManager *qnam = account->networkAccessManager();
    CookieJar *jar = new CookieJar;
    jar->restore(account->cookieJarPath());
    // Implicitly deletes the old cookie jar, and reparents the jar
    qnam->setCookieJar(jar);

    _browser = new ShibbolethWebView(account);
    connect(_browser.data(), &ShibbolethWebView::shibbolethCookieReceived,
        this, &OwncloudShibbolethCredsPage::slotShibbolethCookieReceived, Qt::QueuedConnection);
    connect(_browser.data(), &ShibbolethWebView::rejected,
        this, &OwncloudShibbolethCredsPage::slotBrowserRejected);

    _browser->move(ocWizard->x(), ocWizard->y());
    _browser->show();
    _browser->setFocus();
}
开发者ID:bjoernv,项目名称:client,代码行数:26,代码来源:owncloudshibbolethcredspage.cpp

示例2: fetchPrivateLinkUrl

void fetchPrivateLinkUrl(AccountPtr account, const QString &remotePath,
    const QByteArray &numericFileId, QObject *target,
    std::function<void(const QString &url)> targetFun)
{
    QString oldUrl;
    if (!numericFileId.isEmpty())
        oldUrl = account->deprecatedPrivateLinkUrl(numericFileId).toString(QUrl::FullyEncoded);

    // Retrieve the new link by PROPFIND
    PropfindJob *job = new PropfindJob(account, remotePath, target);
    job->setProperties(
        QList<QByteArray>()
        << "http://owncloud.org/ns:fileid" // numeric file id for fallback private link generation
        << "http://owncloud.org/ns:privatelink");
    job->setTimeout(10 * 1000);
    QObject::connect(job, &PropfindJob::result, target, [=](const QVariantMap &result) {
        auto privateLinkUrl = result["privatelink"].toString();
        auto numericFileId = result["fileid"].toByteArray();
        if (!privateLinkUrl.isEmpty()) {
            targetFun(privateLinkUrl);
        } else if (!numericFileId.isEmpty()) {
            targetFun(account->deprecatedPrivateLinkUrl(numericFileId).toString(QUrl::FullyEncoded));
        } else {
            targetFun(oldUrl);
        }
    });
    QObject::connect(job, &PropfindJob::finishedWithError, target, [=](QNetworkReply *) {
        targetFun(oldUrl);
    });
    job->start();
}
开发者ID:uniblockchain,项目名称:client,代码行数:31,代码来源:networkjobs.cpp

示例3: p12ToPem

//called during the validation of the client certificate.
void OwncloudSetupPage::slotCertificateAccepted()
{
    QSslCertificate sslCertificate;

    resultP12ToPem certif = p12ToPem(addCertDial->getCertificatePath().toStdString() , addCertDial->getCertificatePasswd().toStdString());
    if(certif.ReturnCode){
        QString s = QString::fromStdString(certif.Certificate);
        QByteArray ba = s.toLocal8Bit();

        QList<QSslCertificate> sslCertificateList = QSslCertificate::fromData(ba, QSsl::Pem);
        sslCertificate = sslCertificateList.takeAt(0);

        _ocWizard->ownCloudCertificate = ba;
        _ocWizard->ownCloudPrivateKey = certif.PrivateKey.c_str();
        _ocWizard->ownCloudCertificatePath = addCertDial->getCertificatePath();
        _ocWizard->ownCloudCertificatePasswd = addCertDial->getCertificatePasswd();

        AccountPtr acc = _ocWizard->account();
        acc->setCertificate(_ocWizard->ownCloudCertificate, _ocWizard->ownCloudPrivateKey);
        addCertDial->reinit();
        validatePage();
    } else {
        QString message;
        message = certif.Comment.c_str();
        addCertDial->showErrorMessage(message);
        addCertDial->show();
    }
}
开发者ID:dariaphoebe,项目名称:owncloudclient,代码行数:29,代码来源:owncloudsetuppage.cpp

示例4: find_account

void
Opal::Bank::on_mwi_event (std::string aor,
			  std::string info)
{
  AccountPtr account = find_account (aor);

  if (account)
    account->handle_message_waiting_information (info);
}
开发者ID:Klom,项目名称:ekiga,代码行数:9,代码来源:opal-bank.cpp

示例5: AbstractNetworkJob

AvatarJob::AvatarJob(AccountPtr account, const QString &userId, int size, QObject *parent)
    : AbstractNetworkJob(account, QString(), parent)
{
    if (account->serverVersionInt() >= Account::makeServerVersion(10, 0, 0)) {
        _avatarUrl = Utility::concatUrlPath(account->url(), QString("remote.php/dav/avatars/%1/%2.png").arg(userId, QString::number(size)));
    } else {
        _avatarUrl = Utility::concatUrlPath(account->url(), QString("index.php/avatar/%1/%2").arg(userId, QString::number(size)));
    }
}
开发者ID:uniblockchain,项目名称:client,代码行数:9,代码来源:networkjobs.cpp

示例6: cleanupPage

void AbstractCredentialsWizardPage::cleanupPage()
{
    // Reset the credentials when the 'Back' button is used.

    AccountPtr account = static_cast<OwncloudWizard *>(wizard())->account();
    AbstractCredentials *creds = account->credentials();
    if (creds && !qobject_cast<DummyCredentials *>(creds)) {
        account->setCredentials(new DummyCredentials);
    }
}
开发者ID:owncloud,项目名称:client,代码行数:10,代码来源:abstractcredswizardpage.cpp

示例7: canGetQuota

bool QuotaInfo::canGetQuota() const
{
    if (! _accountState || !_active) {
        return false;
    }
    AccountPtr account = _accountState->account();
    return _accountState->isConnected()
        && account->credentials()
        && account->credentials()->ready();
}
开发者ID:bbxfork,项目名称:client,代码行数:10,代码来源:quotainfo.cpp

示例8: slotCleanup

void Application::slotCleanup()
{
    // explicitly close windows. This is somewhat of a hack to ensure
    // that saving the geometries happens ASAP during a OS shutdown
    AccountPtr account = AccountManager::instance()->account();
    if (account) {
        account->save();
    }
    FolderMan::instance()->unloadAndDeleteAllFolders();

    _gui->slotShutdown();
    _gui->deleteLater();
}
开发者ID:Buckeye,项目名称:client,代码行数:13,代码来源:application.cpp

示例9: ShowShort

std::string Trace::ShowShort()
{
	std::string editedby = "unknown";
	
	try {
		AccountPtr account = mud::AccountManager::Get()->GetByKey(getAccount());
		editedby = account->getName();
	} catch(RowNotFoundException& e) {
		
	}
	
	return Global::Get()->sprintf("%s (%ld): %s\n", 
			editedby.c_str(),
			getTime(),
			getDescription().c_str());
}
开发者ID:SRabbelier,项目名称:unsignedbyte,代码行数:16,代码来源:Trace.cpp

示例10: slotLogout

void Application::slotLogout()
{
    AccountState* ai = AccountStateManager::instance()->accountState();
    if (ai) {
        AccountPtr a = ai->account();
        // invalidate & forget token/password
        a->credentials()->invalidateToken();
        // terminate all syncs and unload folders
        FolderMan *folderMan = FolderMan::instance();
        folderMan->setSyncEnabled(false);
        folderMan->terminateSyncProcess();
        ai->setSignedOut(true);
        // show result
        _gui->slotComputeOverallSyncStatus();
    }
}
开发者ID:Buckeye,项目名称:client,代码行数:16,代码来源:application.cpp

示例11: PendingOperation

/**
 * Construct a new PendingChannelRequest object that always fails.
 *
 * \param account Account to use.
 * \param errorName The name of a D-Bus error.
 * \param errorMessage The error message.
 */
PendingChannelRequest::PendingChannelRequest(const AccountPtr &account,
        const QString &errorName, const QString &errorMessage)
    : PendingOperation(ConnectionPtr()),
      mPriv(new Private(account->dbusConnection()))
{
    setFinishedWithError(errorName, errorMessage);
}
开发者ID:Ziemin,项目名称:telepathy-qt,代码行数:14,代码来源:pending-channel-request.cpp

示例12: QObject

AccountState::AccountState(AccountPtr account)
    : QObject(account.data())
    , _account(account)
    , _quotaInfo(0)
    , _state(AccountState::Disconnected)
    , _connectionStatus(ConnectionValidator::Undefined)
    , _waitingForNewCredentials(false)
{
    qRegisterMetaType<AccountState*>("AccountState*");

    _quotaInfo = new QuotaInfo(this); // Need to be initialized when 'this' is fully initialized

    connect(account.data(), SIGNAL(invalidCredentials()),
            SLOT(slotInvalidCredentials()));
    connect(account.data(), SIGNAL(credentialsFetched(AbstractCredentials*)),
            SLOT(slotCredentialsFetched(AbstractCredentials*)));
}
开发者ID:Buckeye,项目名称:client,代码行数:17,代码来源:accountstate.cpp

示例13: cleanupPage

void AbstractCredentialsWizardPage::cleanupPage()
{
    // Reset the credentials when the 'Back' button is used.

    // Unfortunately this code is also run when the Wizard finishes
    // prematurely with 'Skip Folder Configuration'. Therefore we need to
    // avoid resetting credentials on active accounts.
    AccountPtr account = static_cast<OwncloudWizard*>(wizard())->account();
    if (account == AccountManager::instance()->account())
        return;

    AbstractCredentials *creds = account->credentials();
    if (creds) {
        if (!creds->inherits("DummyCredentials")) {
            account->setCredentials(CredentialsFactory::create("dummy"));
        }
    }
}
开发者ID:24killen,项目名称:client,代码行数:18,代码来源:abstractcredswizardpage.cpp

示例14: catch

std::vector<std::string> Trace::Show()
{
	std::vector<std::string> result;
	std::string editedby = "unknown";
	
	try {
		AccountPtr account = mud::AccountManager::Get()->GetByKey(getAccount());
		editedby = account->getName();
	} catch(RowNotFoundException& e) {
		
	}
	
	result.push_back(Global::Get()->sprintf("Account: '%s'.", editedby.c_str()));
	result.push_back(Global::Get()->sprintf("Description: '%s'.", getDescription().c_str()));
	result.push_back(Global::Get()->sprintf("Diff: %s.", getDiff().c_str()));
	result.push_back(Global::Get()->sprintf("Time: %ld.", getTime()));
	
	return result;
}
开发者ID:SRabbelier,项目名称:unsignedbyte,代码行数:19,代码来源:Trace.cpp

示例15: m_accPtr

AccountListener::AccountListener(AccountPtr ptr) : m_accPtr(ptr) {
    QObject::connect(ptr.data()->becomeReady(), SIGNAL(finished(Tp::PendingOperation *)), this, SLOT(accountReady(Tp::PendingOperation *)));

    QObject::connect(m_accPtr.data(), SIGNAL(statusChanged(Tp::ConnectionStatus,
                                                                Tp::ConnectionStatusReason,
                                                                const QString &, const QVariantMap &)),
                     this, SLOT(statusChanged(Tp::ConnectionStatus,
                                              Tp::ConnectionStatusReason,
                                              const QString &, const QVariantMap &)));
}
开发者ID:chris-magic,项目名称:studycode,代码行数:10,代码来源:AccountListener.cpp


注:本文中的AccountPtr类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。