[prev in list] [next in list] [prev in thread] [next in thread]
List: kopete-devel
Subject: Re: [Kopete-devel] [Patch] Fix for bug #68416
From: Till Gerken <till () tantalo ! net>
Date: 2003-11-30 21:15:23
[Download RAW message or body]
[Attachment #2 (multipart/signed)]
[Attachment #4 (multipart/mixed)]
On Sunday 30 November 2003 21:54, Martijn Klingens wrote:
> On Sunday 30 November 2003 21:47, Till Gerken wrote:
> > +void JabberEditAccountWidget::toggleJIDValidation ()
> > +{
> > + revalidateJID = true;
> > +}
>
> Nitpicking: either it should read 'revalidateJID = !revalidateJID' or the
> method should be renamed to setJIDValidation, because this isn't called
> toggling :)
That's true.
> One question: is it possible to trigger a case when no validation is
> needed? I'd say when the text is restored to the original value, but that
> requires so much code to get right it's no fun and I'm not asking you for
> that (there's stuff like the new config compiler to handle that IIRC, never
> tried it). Can't think of another case.
There are two cases: JID=tigloo@jabber.org, Server=myjabber.org
Changing the server to jabber.org requires no validation but this is dealt
with correctly as jabber.org already appears in your JID.
Second case is where the server was myjabber.org, you changed it to
myjabber2.org and then back to myjabber.org without having clicked "ok". This
is not caught. However, it should be easy to fix this by simply verifying the
supplied string with the one currently stored in the plugin data. I will add
that.
I have appended a new version of the patch will all the mentioned changes. I
wish I'd also know why my signature breaks when attaching files.
Till
["serverchange.diff" (text/x-diff)]
Index: jabbereditaccountwidget.cpp
===================================================================
RCS file: /home/kde/kdenetwork/kopete/protocols/jabber/ui/jabbereditaccountwidget.cpp,v
retrieving revision 1.23
diff -u -p -r1.23 jabbereditaccountwidget.cpp
--- jabbereditaccountwidget.cpp 22 Oct 2003 21:01:27 -0000 1.23
+++ jabbereditaccountwidget.cpp 30 Nov 2003 21:14:05 -0000
@@ -55,6 +55,9 @@ JabberEditAccountWidget::JabberEditAccou
connect (leProxyUser, SIGNAL (textChanged (const QString &)), this, SLOT (configChanged ()));
connect (leProxyPass, SIGNAL (textChanged (const QString &)), this, SLOT (configChanged ()));
+ connect (mID, SIGNAL (textChanged (const QString &)), this, SLOT (setJIDValidation ()));
+ connect (mServer, SIGNAL (textChanged (const QString &)), this, SLOT (setJIDValidation ()));
+
connect (btnRegister, SIGNAL (clicked ()), this, SLOT (registerClicked ()));
connect (chkUseSSL, SIGNAL (toggled (bool)), this, SLOT (sslToggled (bool)));
@@ -112,13 +115,16 @@ void JabberEditAccountWidget::reopen ()
leProxyPass->setText (account()->pluginData (m_protocol, "ProxyPass"));
mAutoConnect->setChecked (account()->autoLogin());
+ revalidateJID = false;
+
}
KopeteAccount *JabberEditAccountWidget::apply ()
{
kdDebug (14180) << "JabberEditAccount::apply()" << endl;
- validateJID();
+ if(revalidateJID)
+ validateJID();
if (!account())
{
@@ -263,6 +269,16 @@ void JabberEditAccountWidget::configChan
settings_changed = true;
}
+void JabberEditAccountWidget::setJIDValidation ()
+{
+
+ if(account ()->pluginData(m_protocol, "Server") == mServer->text ())
+ revalidateJID = false;
+ else
+ revalidateJID = true;
+
+}
+
void JabberEditAccountWidget::registerClicked ()
{
Index: jabbereditaccountwidget.h
===================================================================
RCS file: /home/kde/kdenetwork/kopete/protocols/jabber/ui/jabbereditaccountwidget.h,v
retrieving revision 1.9
diff -u -p -r1.9 jabbereditaccountwidget.h
--- jabbereditaccountwidget.h 22 Oct 2003 21:01:27 -0000 1.9
+++ jabbereditaccountwidget.h 30 Nov 2003 21:14:05 -0000
@@ -47,6 +47,8 @@ public:
bool settings_changed;
private:
+ bool revalidateJID;
+
void reopen ();
void writeConfig ();
JabberProtocol *m_protocol;
@@ -55,6 +57,7 @@ private slots:
void registerClicked ();
void sslToggled (bool);
void configChanged ();
+ void setJIDValidation ();
void validateJID ();
};
[Attachment #8 (application/pgp-signature)]
_______________________________________________
Kopete-devel mailing list
Kopete-devel@kde.org
https://mail.kde.org/mailman/listinfo/kopete-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic