mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-12 15:25:34 +08:00
Allow to save list of "other servers"
* load / save setting called * fixed handling in server form Follow up of refs #533, related to #545
This commit is contained in:
@@ -28,6 +28,20 @@ namespace BlackMisc
|
||||
return false;
|
||||
}
|
||||
|
||||
bool CServerList::removeByName(const QString &name)
|
||||
{
|
||||
if (name.isEmpty()) { return false; }
|
||||
const CServerList copy(*this);
|
||||
bool removed = false;
|
||||
for (const CServer &server : copy)
|
||||
{
|
||||
if (!server.matchesName(name)) { continue; }
|
||||
this->remove(server);
|
||||
removed = true;
|
||||
}
|
||||
return removed;
|
||||
}
|
||||
|
||||
bool CServerList::containsAddressPort(const CServer &server)
|
||||
{
|
||||
for (const CServer &s : *this)
|
||||
|
||||
@@ -38,6 +38,9 @@ namespace BlackMisc
|
||||
//! Contains name
|
||||
bool containsName(const QString &name) const;
|
||||
|
||||
//! Remove by name
|
||||
bool removeByName(const QString &name);
|
||||
|
||||
//! Contains server with same address/port
|
||||
bool containsAddressPort(const CServer &server);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user