Fix handling of multiple arguments in command line
ClosedPublic

Authored by antlarr on Sep 28 2016, 1:47 PM.

Details

Summary

When running gwenview with multiple local images as arguments in the
command line, the constructed urls used to create the links in the
temporary directory were wrong. This commit fixes the urls so they
can point to local files.

Also, if some file was specified multiple times in the command line,
the user was presented with a KIO rename dialog, which is quite
strange since the user was just opening some images, so this
commit also removed duplicated arguments.

Diff Detail

Branch
master
Lint
No Linters Available
Unit
No Unit Test Coverage
antlarr updated this revision to Diff 6972.Sep 28 2016, 1:47 PM
antlarr retitled this revision from to Fix handling of multiple arguments in command line.
antlarr updated this object.
antlarr edited the test plan for this revision. (Show Details)
apol added a subscriber: apol.Sep 28 2016, 2:20 PM
apol added inline comments.
app/main.cpp
66

You probably want to use:

list << QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile);

Also I don't think gwenview is supposed to work with Qt 5.4 anymore, why's the ifdef?

antlarr updated this revision to Diff 6974.Sep 28 2016, 2:59 PM
  • Add QUrl::AssumeLocalFile and assume Qt > 5.4.0

Use QUrl::AssumeLocalFile with QUrl::fromUserInput and
remove ifdefs for Qt > 5.4.0 since gwenview already requires
5.7.0 anyway

apol accepted this revision.Sep 28 2016, 3:01 PM
apol added a reviewer: apol.

LGTM

This revision is now accepted and ready to land.Sep 28 2016, 3:01 PM
antlarr closed this revision.Sep 28 2016, 3:05 PM