Blob Blame History Raw
From 32de657700902551f600de836021361ef965bb36 Mon Sep 17 00:00:00 2001
From: Giuseppe Silletti <sillettig@gmail.com>
Date: Fri, 17 Feb 2017 11:14:39 +0100
Subject: [PATCH 39/47] Fix Gpodder credential service without kwallet

Before to fix this bug, the gpodder plugin had problems with saving username and password in plain text.

There were two problems:

1) A useless space for the variable m_ignoreWallet was saved in the config file
2) The saving of the credential in plain text where made in the wrong way.
Now it is called the function askAboutMissingKWallet(), that make the use see a dialog windows where is asked to save the credential in plain text.
Credential are now saved in the textDialogYes slot.

REVIEW: 122797
---
 src/services/gpodder/GpodderServiceConfig.cpp | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/services/gpodder/GpodderServiceConfig.cpp b/src/services/gpodder/GpodderServiceConfig.cpp
index 9098d59..47ebd39 100644
--- a/src/services/gpodder/GpodderServiceConfig.cpp
+++ b/src/services/gpodder/GpodderServiceConfig.cpp
@@ -131,11 +131,6 @@ GpodderServiceConfig::save()
         if( m_wallet->writePassword( "gpodder_password", m_password ) != 0 )
             debug() << "Failed to save gpodder.net pw to kwallet!";
     }
-    else if( m_ignoreWallet )
-    {
-        config.writeEntry( "username", m_username );
-        config.writeEntry( "password", m_password );
-    }
     else
     {
         if( m_enableProvider )
@@ -212,7 +207,9 @@ GpodderServiceConfig::textDialogYes() //SLOT
         KConfigGroup config = KGlobal::config()->group( configSectionName() );
 
         m_ignoreWallet = true;
-        config.writeEntry( "ignoreWallet ", m_ignoreWallet );
+        config.writeEntry( "ignoreWallet", m_ignoreWallet );
+        config.writeEntry( "username", m_username );
+        config.writeEntry( "password", m_password );
 
         config.sync();
     }
@@ -228,7 +225,9 @@ GpodderServiceConfig::textDialogNo() //SLOT
         KConfigGroup config = KGlobal::config()->group( configSectionName() );
 
         m_ignoreWallet = false;
-        config.writeEntry( "ignoreWallet ", m_ignoreWallet );
+        config.writeEntry( "ignoreWallet", m_ignoreWallet );
+        config.writeEntry( "username", QString() );
+        config.writeEntry( "password", QString() );
 
         config.sync();
     }
-- 
2.9.3