Bug 112058 - Creates blank channel if nothing is entered
Summary: Creates blank channel if nothing is entered
Status: RESOLVED FIXED
Alias: None
Product: konversation
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Konversation Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-09-05 03:56 UTC by Alex Somerset
Modified: 2006-01-07 07:49 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Somerset 2005-09-05 03:56:18 UTC
Version:           0.18 #3016 (using KDE 3.4.2, Kubuntu Package 4:3.4.2-0ubuntu4 )
Compiler:          Target: i486-linux-gnu
OS:                Linux (i686) release 2.6.12-8-k7

This is a pretty minor bug, but i still thought i should report it anyway. 

when you are adding a channel to a network to autoconnect to and you leave it blank and hit OK, it creates a blank entry in the channel list and it attempts to connect to it.
Comment 1 Eike Hein 2006-01-07 07:49:45 UTC
SVN commit 495122 by hein:

Prevent addition of nameless channels and hostless servers
in ServerGroupDialog.
BUG:112058


 M  +12 -0     channeldialog.cpp  
 M  +5 -1      channeldialog.h  
 M  +12 -0     serverdialog.cpp  
 M  +5 -1      serverdialog.h  


--- trunk/extragear/network/konversation/src/channeldialog.cpp #495121:495122
@@ -14,6 +14,7 @@
 #include <qlineedit.h>
 
 #include <klocale.h>
+#include <kmessagebox.h>
 
 #include "channeldialog.h"
 #include "servergroupsettings.h"
@@ -64,6 +65,17 @@
         return channel;
     }
 
+    void ChannelDialog::slotOk()
+    {
+        if (m_channelEdit->text().isEmpty())
+        {
+            KMessageBox::error(this, i18n("The channel name is required."));
+        }
+        else
+        {
+            accept();
+        }
+    }
 }
 
 #include "channeldialog.moc"
--- trunk/extragear/network/konversation/src/channeldialog.h #495121:495122
@@ -24,13 +24,17 @@
     class ChannelDialog : public KDialogBase
     {
         Q_OBJECT
-            public:
+
+        public:
             ChannelDialog(const QString& title, QWidget *parent = 0, const char *name = 0);
             ~ChannelDialog();
 
             void setChannelSettings(const ChannelSettings& channel);
             ChannelSettings channelSettings();
 
+        protected slots:
+            void slotOk();
+
         private:
             QLineEdit* m_channelEdit;
             QLineEdit* m_passwordEdit;
--- trunk/extragear/network/konversation/src/serverdialog.cpp #495121:495122
@@ -20,6 +20,7 @@
 #include <qwhatsthis.h>
 
 #include <klocale.h>
+#include <kmessagebox.h>
 
 #include "serversettings.h"
 
@@ -86,6 +87,17 @@
         return server;
     }
 
+    void ServerDialog::slotOk()
+    {
+        if (m_serverEdit->text().isEmpty())
+        {
+            KMessageBox::error(this, i18n("The server address is required."));
+        }
+        else
+        {
+            accept();
+        }
+    }
 }
 
 #include "serverdialog.moc"
--- trunk/extragear/network/konversation/src/serverdialog.h #495121:495122
@@ -26,13 +26,17 @@
     class ServerDialog : public KDialogBase
     {
         Q_OBJECT
-            public:
+
+        public:
             ServerDialog(const QString& title, QWidget *parent = 0, const char *name = 0);
             ~ServerDialog();
 
             void setServerSettings(const ServerSettings& server);
             ServerSettings serverSettings();
 
+        protected slots:
+            void slotOk();
+
         private:
             QLineEdit* m_serverEdit;
             QSpinBox* m_portSBox;