Ignore:
Timestamp:
10/05/17 22:50:44 (5 years ago)
Author:
Philipp Spitzer <philipp@…>
Branches:
master
Children:
e618f18
Parents:
68efead
Message:

AppSettings? returns the proxy type as QNetworkProxy instead of int now.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/app/appsettings.cpp

    r68efead r9b513f6  
    3737}
    3838
    39 //QNetworkProxy::ProxyType
    40 int AppSettings::proxyType()
     39QNetworkProxy::ProxyType AppSettings::proxyType()
    4140{
    42     return mSettings.value(PROXY_TYPE_SETTING).toInt();
     41    bool ok;
     42    int proxyType = mSettings.value(PROXY_TYPE_SETTING).toInt(&ok);
     43    if (!ok || proxyType < 0 || proxyType > 5) return QNetworkProxy::DefaultProxy;
     44    return QNetworkProxy::ProxyType(proxyType);
    4345}
    4446
     
    5860}
    5961
    60 // QNetworkProxy::ProxyType
    61 void AppSettings::setProxyType(const int aType)
     62void AppSettings::setProxyType(QNetworkProxy::ProxyType aProxyType)
    6263{
    63     mSettings.setValue(PROXY_TYPE_SETTING, aType);
     64    mSettings.setValue(PROXY_TYPE_SETTING, aProxyType);
    6465}
    6566
Note: See TracChangeset for help on using the changeset viewer.