Bug 128022

Summary: kwalletmanager remains in session when not wanted
Product: [Applications] kwalletmanager Reporter: David Anderson <david>
Component: generalAssignee: George Staikos <staikos>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Fedora RPMs   
OS: Linux   
Latest Commit: Version Fixed In:

Description David Anderson 2006-05-25 16:52:32 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    Fedora RPMs
OS:                Linux

kwalletmanager has an option "Hide system tray icon when last wallet closes", which I have checked.

However, if I log out before the last wallet closes, and log in again, then no wallets are open, but kwalletmanager still loads as part of my session. And it never hides itself.

As a consequence, sooner or later, kwalletmanager becomes a permanent part of the session until I quit it manually.

Suggested fix: kwalletmanager should not start up in the new session if it has this option selected.
Comment 1 George Staikos 2006-05-26 18:41:28 UTC
SVN commit 545035 by staikos:

don't show the manager on session restore if there are no wallets open and
auto-close is enabled.
BUG: 128022


 M  +10 -2     kwalletmanager.cpp  


--- branches/KDE/3.5/kdeutils/kwallet/kwalletmanager.cpp #545034:545035
@@ -59,18 +59,26 @@
 		_tray = new KSystemTray(this, "kwalletmanager tray");
 		_tray->setPixmap(loadSystemTrayIcon("wallet_closed"));
 		QToolTip::add(_tray, i18n("KDE Wallet: No wallets open."));
-		connect(_tray,SIGNAL(quitSelected()),SLOT(shuttingDown()));
+		connect(_tray, SIGNAL(quitSelected()), SLOT(shuttingDown()));
 		QStringList wl = KWallet::Wallet::walletList();
+		bool isOpen = false;
 		for (QStringList::Iterator it = wl.begin(); it != wl.end(); ++it) {
 			if (KWallet::Wallet::isOpen(*it)) {
 				_tray->setPixmap(loadSystemTrayIcon("wallet_open"));
 				QToolTip::remove(_tray);
 				QToolTip::add(_tray, i18n("KDE Wallet: A wallet is open."));
+				isOpen = true;
 				break;
 			}
 		}
+		if (!isOpen && kapp->isRestored()) {
+			delete _tray;
+			_tray = 0L;
+			kapp->exit();
+			return;
+		}
 	} else {
-		_tray = 0;
+		_tray = 0L;
 	}
 
 	_iconView = new KWalletIconView(this, "kwalletmanager icon view");
Comment 2 John Stamp 2006-06-16 15:32:59 UTC
It looks like this is causing a couple of problems on Debian.

kwalletmanager will not show a wallet on system restore, even after a wallet is opened:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=372258

kwalletmanager crashes on logout:
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=372564
Comment 3 George Staikos 2006-06-16 22:09:32 UTC
Just put a patch in trunk and branch.  Does that help?
Comment 4 R.F. Pels 2006-08-19 11:33:04 UTC
Do we have a regression here? I'm running 3.5.4 and kwalletmanager does not show while I do have the option to stay open after all wallets are closed. In order to make kwalletmanager 'work' (that is, show itself) I need to kill and restart it now...