D28097: GIT_SILENT clang-format kpasswdserver.* plus some manual changes

David Faure noreply at phabricator.kde.org
Sat Mar 21 10:46:39 GMT 2020


dfaure requested changes to this revision.
dfaure added inline comments.
This revision now requires changes to proceed.

INLINE COMMENTS

> kpasswdserver.cpp:249
>  #ifdef HAVE_KF5WALLET
> -        if (!result &&
> -            !m_walletDisabled &&
> -            (info.username.isEmpty() || info.password.isEmpty()) &&
> -            !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(),
> -                                              KWallet::Wallet::PasswordFolder(),
> -                                              makeWalletKey(key, info.realmValue)))
> -        {
> +        const bool keyExists = !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), KWallet::Wallet::PasswordFolder(), makeWalletKey(key, info.realmValue));
> +        if (!result

This didn't use to be called when m_walletDisabled is true.

Make it a lambda if you want to simplify the if() condition while still preserving evaluation order?

Or better: let's not change code in a "reformatting" commit...  It's too dangerous. I could have missed this. Reviewing reformatting from a tool and reviewing changes made by a human are two different kinds of reviews :-)

> kpasswdserver.cpp:309
>  #ifdef HAVE_KF5WALLET
> -        if (!result &&
> -            !m_walletDisabled &&
> -            (info.username.isEmpty() || info.password.isEmpty()) &&
> -            !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(),
> -                                              KWallet::Wallet::PasswordFolder(),
> -                                              makeWalletKey(key, info.realmValue)))
> -        {
> +        const bool keyExists = !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(), KWallet::Wallet::PasswordFolder(), makeWalletKey(key, info.realmValue));
> +        if (!result

same

> kpasswdserver.cpp:748
>      const bool bypassCacheAndKWallet = info.getExtraField(AUTHINFO_EXTRAFIELD_BYPASS_CACHE_AND_KWALLET).toBool();
> -    if ( !bypassCacheAndKWallet
> -        && ( username.isEmpty() || password.isEmpty() )
> +    const bool keyExists = !KWallet::Wallet::keyDoesNotExist(KWallet::Wallet::NetworkWallet(),
> +                                                             KWallet::Wallet::PasswordFolder(),

same

REPOSITORY
  R241 KIO

REVISION DETAIL
  https://phabricator.kde.org/D28097

To: ahmadsamir, #frameworks, dfaure, apol
Cc: kde-frameworks-devel, LeGast00n, cblack, GB_2, michaelh, ngraham, bruns
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20200321/e0840115/attachment-0001.html>


More information about the Kde-frameworks-devel mailing list