Fix folder navigation
ClosedPublic

Authored by atulsharma on Jul 13 2017, 1:44 PM.

Details

Summary
  • Since the KIO requires need to know whether path is from local filesystem or a hyperlink

Diff Detail

Repository
R659 Koko Image Gallery
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
atulsharma created this revision.Jul 13 2017, 1:44 PM
atulsharma added a reviewer: mart.
atulsharma updated this revision to Diff 16655.Jul 13 2017, 2:14 PM
atulsharma edited the summary of this revision. (Show Details)
mart added inline comments.Jul 13 2017, 2:50 PM
src/imagefoldermodel.cpp
86

construct a QUrl immediately, then use it to check isLocalFile()

87

QUrl::path()

93

you can prettyfy those as well:
QUrl::fromLocalFile(url)

96

here too

atulsharma updated this revision to Diff 16658.Jul 13 2017, 2:59 PM
atulsharma updated this revision to Diff 16659.Jul 13 2017, 3:06 PM
atulsharma edited the summary of this revision. (Show Details)Jul 13 2017, 3:09 PM
mart added inline comments.Jul 13 2017, 3:40 PM
src/imagefoldermodel.cpp
88

drop that if then else and simply do:

Q_ASSERT(QUrl(url).isLocalFile())
url = QUrl(url).path();

also, if you are asserting here, you need to check beforehand that url is local

atulsharma updated this revision to Diff 16666.Jul 13 2017, 5:29 PM

Checks the url for localFile beforehand in main.cpp

atulsharma updated this revision to Diff 16674.Jul 13 2017, 7:27 PM

patch compatible with master branch commit 085703

mart accepted this revision.Jul 14 2017, 11:28 AM
This revision is now accepted and ready to land.Jul 14 2017, 11:28 AM
This revision was automatically updated to reflect the committed changes.