BookmarksRunner: Early return and formatting
ClosedPublic

Authored by alex on Apr 1 2020, 7:49 AM.

Details

Summary

As requested in D28196 this patch handles the early return and the formatting.
Additionally QRegularExpression has been used instead of QRegExp and QStringLiteral instead of QString.

Test Plan

Should compile and work exactly as before.

To test migration to QRegularExpression:
create multiple profiles
delete the dbfile entry from the general group in .config/kdeglobals
restart krunner and make sure that the value of the dbfile entry is the path to the default profile.
The bookmarks should also be displayed.

Diff Detail

Repository
R120 Plasma Workspace
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
alex created this revision.Apr 1 2020, 7:49 AM
Restricted Application added a project: Plasma. · View Herald TranscriptApr 1 2020, 7:49 AM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
alex requested review of this revision.Apr 1 2020, 7:49 AM
alex edited the test plan for this revision. (Show Details)

Should compile and work exactly as before.

Please always test QRegularExpression migration, I've seen just too many regressions when this wasn't done carefully

runners/bookmarks/browsers/firefox.cpp
170

The default argument is sufficient to resolve the type, readEntry("foo", QString()) is enough

alex edited the test plan for this revision. (Show Details)Apr 1 2020, 8:02 AM
alex updated this revision to Diff 79019.Apr 1 2020, 8:08 AM

Implement requested changes.

PS: I had already tested the migration locally and added it to the test plan.

bruns added inline comments.Apr 1 2020, 5:34 PM
runners/bookmarks/browsers/firefox.cpp
199

Can you leave this in, and even promote it to an active qWarning* - if we have a db and profiles file, but can't determine the default profile, something is definitely wrong.

  • better would be a qCWarning, but we have no categories here yet -> TODO
215

This can IMHO also be promoted to an active warning.

alex updated this revision to Diff 79083.Apr 1 2020, 7:51 PM

Implement warnings

alex marked 2 inline comments as done.Apr 1 2020, 7:51 PM
bruns added inline comments.Apr 1 2020, 7:55 PM
runners/bookmarks/browsers/firefox.cpp
165

Thanks, though I was wrong about "no categories yet".

#include "bookmarks_debug"
...
qCWarning(RUNNER_BOOKMARKS) << ...
alex updated this revision to Diff 79086.Apr 1 2020, 8:15 PM

Use categories for warnings, cleanup imports

bruns accepted this revision.Apr 12 2020, 2:02 PM
This revision is now accepted and ready to land.Apr 12 2020, 2:02 PM
alex added a comment.EditedApr 20 2020, 4:59 AM

Should this(and the following patches) go to a stable branch, because they fix a bug that has been reported (418526)?

alex added a comment.Apr 29 2020, 12:59 PM

Ping, regarding the question :-)

This revision was automatically updated to reflect the committed changes.