3#include "ParameterServer.h"
5CParameterServer::CParameterServer(QObject *parent,
const QString &szPrefix)
8 , m_WhiteFilter(this,
"WhiteFilter")
9 , m_BlackFilter(this,
"BlackFilter")
10 , m_bAnonymousLogin(false)
12 , m_tmAuthenticate(600000)
17 m_szHostKeyFile =
"ssh_host_rsa_key";
20int CParameterServer::OnLoad(QSettings &set)
23 SetAnonymousLogin(set.value(
"AnonemousLogin", GetAnonymousLogin()).toBool());
24 SetReadOnly(set.value(
"ReadOnly", GetReadOnly()).toBool());
25 SetRoot(set.value(
"Root", GetRoot()).toString());
26 SetHostKeyFile(set.value(
"HostKeyFile", GetHostKeyFile()).toString());
30 SetListenAll(set.value(
"ListenAll", GetListenAll()).toBool());
31 SetListen(set.value(
"Listen", GetListen()).toStringList());
35int CParameterServer::OnSave(QSettings &set)
38 set.setValue(
"AnonemousLogin", GetAnonymousLogin());
39 set.setValue(
"ReadOnly", GetReadOnly());
40 set.setValue(
"Root", GetRoot());
41 set.setValue(
"HostKeyFile", GetHostKeyFile());
45 set.setValue(
"ListenAll", GetListenAll());
46 set.setValue(
"Listen", GetListen());
50bool CParameterServer::GetAnonymousLogin()
const
52 return m_bAnonymousLogin;
55void CParameterServer::SetAnonymousLogin(
bool newAnonymousLogin)
57 if(m_bAnonymousLogin == newAnonymousLogin)
59 m_bAnonymousLogin = newAnonymousLogin;
63bool CParameterServer::GetReadOnly()
const
68void CParameterServer::SetReadOnly(
bool newReadOnly)
70 if(m_bReadOnly == newReadOnly)
72 m_bReadOnly = newReadOnly;
76QString CParameterServer::GetRoot()
const
81void CParameterServer::SetRoot(
const QString &newRoot)
83 if(m_szRoot == newRoot)
89QString CParameterServer::GetHostKeyFile()
const
91 return m_szHostKeyFile;
94void CParameterServer::SetHostKeyFile(
const QString &key)
96 if(m_szHostKeyFile == key)
98 m_szHostKeyFile = key;
104 return m_tmAuthenticate;
109 if(m_tmAuthenticate == tm)
111 m_tmAuthenticate = tm;
117 return m_AuthAttempts;
122 if(m_AuthAttempts == attempts)
124 m_AuthAttempts = attempts;
130 return m_ConnectCount;
133void CParameterServer::SetConnectCount(
int newConnectCount)
135 if(m_ConnectCount == newConnectCount)
137 m_ConnectCount = newConnectCount;
141bool CParameterServer::GetListenAll()
const
146void CParameterServer::SetListenAll(
bool newListenAll)
148 if(m_bListenAll == newListenAll)
150 m_bListenAll = newListenAll;
154QStringList CParameterServer::GetListen()
const
159void CParameterServer::SetListen(
const QStringList &newListen)
161 if(m_Listen == newListen)
163 m_Listen = newListen;
167void CParameterServer::slotSetPluginParameters()
170 m_Net.
m_User.SetSavePassphrase(
true);
CParameterUser m_User
[Instance user]
Operational parameter interface.
void SetAuthenticateTime(qint64 tm)
Set authenticate time out.
int GetAuthenticateAttempts() const
Get authenticate attempts.
qint64 GetAuthenticateTime() const
Get authenticate time out.
int GetConnectCount() const
Connect count.
void SetAuthenticateAttempts(int attempts)
Set authenticate attempts.
void SetSavePassword(bool save)
Set save password.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.