Hello community,

here is the log from the commit of package kgpg for openSUSE:Factory checked in 
at 2013-07-22 17:16:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/kgpg (Old)
 and      /work/SRC/openSUSE:Factory/.kgpg.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "kgpg"

Changes:
--------
--- /work/SRC/openSUSE:Factory/kgpg/kgpg.changes        2013-07-08 
07:31:45.000000000 +0200
+++ /work/SRC/openSUSE:Factory/.kgpg.new/kgpg.changes   2013-07-22 
17:16:52.000000000 +0200
@@ -1,0 +2,7 @@
+Mon Jul 15 08:13:17 UTC 2013 - [email protected]
+
+- Update to 4.10.95
+ * KDE 4.11 RC 1 release
+ * See http://www.kde.org/announcements/announce-4.11-rc1.php
+
+-------------------------------------------------------------------

Old:
----
  kgpg-4.10.90.tar.xz

New:
----
  kgpg-4.10.95.tar.xz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ kgpg.spec ++++++
--- /var/tmp/diff_new_pack.4mXhis/_old  2013-07-22 17:16:53.000000000 +0200
+++ /var/tmp/diff_new_pack.4mXhis/_new  2013-07-22 17:16:53.000000000 +0200
@@ -17,7 +17,7 @@
 
 
 Name:           kgpg
-Version:        4.10.90
+Version:        4.10.95
 Release:        0
 Summary:        Encryption Tool
 License:        GPL-2.0+

++++++ kgpg-4.10.90.tar.xz -> kgpg-4.10.95.tar.xz ++++++
Files old/kgpg-4.10.90/doc/index.cache.bz2 and 
new/kgpg-4.10.95/doc/index.cache.bz2 differ
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/keysmanager.cpp 
new/kgpg-4.10.95/keysmanager.cpp
--- old/kgpg-4.10.90/keysmanager.cpp    2013-06-10 20:53:48.000000000 +0200
+++ new/kgpg-4.10.95/keysmanager.cpp    2013-07-10 01:17:48.000000000 +0200
@@ -315,6 +315,7 @@
 
        iproxy = new KeyListProxyModel(this);
        iproxy->setKeyModel(imodel);
+       connect(this, SIGNAL(readAgainOptions()), iproxy, 
SLOT(settingsChanged()));
 
        iview = new KeyTreeView(this, iproxy);
        connect(iview, SIGNAL(doubleClicked(QModelIndex)), this, 
SLOT(defaultAction(QModelIndex)));
@@ -1299,9 +1300,13 @@
 
        genRev->deleteLater();
 
-       if (result != KGpgTransaction::TS_OK) {
+       switch (result) {
+       case KGpgTransaction::TS_OK:
+       case KGpgTransaction::TS_USER_ABORTED:
+               break;
+       default:
                KMessageBox::detailedSorry(this, i18n("Creation of the 
revocation certificate failed..."), genRev->getOutput());
-               return;
+               break;
        }
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/model/keylistproxymodel.cpp 
new/kgpg-4.10.95/model/keylistproxymodel.cpp
--- old/kgpg-4.10.90/model/keylistproxymodel.cpp        2013-06-10 
20:53:48.000000000 +0200
+++ new/kgpg-4.10.95/model/keylistproxymodel.cpp        2013-07-10 
01:17:48.000000000 +0200
@@ -1,4 +1,5 @@
 /* Copyright 2008,2009,2010,2012,2013 Rolf Eike Beer 
<[email protected]>
+ * Copyright 2013 Thomas Fischer <[email protected]>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as
@@ -43,6 +44,7 @@
        int m_previewsize;
        int m_idLength;
        KeyListProxyModel::DisplayMode m_displaymode;
+       int m_emailSorting;
 
        QString reorderEmailComponents(const QString &emailAddress) const;
        QVariant dataSingleColumn(const QModelIndex &index, int role, const 
KGpgNode *node) const;
@@ -56,78 +58,97 @@
        m_mintrust(TRUST_UNKNOWN),
        m_previewsize(22),
        m_idLength(8),
-       m_displaymode(mode)
+       m_displaymode(mode),
+       m_emailSorting(KGpgSettings::emailSorting())
 {
 }
 
+/**
+ * Reverses the list's order (this modifies the list) and returns
+ * a string containing the reversed list's elements joined by a char.
+ */
+static QString reverseListAndJoinWithChar(const QStringList &list, const QChar 
&separator)
+{
+       QString result = list.last();
+       for (int i = list.count() - 2; i >= 0; --i)
+               result.append(separator).append(list[i]);
+       return result;
+}
+
 QString
 KeyListProxyModelPrivate::reorderEmailComponents(const QString &emailAddress) 
const
 {
-       if (emailAddress.isEmpty()) return QString();
+       if (emailAddress.isEmpty())
+               return QString();
 
-       switch (KGpgSettings::emailSorting()){
+       /// split email addresses at @
+       static const QChar charAt = QLatin1Char('@');
+       /// split domain at .
+       static const QChar charDot = QLatin1Char('.');
+
+       /// convert result to lower case to make sorting case-insensitive
+       QString result = emailAddress.toLower();
+
+       switch (m_emailSorting) {
        case KGpgSettings::EnumEmailSorting::TLDfirst:
        {
-               /// split email addresses along @ and .
-               static const QRegExp emailSplitRegExp(QLatin1String("[@.]"));
                /// get components of an email address
-               /// [email protected] becomes [example, kde, org]
-               const QStringList emailComponents = 
emailAddress.split(emailSplitRegExp);
-               /// assemble result by joining components in reverse order,
-               /// separated by a dot
-               QString result;
-               foreach(const QString &component, emailComponents)
-                       result = 
result.prepend(component).prepend(QLatin1Char('.'));
-               /// convert result to lower case to make sorting 
case-insensitive
-               return result.toLower();
+               /// [email protected] becomes [john.doe, mail.kde.org]
+               const QStringList emailComponents = result.split(charAt);
+               if (emailComponents.count() != 2) /// expect an email address 
to contain exactly one @
+                       break;
+               /// get components of a domain
+               /// mail.kde.org becomes [mail, kde, org]
+               const QString fqdn = emailComponents.last();
+               QStringList fqdnComponents = fqdn.split(charDot);
+               if (fqdnComponents.count() < 2) /// if domain consists of less 
than two components ...
+                       return fqdn + charDot + emailComponents.first(); /// 
... take shortcut
+               /// prepend localpart, will be last after list is reversed
+               fqdnComponents.insert(0, emailComponents.first());
+               /// reverse components of domain, result becomes e.g. 
org.kde.mail
+               /// with localpart already in the list it becomes 
org.kde.mail.john.doe
+               result = reverseListAndJoinWithChar(fqdnComponents, charDot);
+               break;
        }
        case KGpgSettings::EnumEmailSorting::DomainFirst:
        {
-               /// split email addresses at @
-               static const QLatin1Char emailSplitAt('@');
-               /// split domain at .
-               static const QLatin1Char domainSplitDot('.');
                /// get components of an email address
-               /// [email protected] becomes [example, www.kde.org]
-               const QStringList emailComponents = 
emailAddress.split(emailSplitAt);
+               /// [email protected] becomes [john.doe, mail.kde.org]
+               const QStringList emailComponents = result.split(charAt);
                if (emailComponents.count() != 2) /// expect an email address 
to contain exactly one @
-                       return emailAddress.toLower();
+                       break;
                /// get components of a domain
-               /// www.kde.org becomes [www, kde, org]
+               /// mail.kde.org becomes [mail, kde, org]
                const QString fqdn = emailComponents.last();
-               const QStringList fqdnComponents = fqdn.split(domainSplitDot);
+               QStringList fqdnComponents = fqdn.split(charDot);
                if (fqdnComponents.count() < 2) /// if domain consists of less 
than two components ...
-                       return fqdn + domainSplitDot + emailComponents.first(); 
/// ... take shortcut
+                       return fqdn + charDot + emailComponents.first(); /// 
... take shortcut
                /// reverse last two components of domain, becomes e.g. kde.org
-               QString result = fqdnComponents[fqdnComponents.count() - 2] + 
domainSplitDot + fqdnComponents[fqdnComponents.count() - 1];
-               /// append remaining components of domain, becomes e.g. 
kde.org.www
-               for (int i = 0; i < fqdnComponents.count() - 2; ++i)
-                       result = result.append(domainSplitDot + 
fqdnComponents[i]);
-               /// append user name component of email address, becomes e.g. 
kde.org.www.example
-               result = result.append(domainSplitDot + 
emailComponents.first());
-               /// convert result to lower case to make sorting 
case-insensitive
-               return result.toLower();
+               /// TODO will fail for three-part domains like kde.org.uk
+               result = charDot + fqdnComponents.takeLast();
+               result.prepend(fqdnComponents.takeLast());
+               /// append remaining components of domain, becomes e.g. 
kde.org.mail
+               result.append(charDot).append(fqdnComponents.join(charDot));
+               /// append user name component of email address, becomes e.g. 
kde.org.mail.john.doe
+               result.append(charDot).append(emailComponents.first());
+               break;
        }
        case KGpgSettings::EnumEmailSorting::FQDNFirst:
        {
-               /// split email addresses at @
-               static const QLatin1Char emailSplitAt('@');
                /// get components of an email address
-               /// [email protected] becomes [example, kde.org]
-               const QStringList emailComponents = 
emailAddress.split(emailSplitAt);
+               /// [email protected] becomes [john.doe, mail.kde.org]
+               const QStringList emailComponents = result.split(charAt);
                /// assemble result by joining components in reverse order,
-               /// separated by a dot
-               QString result;
-               foreach(const QString &component, emailComponents)
-                       result = 
result.prepend(component).prepend(QLatin1Char('.'));
-               /// convert result to lower case to make sorting 
case-insensitive
-               return result.toLower();
-       }
-    default:
-        /// do not modify email address except for lower-case conversion
-        /// to make sorting case-insensitive
-        return emailAddress.toLower();
-    }
+               /// separated by a dot, becomes e.g. mail.kde.org.john.doe
+               result = reverseListAndJoinWithChar(emailComponents, charDot);
+               break;
+       }
+       case KGpgSettings::EnumEmailSorting::Alphabetical:
+               /// do not modify email address except for lower-case conversion
+               break;
+       }
+
+       return result;
 }
 
 QVariant
@@ -422,6 +443,19 @@
 }
 
 void
+KeyListProxyModel::settingsChanged()
+{
+       Q_D(KeyListProxyModel);
+
+       const int newSort = KGpgSettings::emailSorting();
+
+       if (newSort != d->m_emailSorting) {
+               d->m_emailSorting = newSort;
+               invalidate();
+       }
+}
+
+void
 KeyListProxyModel::setTrustFilter(const KgpgCore::KgpgKeyTrustFlag t)
 {
        Q_D(KeyListProxyModel);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/model/keylistproxymodel.h 
new/kgpg-4.10.95/model/keylistproxymodel.h
--- old/kgpg-4.10.90/model/keylistproxymodel.h  2013-05-28 21:30:19.000000000 
+0200
+++ new/kgpg-4.10.95/model/keylistproxymodel.h  2013-07-10 01:17:48.000000000 
+0200
@@ -74,6 +74,11 @@
         */
        void setOnlySecret(const bool b);
 
+       /**
+        * @brief call this when the settings have changed
+        */
+       void settingsChanged();
+
 protected:
        virtual bool lessThan(const QModelIndex &left, const QModelIndex 
&right) const;
        virtual bool filterAcceptsRow(int source_row, const QModelIndex 
&source_parent) const;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/tips new/kgpg-4.10.95/tips
--- old/kgpg-4.10.90/tips       2013-05-28 21:30:19.000000000 +0200
+++ new/kgpg-4.10.95/tips       2013-07-10 01:17:48.000000000 +0200
@@ -16,10 +16,10 @@
 </tip>
 <tip category="KGpg|app">
 <html>
-<p><strong>You do not know anything about encryption?</strong><br>
-No problem, simply create yourself a key pair in the key management window. 
Then, export your public key and mail it to your friends.<br>
+<p><strong>You do not have to be an expert in encryption to use this 
tool?</strong><br>
+Simply create yourself a key pair in the key management window. Then, export 
your public key and mail it to your friends.<br>
 Ask them to do the same and import their public keys. Finally, to send an 
encrypted message, type it in the KGpg editor, then click &quot;encrypt&quot;. 
Choose
-your friend key and click &quot;encrypt&quot; again. The message will be 
encrypted, ready to be sent by email.</p>
+your friend's key and click &quot;encrypt&quot; again. The message will be 
encrypted, ready to be sent by email.</p>
 </html>
 </tip>
 <tip category="KGpg|app">
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/transactions/kgpgencrypt.cpp 
new/kgpg-4.10.95/transactions/kgpgencrypt.cpp
--- old/kgpg-4.10.90/transactions/kgpgencrypt.cpp       2013-05-28 
21:30:19.000000000 +0200
+++ new/kgpg-4.10.95/transactions/kgpgencrypt.cpp       2013-07-10 
01:17:48.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011,2012 Rolf Eike Beer <[email protected]>
+ * Copyright (C) 2011,2012,2013 Rolf Eike Beer <[email protected]>
  */
 
 /***************************************************************************
@@ -16,9 +16,6 @@
 #include "kgpgsettings.h"
 #include "gpgproc.h"
 
-#include <kio/renamedialog.h>
-#include <KLocale>
-
 static QStringList trustOptions(const QString &binary)
 {
        const int gpgver = 
GPGProc::gpgVersion(GPGProc::gpgVersionString(binary));
@@ -103,7 +100,6 @@
        if (!inputFiles.isEmpty()) {
                static const QString encStart = QLatin1String("[GNUPG:] 
FILE_START 2 ");
                static const QString encDone = QLatin1String("[GNUPG:] 
FILE_DONE");
-               static const QString askName = QLatin1String("[GNUPG:] GET_LINE 
openfile.askoutname");
 
                if (line.startsWith(encStart)) {
                        m_currentFile = line.mid(encStart.length());
@@ -113,25 +109,25 @@
                        emit statusMessage(i18nc("Status message 'Encrypted 
<filename>' (operation was completed)", "Encrypted %1", m_currentFile));
                        m_fileIndex++;
                        emit infoProgress(2 * m_fileIndex, inputFiles.count() * 
2);
-               } else if (line == askName) {
-                       QPointer<KIO::RenameDialog> over = new 
KIO::RenameDialog(qobject_cast<QWidget *>(parent()),
-                                       i18n("File Already Exists"), KUrl(),
-                                       KUrl::fromPath(m_currentFile + 
encryptExtension(m_options.testFlag(AsciiArmored))),
-                                       KIO::M_OVERWRITE);
-
-                       if (over->exec() != QDialog::Accepted) {
-                               delete over;
-                               setSuccess(KGpgTransaction::TS_USER_ABORTED);
-                               return true;
-                       }
-                       write(over->newDestUrl().path().toUtf8());
-                       delete over;
                }
        }
 
        return KGpgTextOrFileTransaction::nextLine(line);
 }
 
+KGpgTransaction::ts_boolanswer
+KGpgEncrypt::confirmOverwrite(KUrl &currentFile)
+{
+       const QString ext = encryptExtension(m_options.testFlag(AsciiArmored));
+
+       if (m_currentFile.isEmpty())
+               currentFile = 
KUrl::fromLocalFile(getInputFiles().at(m_fileIndex).toLocalFile() + ext);
+       else
+               currentFile = KUrl::fromLocalFile(m_currentFile + ext);
+       return BA_UNKNOWN;
+}
+
+
 QString
 KGpgEncrypt::encryptExtension(const bool ascii)
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/transactions/kgpgencrypt.h 
new/kgpg-4.10.95/transactions/kgpgencrypt.h
--- old/kgpg-4.10.90/transactions/kgpgencrypt.h 2013-05-28 21:30:19.000000000 
+0200
+++ new/kgpg-4.10.95/transactions/kgpgencrypt.h 2013-07-10 01:17:48.000000000 
+0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2011 Rolf Eike Beer <[email protected]>
+ * Copyright (C) 2011,2012,2013 Rolf Eike Beer <[email protected]>
  */
 
 /***************************************************************************
@@ -80,6 +80,7 @@
 protected:
        virtual QStringList command() const;
        virtual bool nextLine(const QString &line);
+       virtual ts_boolanswer confirmOverwrite (KUrl &currentFile);
 
 private:
        int m_fileIndex;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/transactions/kgpggeneraterevoke.cpp 
new/kgpg-4.10.95/transactions/kgpggeneraterevoke.cpp
--- old/kgpg-4.10.90/transactions/kgpggeneraterevoke.cpp        2013-05-28 
21:30:19.000000000 +0200
+++ new/kgpg-4.10.95/transactions/kgpggeneraterevoke.cpp        2013-07-10 
01:17:48.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010,2012 Rolf Eike Beer <[email protected]>
+ * Copyright (C) 2010,2012,2013 Rolf Eike Beer <[email protected]>
  */
 
 /***************************************************************************
@@ -58,9 +58,7 @@
                return false;
        }
 
-       if (line.contains(QLatin1String( "GOOD_PASSPHRASE" ))) {
-               setSuccess(TS_OK);
-       } else if (line.contains(QLatin1String( "NEED_PASSPHRASE" ))) {
+       if (line.contains(QLatin1String( "NEED_PASSPHRASE" ))) {
                setSuccess(TS_USER_ABORTED);
        } else if (line.contains(QLatin1String( "ask_revocation_reason.code" 
))) {
                write(QByteArray::number(m_reason));
@@ -84,8 +82,6 @@
                return BA_YES;
        } else if (line == QLatin1String("ask_revocation_reason.okay")) {
                return BA_YES;
-       } else if (line == QLatin1String("openfile.overwrite.okay")) {
-               return BA_YES;
        } else {
                return KGpgTransaction::boolQuestion(line);
        }
@@ -106,6 +102,21 @@
        }
 }
 
+bool
+KGpgGenerateRevoke::passphraseReceived()
+{
+       setSuccess(TS_OK);
+
+       return false;
+}
+
+KGpgTransaction::ts_boolanswer
+KGpgGenerateRevoke::confirmOverwrite(KUrl &currentFile)
+{
+       currentFile = m_revUrl;
+       return BA_UNKNOWN;
+}
+
 const QString &
 KGpgGenerateRevoke::getOutput() const
 {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/transactions/kgpggeneraterevoke.h 
new/kgpg-4.10.95/transactions/kgpggeneraterevoke.h
--- old/kgpg-4.10.90/transactions/kgpggeneraterevoke.h  2013-05-28 
21:30:19.000000000 +0200
+++ new/kgpg-4.10.95/transactions/kgpggeneraterevoke.h  2013-07-10 
01:17:48.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2010,2012 Rolf Eike Beer <[email protected]>
+ * Copyright (C) 2010,2012,2013 Rolf Eike Beer <[email protected]>
  */
 
 /***************************************************************************
@@ -56,6 +56,8 @@
        virtual bool nextLine(const QString &line);
        virtual ts_boolanswer boolQuestion(const QString &line);
        virtual void finish();
+       virtual bool passphraseReceived();
+       virtual ts_boolanswer confirmOverwrite (KUrl &currentFile);
 
 private:
        QString m_keyid;
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/kgpg-4.10.90/transactions/kgpgtextorfiletransaction.cpp 
new/kgpg-4.10.95/transactions/kgpgtextorfiletransaction.cpp
--- old/kgpg-4.10.90/transactions/kgpgtextorfiletransaction.cpp 2013-06-10 
20:53:48.000000000 +0200
+++ new/kgpg-4.10.95/transactions/kgpgtextorfiletransaction.cpp 2013-07-10 
01:17:48.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008,2009,2010,2011,2012 Rolf Eike Beer 
<[email protected]>
+ * Copyright (C) 2008,2009,2010,2011,2012,2013 Rolf Eike Beer 
<[email protected]>
  */
 
 /***************************************************************************
@@ -114,7 +114,7 @@
        args << command();
        // if the input is not stdin set command-fd so GnuPG
        // can ask if e.g. the file already exists
-       if (!locfiles.isEmpty() && !m_tempfiles.isEmpty()) {
+       if (!locfiles.isEmpty() || !m_tempfiles.isEmpty()) {
                args << QLatin1String("--command-fd=0");
                m_closeInput = false;
        } else {
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/transactions/kgpgtransaction.cpp 
new/kgpg-4.10.95/transactions/kgpgtransaction.cpp
--- old/kgpg-4.10.90/transactions/kgpgtransaction.cpp   2013-05-28 
21:30:19.000000000 +0200
+++ new/kgpg-4.10.95/transactions/kgpgtransaction.cpp   2013-07-10 
01:17:48.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008,2009,2010,2011,2012 Rolf Eike Beer 
<[email protected]>
+ * Copyright (C) 2008,2009,2010,2011,2012,2013 Rolf Eike Beer 
<[email protected]>
  */
 
 /***************************************************************************
@@ -17,11 +17,14 @@
 #include "kgpginterface.h"
 
 #include <KDebug>
+#include <kio/renamedialog.h>
 #include <KPasswordDialog>
 #include <knewpassworddialog.h>
 #include <KLocale>
 #include <KPushButton>
+#include <KUrl>
 #include <QByteArray>
+#include <QPointer>
 #include <QStringList>
 #include <QWeakPointer>
 #include <QWidget>
@@ -43,6 +46,8 @@
 
        QStringList m_idhints;
 
+       KUrl m_overwriteUrl;    ///< the file to overwrite or it's new name
+
        void slotReadReady();
        void slotProcessExited();
        void slotProcessStarted();
@@ -138,6 +143,8 @@
                kDebug(2100) << m_parent << line;
 #endif /* KGPG_DEBUG_TRANSACTIONS */
 
+               static const QString getBool = QLatin1String("[GNUPG:] GET_BOOL 
");
+
                if (line.startsWith(QLatin1String("[GNUPG:] USERID_HINT "))) {
                        m_parent->addIdHint(line);
                } else if (line.startsWith(QLatin1String("[GNUPG:] 
BAD_PASSPHRASE "))) {
@@ -167,8 +174,51 @@
                                m_process->closeWriteChannel();
                        }
 
-               } else if (line.startsWith(QLatin1String("[GNUPG:] GET_BOOL 
"))) {
-                       switch (m_parent->boolQuestion(line.mid(18))) {
+               } else if (line.startsWith(getBool)) {
+                       static const QString overwrite = 
QLatin1String("openfile.overwrite.okay");
+                       const QString question = line.mid(getBool.length());
+
+                       KGpgTransaction::ts_boolanswer answer;
+
+                       if (question.startsWith(overwrite)) {
+                               m_overwriteUrl.clear();
+                               answer = 
m_parent->confirmOverwrite(m_overwriteUrl);
+
+                               if ((answer == KGpgTransaction::BA_UNKNOWN) && 
!m_overwriteUrl.isEmpty()) {
+                                       QPointer<KIO::RenameDialog> over = new 
KIO::RenameDialog(qobject_cast<QWidget *>(m_parent->parent()),
+                                                       i18n("File Already 
Exists"), KUrl(),
+                                                       m_overwriteUrl, 
KIO::M_OVERWRITE);
+
+                                       m_overwriteUrl.clear();
+
+                                       switch (over->exec()) {
+                                       case KIO::R_OVERWRITE:
+                                               answer = 
KGpgTransaction::BA_YES;
+                                               break;
+                                       case KIO::R_RENAME:
+                                               answer = KGpgTransaction::BA_NO;
+                                               m_overwriteUrl = 
over->newDestUrl();
+                                               break;
+                                       default:
+                                               answer = 
KGpgTransaction::BA_UNKNOWN;
+                                               
m_parent->setSuccess(KGpgTransaction::TS_USER_ABORTED);
+                                               // Close the pipes, otherwise 
GnuPG will try to answer
+                                               // further questions about this 
file.
+                                               m_process->closeWriteChannel();
+                                               
m_process->closeReadChannel(QProcess::StandardOutput);
+                                               break;
+                                       }
+
+                                       delete over;
+
+                                       if (answer == 
KGpgTransaction::BA_UNKNOWN)
+                                               continue;
+                               }
+                       } else {
+                               answer = m_parent->boolQuestion(question);
+                       }
+
+                       switch (answer) {
                        case KGpgTransaction::BA_YES:
                                write("YES\n");
                                break;
@@ -180,6 +230,9 @@
                                m_parent->unexpectedLine(line);
                                sendQuit();
                        }
+               } else if (!m_overwriteUrl.isEmpty() && 
line.startsWith(QLatin1String("[GNUPG:] GET_LINE openfile.askoutname"))) {
+                       write(m_overwriteUrl.toLocalFile().toUtf8() + '\n');
+                       m_overwriteUrl.clear();
                } else if (line.startsWith(QLatin1String("[GNUPG:] 
MISSING_PASSPHRASE"))) {
                        m_success = KGpgTransaction::TS_USER_ABORTED;
                } else if (line.startsWith(QLatin1String("[GNUPG:] CARDCTRL 
"))) {
@@ -398,7 +451,15 @@
 KGpgTransaction::ts_boolanswer
 KGpgTransaction::boolQuestion(const QString& line)
 {
-       Q_UNUSED(line);
+       Q_UNUSED(line)
+
+       return BA_UNKNOWN;
+}
+
+KGpgTransaction::ts_boolanswer
+KGpgTransaction::confirmOverwrite(KUrl &currentFile)
+{
+       Q_UNUSED(currentFile)
 
        return BA_UNKNOWN;
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/kgpg-4.10.90/transactions/kgpgtransaction.h 
new/kgpg-4.10.95/transactions/kgpgtransaction.h
--- old/kgpg-4.10.90/transactions/kgpgtransaction.h     2013-05-28 
21:30:19.000000000 +0200
+++ new/kgpg-4.10.95/transactions/kgpgtransaction.h     2013-07-10 
01:17:48.000000000 +0200
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2008,2009,2012 Rolf Eike Beer <[email protected]>
+ * Copyright (C) 2008,2009,2012,2013 Rolf Eike Beer <[email protected]>
  */
 
 /***************************************************************************
@@ -20,6 +20,7 @@
 class GPGProc;
 class KGpgSignTransactionHelper;
 class KGpgTransactionPrivate;
+class KUrl;
 class QByteArray;
 class QProcess;
 
@@ -222,6 +223,20 @@
         * The default implementation will answer BA_UNKNOWN to every question.
         */
        virtual ts_boolanswer boolQuestion(const QString &line);
+
+       /**
+        * @brief called when GnuPG asks for confirmation for overwriting a file
+        * @param currentFile fill in the current filename for the user dialog
+        * @return what to answer to GnuPG
+        * @retval BA_YES file will be overwritten, @currentFile is ignored
+        * @retval BA_NO file will not be overwritten, if currentFile is given 
this will automatically be provided as alternative to GnuPG
+        * @retval BA_UNKNOWN ask the user for a choice or abort, currentFile 
is provided to the user as a hint about the original filename, if currentFile 
is empty the transaction is aborted
+        *
+        * The default implementation will just return BA_UNKNOWN without 
setting
+        * a filename, causing a sequence error.
+        */
+       virtual ts_boolanswer confirmOverwrite(KUrl &currentFile);
+
        /**
         * @brief Called for a set of hint messages
         *

-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to