WIP: Introduce three new methods that return all "entries" in a folder

Authored by ahmadsamir on Apr 20 2020, 5:26 PM.



As was discussed in https://phabricator.kde.org/D28880 with dfaure, it
seems that all users (only two, KWalletManager and Falkon) of the current
read{Entry,Map,Passowrd}list() methods basically use "*" as a wildcard
to get a list of all the "entries" in a folder. Therefore it makes sense
to introduce new methods that do just that, this gets rid of regular
expression usage for matching a certain pattern. This fits with how .e.g.
KWalletManager is using readEntryList(), to get a list of all the entries
to fill a list view with them, then the "matching" is done with a QSFPM-like

Test Plan
  • make && ctest
  • Ported Falkon locally, and it seems to work

Diff Detail

R311 KWallet
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
ahmadsamir created this revision.Apr 20 2020, 5:26 PM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 20 2020, 5:26 PM
ahmadsamir requested review of this revision.Apr 20 2020, 5:26 PM

Todo: port kwalletmanager locally and see if it still works (which isn't saying much as I don't use kwallet that much). I think we can delay this to KF 5.71, to get more testing.

dfaure requested changes to this revision.Apr 22 2020, 1:43 PM
dfaure added inline comments.

Urgh. This actually calls for async API instead.

But now I'm really confused. HAVE_KSECRETSSERVICE is never set anywhere (except to 0), how does one even compile this code?


Are there documented error codes somewhere? Otherwise a bool would do be more readable, no?

But then if we don't have error codes, wouldn't

QMap<QString, QByteArray> entriesList()

be better?


rc = map.values(), append() makes little sense if it's empty.


This makes no sense. The list is a value. Does this mean "The caller takes ownership of the entries"?

This revision now requires changes to proceed.Apr 22 2020, 1:43 PM

Sorry for the delay. We applied a workable hack in https://phabricator.kde.org/D28880 to get rid of the '[^/]' in the string that wildcardToRegularExpression returns, and it seemed to work when I tested falkon.

I guess I'll have migrate this to invent.kde and try addressing the review comments.

This revision was not accepted when it landed; it landed in state Needs Revision.Jun 5 2020, 1:28 PM
This revision was automatically updated to reflect the committed changes.
ahmadsamir abandoned this revision.Jun 7 2020, 4:48 PM