示例#1
0
void AccessConfig::assign(const AccessConfig& s) {
    setUsername (s.getUsername() );
    setPassword (s.getPassword() );
    setSyncURL  (s.getSyncURL()  );
    setProxyHost(s.getProxyHost());
    setProxyPort(s.getProxyPort());
    setUserAgent(s.getUserAgent());

    setProxyUsername(s.getProxyUsername());
    setProxyPassword(s.getProxyPassword());
    setBeginSync(s.getBeginSync());
    setEndSync(s.getEndSync());
    setFirstTimeSyncMode(s.getFirstTimeSyncMode());

    setServerAuthRequired(s.getServerAuthRequired());
    setClientAuthType(s.getClientAuthType());
    setServerAuthType(s.getServerAuthType());
    setServerPWD(s.getServerPWD());
    setServerID(s.getServerID());
    setServerNonce(s.getServerNonce());
    setClientNonce(s.getClientNonce());
    setMaxMsgSize(s.getMaxMsgSize());
    setReadBufferSize(s.getReadBufferSize());
    setCheckConn(s.getCheckConn());
    setResponseTimeout(s.getResponseTimeout());
    setCompression(s.getCompression());

    dirty = s.getDirty();
}
示例#2
0
void Config::setProxy(const QString &value)
{
    QUrl proxyUrl = QUrl::fromUserInput(value);

    if (proxyUrl.isValid()) {
        setProxyHost(proxyUrl.host());
        setProxyPort(proxyUrl.port(1080));
    }
}
示例#3
0
void Config::setProxy(const QString &value)
{
    QString proxyHost = value;
    int proxyPort = 1080;

    if (proxyHost.lastIndexOf(':') > 0) {
        bool ok = true;
        int port = proxyHost.mid(proxyHost.lastIndexOf(':') + 1).toInt(&ok);
        if (ok) {
            proxyHost = proxyHost.left(proxyHost.lastIndexOf(':')).trimmed();
            proxyPort = port;
        }
    }

    setProxyHost(proxyHost);
    setProxyPort(proxyPort);
}