Skip to content

Replace string in single pass

Sharaf Zaman requested to merge szaman/krita:bug-432488-bad-bundles into krita/4.3

Buggy behavior:

Let's say filename = "/path/filename%2something.bundle" and res = "favorite.kpp"

Then, QString("bundle://%1:%2").arg(filename).arg(res) would be replaced as: bundle:///path/filenamefavorite.kppsomething.bundle:favorite.kpp

when it should be replaced as: bundle:///path/filename%2something.bundle:favorite.kpp

BUG:432488

Test Plan

There should be no change in behavior of bundles, loading them should work like it did before. Except in case if there is a %1/%2 in the name of the file, bundle should still load and on Android if there is a space in the name/path of bundle, it should still load.

Formalities Checklist

  • I confirmed this builds.
  • I confirmed Krita ran and the relevant functions work.
  • I tested the relevant unit tests and can confirm they are not broken. (If not possible, don't hesitate to ask for help!)
  • I made sure my commits build individually and have good descriptions as per KDE guidelines.
  • I made sure my code conforms to the standards set in the HACKING file.
  • I can confirm the code is licensed and attributed appropriately, and that unattributed code is mine, as per KDE Licensing Policy.

Merge request reports