blob: fcf971ae896f72c93650530855e9a13b31017645 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
#include "protocolsetup.hpp"
ProtocolSetup::ProtocolSetup()
{
#define MAC(X) this->X = false;
PROTOCOLS(MAC)
#undef MAC
this->gemini = true;
}
void ProtocolSetup::save(QSettings &settings) const
{
settings.beginGroup("Protocols");
#define MAC(X) settings.setValue(#X, this->X);
PROTOCOLS(MAC)
#undef MAC
settings.endGroup();
}
void ProtocolSetup::load(QSettings &settings)
{
settings.beginGroup("Protocols");
#define MAC(X) if(settings.contains(#X)) this->X = settings.value(#X).toBool();
PROTOCOLS(MAC)
#undef MAC
settings.endGroup();
}
bool ProtocolSetup::isSchemeSupported(QString const & _scheme) const
{
auto scheme = _scheme.toLower();
#define MAC(X) if(scheme == #X) return this->X;
PROTOCOLS(MAC)
#undef MAC
// built-in schemes:
if(scheme == "about") return true;
if(scheme == "file") return true;
return false;
}
|