aboutsummaryrefslogtreecommitdiff
path: root/networksettings.h
diff options
context:
space:
mode:
authorKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-26 21:12:45 +0900
committerKitsune Ral <Kitsune-Ral@users.sf.net>2017-12-26 21:12:45 +0900
commite1be26ce46a60d26f6e936ca0443eac135b91cef (patch)
treec0092377124a0043d4806c8189cb3482030c1f32 /networksettings.h
parent205a9a268eb3d1c35b1decaf323619a72a33036e (diff)
downloadlibquotient-e1be26ce46a60d26f6e936ca0443eac135b91cef.tar.gz
libquotient-e1be26ce46a60d26f6e936ca0443eac135b91cef.zip
NetworkSettings: store proxy configuration
No credentials, just type, host, and port.
Diffstat (limited to 'networksettings.h')
-rw-r--r--networksettings.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/networksettings.h b/networksettings.h
new file mode 100644
index 00000000..e113cd9b
--- /dev/null
+++ b/networksettings.h
@@ -0,0 +1,42 @@
+/******************************************************************************
+ * Copyright (C) 2017 Kitsune Ral <kitsune-ral@users.sf.net>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#pragma once
+
+#include "settings.h"
+
+#include <QtNetwork/QNetworkProxy>
+
+Q_DECLARE_METATYPE(QNetworkProxy::ProxyType)
+
+namespace QMatrixClient {
+ class NetworkSettings: public SettingsGroup
+ {
+ Q_OBJECT
+ QMC_DECLARE_SETTING(QNetworkProxy::ProxyType, proxyType, setProxyType)
+ QMC_DECLARE_SETTING(QString, proxyHostName, setProxyHostName)
+ QMC_DECLARE_SETTING(int, proxyPort, setProxyPort)
+ Q_PROPERTY(QString proxyHost READ proxyHostName WRITE setProxyHostName)
+ public:
+ template <typename... ArgTs>
+ explicit NetworkSettings(ArgTs... qsettingsArgs)
+ : SettingsGroup(QStringLiteral("Network"), qsettingsArgs...)
+ { }
+ ~NetworkSettings() override = default;
+ };
+}