4#include "ParameterFtpServer.h"
6CParameterFtpServer::CParameterFtpServer(QObject *parent,
const QString &szPrefix)
9 , m_bAnonymousLogin(false)
19 m_Net.m_User.SetSavePassword(
true);
20 m_Net.SetEnablleUI(CParameterNet::SHOW_UI::Port | CParameterNet::SHOW_UI::User);
23bool CParameterFtpServer::GetAnonymousLogin()
const
25 return m_bAnonymousLogin;
28void CParameterFtpServer::SetAnonymousLogin(
bool newAnonymousLogin)
30 if(m_bAnonymousLogin == newAnonymousLogin)
32 m_bAnonymousLogin = newAnonymousLogin;
36bool CParameterFtpServer::GetReadOnly()
const
41void CParameterFtpServer::SetReadOnly(
bool newReadOnly)
43 if(m_bReadOnly == newReadOnly)
45 m_bReadOnly = newReadOnly;
49QString CParameterFtpServer::GetRoot()
const
54void CParameterFtpServer::SetRoot(
const QString &newRoot)
56 if(m_szRoot == newRoot)
64 return m_ConnectCount;
67void CParameterFtpServer::SetConnectCount(
int newConnectCount)
69 if(m_ConnectCount == newConnectCount)
71 m_ConnectCount = newConnectCount;
75bool CParameterFtpServer::GetListenAll()
const
80void CParameterFtpServer::SetListenAll(
bool newListenAll)
82 if(m_bListenAll == newListenAll)
84 m_bListenAll = newListenAll;
88QStringList CParameterFtpServer::GetListen()
const
93void CParameterFtpServer::SetListen(
const QStringList &newListen)
95 if(m_Listen == newListen)
101QStringList CParameterFtpServer::GetWhitelist()
const
106void CParameterFtpServer::SetWhitelist(
const QStringList &newWhitelist)
108 if(m_Whitelist == newWhitelist)
110 m_Whitelist = newWhitelist;
114QStringList CParameterFtpServer::GetBlacklist()
const
119void CParameterFtpServer::SetBlacklist(
const QStringList &newBlacklist)
121 if(m_Blacklist == newBlacklist)
123 m_Blacklist = newBlacklist;
127int CParameterFtpServer::OnLoad(QSettings &set)
129 SetRoot(set.value(
"Root", GetRoot()).toString());
130 SetAnonymousLogin(set.value(
"AnonemousLogin", GetAnonymousLogin()).toBool());
131 SetReadOnly(set.value(
"ReadOnly", GetReadOnly()).toBool());
133 SetListenAll(set.value(
"ListenAll", GetListenAll()).toBool());
134 SetListen(set.value(
"Listen", GetListen()).toStringList());
135 SetWhitelist(set.value(
"List/White", GetWhitelist()).toStringList());
136 SetBlacklist(set.value(
"List/Black", GetBlacklist()).toStringList());
140int CParameterFtpServer::OnSave(QSettings &set)
142 set.setValue(
"Root", GetRoot());
143 set.setValue(
"AnonemousLogin", GetAnonymousLogin());
144 set.setValue(
"ReadOnly", GetReadOnly());
146 set.setValue(
"ListenAll", GetListenAll());
147 set.setValue(
"Listen", GetListen());
148 set.setValue(
"List/White", GetWhitelist());
149 set.setValue(
"List/Black", GetBlacklist());
int GetConnectCount() const
Connect count.
int SetModified(bool bModified=true)
在设置参数时,如果有修改,则调用。