[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdenetwork/kopete/libkopete/ui
From:       Will Stephenson <wstephenson () kde ! org>
Date:       2008-04-17 21:02:03
Message-ID: 1208466123.969848.27923.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 798268 by wstephens:

If the password was not retrieved from the wallet, but the user changes
it, check the remember checkbox normally.
This stops a copy of only kopeterc but not the wallet from .kde to
.kde4 from preventing the password from ever being saved.

https://bugzilla.novell.com/show_bug.cgi?id=368087



 M  +17 -2     kopetepasswordwidget.cpp  
 M  +1 -0      kopetepasswordwidget.h  


--- trunk/KDE/kdenetwork/kopete/libkopete/ui/kopetepasswordwidget.cpp #798267:798268
@@ -65,7 +65,8 @@
 void Kopete::UI::PasswordWidget::load( Kopete::Password *source )
 {
 	disconnect( mRemembered, SIGNAL( stateChanged( int ) ), this, SLOT( slotRememberChanged() ) );
-	disconnect( mPassword, SIGNAL( textChanged( const QString & ) ), this, SIGNAL( changed() ) );
+	disconnect( mPassword, SIGNAL( textChanged( const QString & ) ),
+			this, SLOT( passwordTextChanged() ) );
 	disconnect( mRemembered, SIGNAL( stateChanged( int ) ), this, SIGNAL( changed() ) );
 
 	if ( source && source->remembered() )
@@ -83,7 +84,8 @@
 	}
 
 	connect( mRemembered, SIGNAL( stateChanged( int ) ), this, SLOT( slotRememberChanged() ) );
-	connect( mPassword, SIGNAL( textChanged( const QString & ) ), this, SIGNAL( changed() ) );
+	connect( mPassword, SIGNAL( textChanged( const QString & ) ),
+			this, SLOT( passwordTextChanged() ) );
 	connect( mRemembered, SIGNAL( stateChanged( int ) ), this, SIGNAL( changed() ) );
 
 	emit changed();
@@ -151,6 +153,19 @@
 	mPassword->setEnabled( remember() );
 }
 
+void Kopete::UI::PasswordWidget::passwordTextChanged()
+{
+	if ( mRemembered->checkState() == Qt::PartiallyChecked )
+	{
+		disconnect( mRemembered, SIGNAL( stateChanged( int ) ), this, SIGNAL( changed() ) );
+		// switch out of 'waiting for wallet' mode if we're in it
+		mRemembered->setTristate( false );
+		mRemembered->setChecked(true);
+		connect( mRemembered, SIGNAL( stateChanged( int ) ), this, SIGNAL( changed() ) );
+	}
+	emit changed();
+}
+
 #include "kopetepasswordwidget.moc"
 
 // vim: set noet ts=4 sts=4 sw=4:
--- trunk/KDE/kdenetwork/kopete/libkopete/ui/kopetepasswordwidget.h #798267:798268
@@ -104,6 +104,7 @@
 
 private slots:
 	void slotRememberChanged();
+	void passwordTextChanged();
 
 private:
 	class Private;
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic