summaryrefslogtreecommitdiffstats
path: root/konversation/src/serversettings.cpp
blob: 3be7bc4b743b72805a7fdb3dae48c4871a77d1db (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
/*
  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 <psn@linux.se>
  Copyright (C) 2008 Eike Hein <hein@kde.org>
*/

#include "serversettings.h"


namespace Konversation
{

    ServerSettings::ServerSettings()
    {
        setPort(6667);
        setSSLEnabled(false);
    }

    ServerSettings::ServerSettings(const ServerSettings& settings)
    {
        setHost(settings.host());
        setPort(settings.port());
        setPassword(settings.password());
        setSSLEnabled(settings.SSLEnabled());
    }

    ServerSettings::ServerSettings(const TQString& host)
    {
        setHost(host);
        setPort(6667);
        setSSLEnabled(false);
    }

    ServerSettings::~ServerSettings()
    {
    }

    bool ServerSettings::operator==(const ServerSettings& settings) const
    {
        if (m_host.lower() == settings.host().lower()
            && m_port == settings.port()
            && m_password == settings.password()
            && m_SSLEnabled == settings.SSLEnabled())
        {
            return true;
        }
        else
            return false;
    }

    void ServerSettings::setHost(const TQString& host)
    {
        m_host = host.stripWhiteSpace();
    }

    void ServerSettings::setPassword(const TQString& password)
    {
        m_password = password.stripWhiteSpace();
    }
}