summaryrefslogtreecommitdiffstats
path: root/opensuse/core/tdelibs.old/kdesu-settings.diff
blob: fc24c09b62caf85f493a002e4fd600ec18994a2a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
Subject: Change kdesu settings
From: Lubos Lunak
Bug: 216796
Relates: kdelibs4/kdesu-settings.diff
Patch-upstream: never

Change kdesu(d) password keeping timeout only to 5 minutes and enable
it by default (to match kdesu using sudo in 10.3 behaviour).
KDE3 needs a hack in KPasswordDialog for enabling it by default.

Update: Change the timeout back to 2 hours (bnc#404521).

Index: kdesu/defaults.h
===================================================================
--- kdesu/defaults.h.orig
+++ kdesu/defaults.h
@@ -13,8 +13,9 @@
 #ifndef __Defaults_h_included__
 #define __Defaults_h_included__
 
+/*const int defTimeout = 120*60;*/
 const int defTimeout = 120*60;
 const int defEchoMode = 0;
-const int defKeep = false;
+const int defKeep = true;
 
 #endif
Index: kdeui/kpassdlg.cpp
===================================================================
--- kdeui/kpassdlg.cpp.orig
+++ kdeui/kpassdlg.cpp
@@ -49,6 +49,8 @@
 
 #include "kpassdlg.h"
 
+#include "../kdesu/defaults.h"
+
 /*
  * Password line editor.
  */
@@ -337,7 +339,8 @@ void KPasswordDialog::init()
 
     KConfig* const cfg = KGlobal::config();
     const KConfigGroupSaver saver(cfg, "Passwords");
-    if (m_Keep && cfg->readBoolEntry("Keep", false))
+    bool def = ( qstrcmp( qAppName(), "kdesu" ) == 0 ? defKeep : false );
+    if (m_Keep && cfg->readBoolEntry("Keep", def))
 	++m_Keep;
 
     m_pMain = new QWidget(this);