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