示例#1
0
void CloudSyncManager::setOwncloudPassword( const QString &password )
{
    if ( d->m_owncloudPassword != password ) {
        d->m_owncloudPassword = password;
        emit owncloudPasswordChanged( d->m_owncloudPassword );
        emit apiUrlChanged( apiUrl() );
    }
}
示例#2
0
void CloudSyncManager::setOwncloudUsername( const QString &username )
{
    if ( d->m_owncloudUsername != username ) {
        d->m_owncloudUsername = username;
        emit owncloudUsernameChanged( d->m_owncloudUsername );
        emit apiUrlChanged( apiUrl() );
    }
}
示例#3
0
void CloudSyncManager::setOwncloudServer( const QString &server )
{
    if ( d->m_ownloudServer != server ) {
        d->m_ownloudServer = server;
        emit owncloudServerChanged( d->m_ownloudServer );
        emit apiUrlChanged( apiUrl() );
    }
}
示例#4
0
void CloudSyncManager::setOwncloudCredentials( const QString &server, const QString &user, const QString &password )
{
    QUrl const oldApiUrl = apiUrl();
    blockSignals( true );
    setOwncloudServer( server );
    setOwncloudUsername( user );
    setOwncloudPassword( password );
    blockSignals( false );
    if ( oldApiUrl != apiUrl() ) {
        emit apiUrlChanged( apiUrl() );
    }
}
示例#5
0
void CloudSyncManager::setOwncloudServer( const QString &server )
{
    QString const oldProtocol = d->m_owncloudProtocol;
    QString const oldServer = d->m_ownloudServer;

    if ( server.startsWith( "http://" ) ) {
        d->m_owncloudProtocol = "http://";
        d->m_ownloudServer = server.mid( 7 );
    } else if ( server.startsWith( "https://" ) ) {
        d->m_owncloudProtocol = "https://";
        d->m_ownloudServer = server.mid ( 8 );
    } else {
        d->m_owncloudProtocol = "http://";
        d->m_ownloudServer = server;
    }

    if ( oldServer != d->m_ownloudServer ) {
        emit owncloudServerChanged( owncloudServer() );
        emit apiUrlChanged( apiUrl() );
    } else if ( oldProtocol != d->m_owncloudProtocol ) {
        emit apiUrlChanged( apiUrl() );
    }
}