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


C++ MirallConfigFile::ownCloudPasswd方法代码示例

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


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

示例1: fetchCredentials

void CredentialStore::fetchCredentials()
{
    _state = Fetching;
    MirallConfigFile cfgFile;

    if( ++_tries > MAX_LOGIN_ATTEMPTS ) {
        qDebug() << "Too many attempts to enter password!";
        _state = TooManyAttempts;
        return;
    }

    bool ok = false;
    QString pwd;
    _state = Fetching;
    _user = cfgFile.ownCloudUser();

    switch( _type ) {
    case CredentialStore::User: {
        /* Ask the user for the password */
        /* Fixme: Move user interaction out here. */
        pwd = QInputDialog::getText(0, QApplication::translate("MirallConfigFile","Password Required"),
                                    QApplication::translate("MirallConfigFile","Please enter your %1 password:")
                                    .arg(Theme::instance()->appName()),
                                    QLineEdit::Password,
                                    QString::null, &ok);
        if( !ok ) {
            _state = UserCanceled;
        }
        break;
    }
    case CredentialStore::Settings: {
        /* Read from config file. */
        pwd = cfgFile.ownCloudPasswd();
        ok = true;
        break;
    }
    case CredentialStore::KeyChain: {
#ifdef WITH_QTKEYCHAIN
        _state = AsyncFetching;
        if( !_user.isEmpty() ) {
            ReadPasswordJob *job = new ReadPasswordJob(Theme::instance()->appName());
            // job->setAutoDelete( false );
            // job->setSettings( )
            job->setKey( keyChainKey( cfgFile.ownCloudUrl() ) );

            connect( job, SIGNAL(finished(QKeychain::Job*)), this,
                     SLOT(slotKeyChainReadFinished(QKeychain::Job*)));
            job->start();
        }
#else
        qDebug() << "QtKeyChain: Not yet implemented!";
        _state = Error;
#endif
        break;
    }
    default: {
        break;
    }
    }
开发者ID:Rawrpwnzl,项目名称:mirall,代码行数:59,代码来源:credentialstore.cpp

示例2: startSync

void ownCloudFolder::startSync(const QStringList &pathList)
{
    if (_csync && _csync->isRunning()) {
        qCritical() << "* ERROR csync is still running and new sync requested.";
        return;
    }
    delete _csync;

    MirallConfigFile cfgFile;

    QUrl url( _secondPath );
    url.setScheme( "owncloud" );
    qDebug() << "*** Start syncing to ownCloud, onlyLocal: " << _localCheckOnly;

    _csync = new CSyncThread(path(), url.toEncoded(), _localCheckOnly );
    _csync->setUserPwd( cfgFile.ownCloudUser(), cfgFile.ownCloudPasswd() );
    QObject::connect(_csync, SIGNAL(started()),  SLOT(slotCSyncStarted()));
    QObject::connect(_csync, SIGNAL(finished()), SLOT(slotCSyncFinished()));
    _csync->start();
}
开发者ID:sandeepraju,项目名称:mirall,代码行数:20,代码来源:owncloudfolder.cpp

示例3: createRemoteFolder

bool OwncloudSetupWizard::createRemoteFolder( const QString& folder )
{
    if( folder.isEmpty() ) return false;

    MirallConfigFile cfgFile;

    QString url = cfgFile.ownCloudUrl( cfgFile.defaultConnection(), true );
    url.append( folder );
    qDebug() << "creating folder on ownCloud: " << url;

    MirallWebDAV *webdav = new MirallWebDAV(this);
    connect( webdav, SIGNAL(webdavFinished(QNetworkReply*)),
             SLOT(slotCreateRemoteFolderFinished(QNetworkReply*)));

    webdav->httpConnect( url, cfgFile.ownCloudUser(), cfgFile.ownCloudPasswd() );
    if( webdav->mkdir(  url  ) ) {
        qDebug() << "WebDAV mkdir request successfully started";
        return true;
    } else {
        qDebug() << "WebDAV mkdir request failed";
        return false;
    }
}
开发者ID:sandeepraju,项目名称:mirall,代码行数:23,代码来源:owncloudsetupwizard.cpp


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