diff --git a/src/irc/serversettings.cpp b/src/irc/serversettings.cpp index f5b76ebb..66652bc8 100644 --- a/src/irc/serversettings.cpp +++ b/src/irc/serversettings.cpp @@ -1,66 +1,60 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ /* Copyright (C) 2004 Peter Simonsson Copyright (C) 2008 Eike Hein */ #include "serversettings.h" namespace Konversation { ServerSettings::ServerSettings() { setPort(6667); setSSLEnabled(false); setBypassProxy(false); } - ServerSettings::ServerSettings(const ServerSettings& settings) - { - setHost(settings.host()); - setPort(settings.port()); - setPassword(settings.password()); - setSSLEnabled(settings.SSLEnabled()); - setBypassProxy(settings.bypassProxy()); - } + ServerSettings::ServerSettings(const ServerSettings& settings) = default; + ServerSettings &ServerSettings::operator=(const ServerSettings& settings) = default; ServerSettings::ServerSettings(const QString& host) { setHost(host); setPort(6667); setSSLEnabled(false); setBypassProxy(false); } bool ServerSettings::operator==(const ServerSettings& settings) const { if (m_host.toLower() == settings.host().toLower() && m_port == settings.port() && m_password == settings.password() && m_SSLEnabled == settings.SSLEnabled() && m_bypassProxy == settings.bypassProxy()) { return true; } else return false; } void ServerSettings::setHost(const QString& host) { m_host = host.trimmed(); } void ServerSettings::setPassword(const QString& password) { m_password = password.trimmed(); } } diff --git a/src/irc/serversettings.h b/src/irc/serversettings.h index 6631cd5a..4bdecd87 100644 --- a/src/irc/serversettings.h +++ b/src/irc/serversettings.h @@ -1,55 +1,57 @@ /* This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. */ /* Copyright (C) 2004 Peter Simonsson Copyright (C) 2008 Eike Hein */ #ifndef KONVERSATIONSERVERSETTINGS_H #define KONVERSATIONSERVERSETTINGS_H #include namespace Konversation { class ServerSettings { public: ServerSettings(); ServerSettings(const ServerSettings& settings); explicit ServerSettings(const QString& host); + ServerSettings &operator=(const ServerSettings& settings); + void setHost(const QString& host); QString host() const { return m_host; } void setPort(int port) { m_port = port; } int port() const { return m_port;} void setPassword(const QString& password); QString password() const { return m_password; } void setSSLEnabled(bool enabled) { m_SSLEnabled = enabled; } bool SSLEnabled() const { return m_SSLEnabled; } void setBypassProxy(bool bypass) { m_bypassProxy = bypass; } bool bypassProxy() const { return m_bypassProxy; } bool operator== (const ServerSettings& settings) const; private: QString m_host; int m_port; QString m_password; bool m_SSLEnabled; bool m_bypassProxy; }; } #endif