[PackageUrlInterceptor] Make QRegularExpression static
AbandonedPublic

Authored by ahmadsamir on Apr 8 2020, 8:40 AM.

Details

Reviewers
broulik
Group Reviewers
Plasma
Summary

Avoids recompiling it every time.

Test Plan

Called 27 times on plasmashell startup for me, saves 90% of time in here

Diff Detail

Repository
R242 Plasma Framework (Library)
Lint
Lint Skipped
Unit
Unit Tests Skipped
broulik created this revision.Apr 8 2020, 8:40 AM
Restricted Application added a project: Frameworks. · View Herald TranscriptApr 8 2020, 8:40 AM
Restricted Application added a subscriber: kde-frameworks-devel. · View Herald Transcript
broulik requested review of this revision.Apr 8 2020, 8:40 AM
pino added a subscriber: pino.Apr 8 2020, 8:43 AM

Does it really need to be a regular expression, though? A simple string search & replace should do the same thing.

broulik planned changes to this revision.Apr 9 2020, 12:27 PM

Yeah, can probably be a startsWith

bruns added a subscriber: bruns.Apr 9 2020, 2:52 PM

Yeah, can probably be a startsWith

unlikely for QUrl::toString() ...

so, can the regexp be replaced or does it need to stay?

pino added a comment.May 19 2020, 8:28 AM

so, can the regexp be replaced or does it need to stay?

Sure: look for /ui/ in path, and if it is there, join what's before it + prefix + what's after it.

ahmadsamir abandoned this revision.May 19 2020, 12:23 PM