3#include "ParameterSftpServer.h"
5CParameterSftpServer::CParameterSftpServer(QObject *parent,
const QString &szPrefix)
7 , m_bAnonymousLogin(false)
14 SetHostKeyFile(
"/data/libssh/tests/keys/ssh_host_rsa_key");
17 SetHostKeyFile(
"D:\\source\\vcpkg\\buildtrees\\libssh\\src\\libssh-0-e5f4972781.clean\\tests\\keys\\ssh_host_rsa_key");
19 m_Net.SetEnablleUI(CParameterNet::SHOW_UI::Port | CParameterNet::SHOW_UI::User);
22int CParameterSftpServer::OnLoad(QSettings &set)
25 nRet = CParameterServer::OnLoad(set);
27 SetAnonymousLogin(set.value(
"AnonemousLogin", GetAnonymousLogin()).toBool());
28 SetReadOnly(set.value(
"ReadOnly", GetReadOnly()).toBool());
29 SetRoot(set.value(
"Root", GetRoot()).toString());
33int CParameterSftpServer::OnSave(QSettings &set)
36 nRet = CParameterServer::OnSave(set);
38 set.setValue(
"AnonemousLogin", GetAnonymousLogin());
39 set.setValue(
"ReadOnly", GetReadOnly());
40 set.setValue(
"Root", GetRoot());
44bool CParameterSftpServer::GetAnonymousLogin()
const
46 return m_bAnonymousLogin;
49void CParameterSftpServer::SetAnonymousLogin(
bool newAnonymousLogin)
51 if(m_bAnonymousLogin == newAnonymousLogin)
53 m_bAnonymousLogin = newAnonymousLogin;
57bool CParameterSftpServer::GetReadOnly()
const
62void CParameterSftpServer::SetReadOnly(
bool newReadOnly)
64 if(m_bReadOnly == newReadOnly)
66 m_bReadOnly = newReadOnly;
70QString CParameterSftpServer::GetRoot()
const
75void CParameterSftpServer::SetRoot(
const QString &newRoot)
77 if(m_szRoot == newRoot)
The server base parameters.
int SetModified(bool bModified=true)
When setting parameters, if there is a modification, it is called.