Prevent crash
AbandonedPublic

Authored by apol on Aug 23 2016, 2:20 AM.

Details

Reviewers
mwolff
Group Reviewers
KDevelop
Summary

Sometimes we'll get here with urls that are not normalized
This leads to crash

Diff Detail

Repository
R33 KDevPlatform
Branch
5.0
Lint
No Linters Available
Unit
No Unit Test Coverage
apol updated this revision to Diff 6166.Aug 23 2016, 2:20 AM
apol retitled this revision from to Prevent crash.
apol updated this object.
apol edited the test plan for this revision. (Show Details)
apol added a reviewer: KDevelop.
Restricted Application added a subscriber: kdevelop-devel. · View Herald TranscriptAug 23 2016, 2:20 AM
brauch added a subscriber: brauch.Aug 23 2016, 7:15 AM

Hmm, pragmatic I guess, but maybe we should fix the callers instead? Not sure.

zwabel added a subscriber: zwabel.Aug 23 2016, 10:09 PM

Why not put it into the IndexedString(QUrl) constructor?

mwolff requested changes to this revision.Aug 23 2016, 11:02 PM
mwolff added a reviewer: mwolff.
mwolff added a subscriber: mwolff.

this is not the correct place to handle this. the callers must be adapted. Yes, this is more work. But it also means it can be done much much faster.

This revision now requires changes to proceed.Aug 23 2016, 11:02 PM

Btw, using Path instead of QUrl is often all you need to "fix" this - the code will be faster as well.

apol abandoned this revision.Aug 24 2016, 2:02 AM

Oh well, should have kept the backtrace. Are you suggesting to introduce a ::chainForDocument(Path) method?

mwolff added a comment.Sep 5 2016, 3:13 PM

Maybe. Or simply use the one that takes an IndexedString. I think what you want is to use Path::toIndexed wherever you currently use QUrl. QUrl is simply too easy to get wrong