Changeset 0ede0a2 in confclerk_git


Ignore:
Timestamp:
10/05/17 17:59:45 (5 years ago)
Author:
gregor herrmann <gregor@…>
Branches:
master
Children:
68efead
Parents:
8180111
git-author:
gregor herrmann <gregor@…> (10/05/17 13:27:04)
git-committer:
gregor herrmann <gregor@…> (10/05/17 17:59:45)
Message:

Add ProxyType? setting in preparation of SOCKS5 proxy support.

Location:
src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • src/app/appsettings.cpp

    r8180111 r0ede0a2  
    2222const QString PROXY_ADDRESS_SETTING ("proxyAddress");
    2323const QString PROXY_PORT_SETTING ("proxyPort");
    24 const QString PROXY_ISDIRECT_SETTING ("proxyIsDirectConnection");
     24const QString PROXY_TYPE_SETTING ("proxyType");
     25const QString PROXY_ISDIRECT_SETTING ("proxyIsDirectConnection");
    2526
    2627QSettings AppSettings::mSettings("Toastfreeware", "ConfClerk");
     
    3435{
    3536    return mSettings.value(PROXY_PORT_SETTING).toUInt();
     37}
     38
     39//QNetworkProxy::ProxyType
     40int AppSettings::proxyType()
     41{
     42    return mSettings.value(PROXY_TYPE_SETTING).toInt();
    3643}
    3744
     
    5158}
    5259
     60// QNetworkProxy::ProxyType
     61void AppSettings::setProxyType(const int aType)
     62{
     63    mSettings.setValue(PROXY_TYPE_SETTING, aType);
     64}
     65
    5366void AppSettings::setDirectConnection(bool aDirectConnection)
    5467{
  • src/app/appsettings.h

    r8180111 r0ede0a2  
    2424#include <QString>
    2525#include <QSettings>
     26#include <QNetworkProxy>
    2627
    2728class AppSettings
     
    3637        static QString proxyAddress();
    3738        static quint16 proxyPort();
     39        static int proxyType(); // QNetworkProxy::ProxyType
    3840        static bool isDirectConnection();
    3941
    4042        static void setProxyAddress(const QString &aAddress);
    4143        static void setProxyPort(const quint16 aPort);
     44        static void setProxyType(const int aProxyType); // QNetworkProxy::ProxyType
    4245        static void setDirectConnection(bool aDirectConnection);
    4346        static int preEventAlarmSec() {return 60*15;} ///< seconds that alarm should ring before an event starts
  • src/gui/mainwindow.cpp

    r8180111 r0ede0a2  
    8383
    8484    QNetworkProxy proxy(
    85             AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
     85            AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : (QNetworkProxy::ProxyType)AppSettings::proxyType(),
    8686            AppSettings::proxyAddress(),
    8787            AppSettings::proxyPort(),
     
    364364        dialog.saveDialogData();
    365365        QNetworkProxy proxy(
    366                 AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : QNetworkProxy::HttpProxy,
     366                AppSettings::isDirectConnection() ? QNetworkProxy::NoProxy : (QNetworkProxy::ProxyType)AppSettings::proxyType(),
    367367                AppSettings::proxyAddress(),
    368368                AppSettings::proxyPort(),
  • src/gui/settingsdialog.cpp

    r8180111 r0ede0a2  
    2222#include "appsettings.h"
    2323#include <QDebug>
     24#include <QNetworkProxy>
    2425
    2526SettingsDialog::SettingsDialog(QWidget *aParent)
     
    4647    AppSettings::setProxyAddress(address->text());
    4748    AppSettings::setProxyPort(port->value());
     49    AppSettings::setProxyType(QNetworkProxy::HttpProxy); // TODO!!
    4850    AppSettings::setDirectConnection(directConnection->isChecked());
    4951}
Note: See TracChangeset for help on using the changeset viewer.