Commit cfcd545b authored by Michael Pyne's avatar Michael Pyne

scrobbler: Don't prompt to unlock KWallet if not using scrobbler.

A prior code cleanup started trying to open the default KWallet
automatically, skipping the existing check for whether scrobbling is
enabled. Instead of reverting, add the check to the wallet opening code,
which already has to handle the possibility of failure.
parent 436b0069
......@@ -83,22 +83,23 @@ std::unique_ptr<KWallet::Wallet> Scrobbler::openKWallet() // static
using KWallet::Wallet;
const QString walletFolderName = "JuK";
std::unique_ptr<Wallet> wallet(Wallet::openWallet(
if(wallet) {
if(!wallet->hasFolder(walletFolderName) &&
return nullptr;
const QString walletFolderName(QStringLiteral("JuK"));
const auto walletName = Wallet::LocalWallet();
return nullptr;
// checks without prompting to open the wallet
if (Wallet::folderDoesNotExist(walletName, walletFolderName)) {
return nullptr;
std::unique_ptr<Wallet> wallet(
Wallet::openWallet(walletName, JuK::JuKInstance()->winId()));
if(!wallet ||
(!wallet->hasFolder(walletFolderName) &&
!wallet->createFolder(walletFolderName)) ||
return nullptr;
return wallet;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment