ircnetworkconnectioninfo.h
1 //------------------------------------------------------------------------------
2 // ircnetworkconnectioninfo.h
3 //------------------------------------------------------------------------------
4 //
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
9 //
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
14 //
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
18 // 02110-1301, USA.
19 //
20 //------------------------------------------------------------------------------
21 // Copyright (C) 2010 "Zalewa" <zalewapl@gmail.com>
22 //------------------------------------------------------------------------------
23 #ifndef __IRCNETWORKCONNECTIONINFO_H__
24 #define __IRCNETWORKCONNECTIONINFO_H__
25 
26 #include <QHostAddress>
27 #include <QString>
28 #include "irc/entities/ircnetworkentity.h"
29 #include "strings.h"
30 
36 {
37  public:
42  QString alternateNick;
43 
48 
53  QString nick;
54 
58  QString realName;
59 
69  {
70  if (nick.isEmpty())
71  {
72  nick = "Doomseeker_" + Strings::createRandomAlphaNumericString(4);
73  }
74 
75  if (alternateNick.isEmpty())
76  {
77  alternateNick = nick + "`";
78  }
79 
80  if (realName.isEmpty())
81  {
82  realName = nick;
83  }
84  }
85 };
86 
87 #endif
Struct containing information about client's connection to the IRC server.
IRCNetworkEntity networkEntity
Information about the network to which we will connect.
void fillInMissingFields()
Fills missing data with presets.
Data structure that describes and defines a connection to an IRC network or server.
QString realName
User's real name. Optional.
QString alternateNick
Alternate nickname in case if ' nick ' is taken when connecting.
QString nick
Original nickname. This variable will always store the current nickname of the client.
static QString createRandomAlphaNumericString(unsigned numChars)
Creates a random string with specified length.
Definition: strings.cpp:169