diff --git a/src/main.cpp b/src/main.cpp --- a/src/main.cpp +++ b/src/main.cpp @@ -32,6 +32,7 @@ #include #include #include +#include Q_LOGGING_CATEGORY(LOG_KSSHASKPASS, "ksshaskpass") @@ -68,6 +69,15 @@ return; } + // Case 3a: password extraction from git-lfs + QRegularExpression re3a("^(Password|Username) for \"(.*?)\"$"); + QRegularExpressionMatch match3a = re3a.match(prompt); + if (match3a.hasMatch()) { + keyFile = match3a.captured(2); + wrongPassphrase = false; + return; + } + // Case 4: password extraction from mercurial, see bug 380085 QRegularExpression re4("^(.*?)'s password: $"); QRegularExpressionMatch match4 = re4.match(prompt); @@ -124,7 +134,8 @@ } // Open KWallet to see if a password was previously stored - std::auto_ptr wallet(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), 0)); + WId winId = QApplication::desktop()->winId(); + std::auto_ptr wallet(KWallet::Wallet::openWallet(KWallet::Wallet::NetworkWallet(), winId)); if ((!wrongPassphrase) && (!keyFile.isNull()) && wallet.get() && wallet->hasFolder(walletFolder)) { wallet->setFolder(walletFolder);