Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
ParameterServiceRabbitVNC.cpp
1// Author: Kang Lin <kl222@126.com>
2
3#include "ParameterServiceRabbitVNC.h"
4#include <QSettings>
5#include <QLoggingCategory>
6Q_DECLARE_LOGGING_CATEGORY(RabbitVNC)
7
8CParameterServiceRabbitVNC::CParameterServiceRabbitVNC(QObject *parent)
9 : CParameterService(parent)
10{
11 setPort(5900);
12 m_bIce = false;
13 m_bEnableSocket = true;
14}
15
16CParameterServiceRabbitVNC::~CParameterServiceRabbitVNC()
17{
18 qDebug(RabbitVNC) << "CParameterServiceTigerVNC::~CParameterServiceTigerVNC";
19}
20
21int CParameterServiceRabbitVNC::Load(const QString& szFile)
22{
23 int nRet = CParameterService::Load(szFile);
24 QSettings set(szFile, QSettings::IniFormat);
25 m_bIce = set.value("Channel/Enable/ICE", m_bIce).toBool();
26 m_bEnableSocket = set.value("Channel/Enable/Socket", GetEnableSocket()).toBool();
27 return nRet;
28}
29
30int CParameterServiceRabbitVNC::Save(const QString& szFile)
31{
32 int nRet = CParameterService::Save(szFile);
33 QSettings set(szFile, QSettings::IniFormat);
34 set.setValue("Channel/Enable/ICE", m_bIce);
35 set.setValue("Channel/Enable/Socket", m_bEnableSocket);
36 set.sync();
37 return nRet;
38}
39
40bool CParameterServiceRabbitVNC::getIce() const
41{
42 return m_bIce;
43}
44
45void CParameterServiceRabbitVNC::setIce(bool newBIce)
46{
47 if (m_bIce == newBIce)
48 return;
49 m_bIce = newBIce;
50 emit sigIceChanged();
51}
52
53bool CParameterServiceRabbitVNC::GetEnableSocket() const
54{
55 return m_bEnableSocket;
56}
57
58void CParameterServiceRabbitVNC::SetEnableSocket(bool newSocket)
59{
60 if (m_bEnableSocket == newSocket)
61 return;
62 m_bEnableSocket = newSocket;
63 emit sigEnableSocketChanged(m_bEnableSocket);
64}