File 0010-fix-crash-when-more-than-one-user-exists-and-we-pre-.patch of Package polkit-kde-agent-5

From b709d88f46a382937635b424d2b04ac70ad16dbc Mon Sep 17 00:00:00 2001
From: Philip Muskovac <yofel@gmx.net>
Date: Tue, 14 Aug 2012 19:30:30 +0200
Subject: [PATCH 1/1] fix crash when more than one user exists and we
 pre-select one

REVIEW: 106006
---
 AuthDialog.cpp        | 1 -
 policykitlistener.cpp | 9 ++++++---
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/AuthDialog.cpp b/AuthDialog.cpp
index 34aac16..f2c4886 100644
--- a/AuthDialog.cpp
+++ b/AuthDialog.cpp
@@ -236,7 +236,6 @@ void AuthDialog::createUserCB(const PolkitQt1::Identity::List &identities)
             userCB->setCurrentIndex(currentUserIndex);
         }
         userCB->show();
-        userCB->setFocus();
     }
 }
 
diff --git a/policykitlistener.cpp b/policykitlistener.cpp
index 459b73f..6da9461 100644
--- a/policykitlistener.cpp
+++ b/policykitlistener.cpp
@@ -81,9 +81,6 @@ void PolicyKitListener::initiateAuthentication(const QString &actionId,
     m_cookie = cookie;
     m_result = result;
     m_session.clear();
-    if (identities.length() == 1) {
-        m_selectedUser = identities[0];
-    }
 
     m_inProgress = true;
 
@@ -104,6 +101,12 @@ void PolicyKitListener::initiateAuthentication(const QString &actionId,
     KWindowSystem::forceActiveWindow(m_dialog.data()->winId());
     kDebug() << "WinId of the shown dialog is " << m_dialog.data()->winId() << m_dialog.data()->effectiveWinId();
 
+    if (identities.length() == 1) {
+        m_selectedUser = identities[0];
+    } else {
+        m_selectedUser = m_dialog.data()->adminUserSelected();
+    }
+
     m_numTries = 0;
     tryAgain();
 }
-- 
1.9.3

openSUSE Build Service is sponsored by