コード例 #1
0
void
MeeGo::Sync::FrameworkClient::doInitialSync()
{
  qDebug() << "INFO: Performing 'initial sync' procedure for profile:"
	   << m_name;

  StoreCredentialsProcessor * const processor =
    new StoreCredentialsProcessor(m_username, m_password);
  m_processor.reset(processor);

  // Capture completion of credentials storage for subsequent sync
  // profile processing.
  connect(processor,
	  SIGNAL(stored(quint32)),
	  this,
	  SLOT(credentialsStored(quint32)));

  // Capture errors that occurred during credentials storage.
  connect(processor,
	  SIGNAL(error(const SignOn::Error &)),
	  this,
	  SLOT(credentialsError(const SignOn::Error &)));

  if (m_cred.isNull()) {
    m_cred.reset(new SharedCredentials);
  }

  // Process credentials storage asynchronously.
  m_cred->processCredentials(processor, m_provider);

  // Profile will be updated with new username/password once
  // credentials storage completes.
}
コード例 #2
0
void SignOnAdapter::createIdentity(QString password){
    identityInfo = new SignOn::IdentityInfo();

    identityInfo->setCaption(QString(MEEPASSWORDS_CAPTION));
    identityInfo->setRealms(QStringList(QString(MEEPASSWORDS_REALM)));
    identityInfo->setUserName(QString(MEEPASSWORDS_USERNAME));
    identityInfo->setSecret(password, true);

    qDebug("Creating identity.");
    identity = SignOn::Identity::newIdentity(*identityInfo);

    connect(identity, SIGNAL(credentialsStored(quint32)), this, SLOT(credentialsStoreSuccess(quint32)));
    qDebug("Storing credentials.");
    identity->storeCredentials(*identityInfo);
}