summaryrefslogtreecommitdiff
path: root/noncore/net/opieirc
authorskyhusker <skyhusker>2005-06-09 17:16:59 (UTC)
committer skyhusker <skyhusker>2005-06-09 17:16:59 (UTC)
commit6be140832d97bb485ba98bc9ea0f5cf622330595 (patch) (unidiff)
tree48419a2990ea7f4ad815f0b113b92cff9137dddf /noncore/net/opieirc
parent855e272549619c02efac516b2cd17828d7a3ad68 (diff)
downloadopie-6be140832d97bb485ba98bc9ea0f5cf622330595.zip
opie-6be140832d97bb485ba98bc9ea0f5cf622330595.tar.gz
opie-6be140832d97bb485ba98bc9ea0f5cf622330595.tar.bz2
Fix bug 1666
Diffstat (limited to 'noncore/net/opieirc') (more/less context) (show whitespace changes)
-rw-r--r--noncore/net/opieirc/ircchannel.cpp6
-rw-r--r--noncore/net/opieirc/ircchannel.h1
-rw-r--r--noncore/net/opieirc/ircservereditor.cpp7
3 files changed, 12 insertions, 2 deletions
diff --git a/noncore/net/opieirc/ircchannel.cpp b/noncore/net/opieirc/ircchannel.cpp
index 5d81596..b9e377d 100644
--- a/noncore/net/opieirc/ircchannel.cpp
+++ b/noncore/net/opieirc/ircchannel.cpp
@@ -43,6 +43,12 @@ IRCChannelPerson *IRCChannel::getPerson(QString nickname) {
43 return it.current(); 43 return it.current();
44 } 44 }
45 } 45 }
46 return 0; 46 return 0;
47} 47}
48 48
49bool IRCChannel::isValid(const QString &channel)
50{
51 return ( channel.startsWith("#") || channel.startsWith("&")
52 || channel.startsWith("+") || channel.startsWith("!"));
53}
54
diff --git a/noncore/net/opieirc/ircchannel.h b/noncore/net/opieirc/ircchannel.h
index a276f10..001f5bb 100644
--- a/noncore/net/opieirc/ircchannel.h
+++ b/noncore/net/opieirc/ircchannel.h
@@ -46,12 +46,13 @@ public:
46 /* hasPeople identifies whether the irc channel is 46 /* hasPeople identifies whether the irc channel is
47 done synchronizing with the current state - 47 done synchronizing with the current state -
48 this is only relevant when joining a channel */ 48 this is only relevant when joining a channel */
49 void setHasPeople(bool hasPeople); 49 void setHasPeople(bool hasPeople);
50 QString channelname(); 50 QString channelname();
51 bool hasPeople(); 51 bool hasPeople();
52 static bool isValid(const QString &channel);
52protected: 53protected:
53 QList<IRCChannelPerson> m_people; 54 QList<IRCChannelPerson> m_people;
54 QString m_channelname; 55 QString m_channelname;
55 bool m_hasPeople; 56 bool m_hasPeople;
56}; 57};
57 58
diff --git a/noncore/net/opieirc/ircservereditor.cpp b/noncore/net/opieirc/ircservereditor.cpp
index 1fda868..e5c9ab5 100644
--- a/noncore/net/opieirc/ircservereditor.cpp
+++ b/noncore/net/opieirc/ircservereditor.cpp
@@ -1,7 +1,8 @@
1#include "ircservereditor.h" 1#include "ircservereditor.h"
2#include "ircchannel.h"
2 3
3/* OPIE */ 4/* OPIE */
4#include <qpe/qpeapplication.h> 5#include <qpe/qpeapplication.h>
5 6
6/* QT */ 7/* QT */
7#include <qmessagebox.h> 8#include <qmessagebox.h>
@@ -66,14 +67,16 @@ void IRCServerEditor::accept() {
66 // QMessageBox::critical(this, tr("Error"), tr("Realname required")); 67 // QMessageBox::critical(this, tr("Error"), tr("Realname required"));
67 else { 68 else {
68 /* Now verify whether the channel list has a valid format */ 69 /* Now verify whether the channel list has a valid format */
69 QStringList channels = QStringList::split(QChar(','), m_channels->text()); 70 QStringList channels = QStringList::split(QChar(','), m_channels->text());
70 for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) { 71 for (QStringList::Iterator it = channels.begin(); it != channels.end(); ++it) {
71 QString channelName = (*it).stripWhiteSpace(); 72 QString channelName = (*it).stripWhiteSpace();
72 if (!channelName.startsWith("#") && !channelName.startsWith("+")) { 73 if (!IRCChannel::isValid(channelName)) {
73 QMessageBox::critical(this, tr("Error"), tr("The channel list needs to contain a\ncomma separated list of channel\n names which start with either '#' or '+'")); 74 QMessageBox::critical(this, tr("Error"), tr("The channel list needs to contain a\ncomma "
75 "separated list of valid\n channel names (starting \n"
76 "with one of '#' '+' '&' '!'"));
74 return; 77 return;
75 } 78 }
76 } 79 }
77 QDialog::accept(); 80 QDialog::accept();
78 } 81 }
79} 82}