SHA256
1
0
forked from pool/gwenview5
Files
gwenview5/fix-multiple-arguments.diff
Luca Beltrame 1bc341beb7 Accepting request 431125 from home:alarrosa:branches:KDE:Applications
- Added QUrl::AssumeLocalFile to fix-multiple-arguments.diff to
  mimic the patch accepted upstream

OBS-URL: https://build.opensuse.org/request/show/431125
OBS-URL: https://build.opensuse.org/package/show/KDE:Applications/gwenview5?expand=0&rev=39
2016-09-28 15:50:07 +00:00

36 lines
1.5 KiB
Diff

Index: gwenview-16.08.1/app/main.cpp
===================================================================
--- gwenview-16.08.1.orig/app/main.cpp
+++ gwenview-16.08.1/app/main.cpp
@@ -59,8 +59,19 @@ public:
mMultipleUrlsDir.reset(new QTemporaryDir);
mUrl = QUrl::fromLocalFile(mMultipleUrlsDir->path());
QList<QUrl> list;
- foreach(const QString & url, args) {
- list << QUrl::fromUserInput(url);
+ QStringList tmpArgs = args;
+ tmpArgs.removeDuplicates();
+ foreach(const QString & url, tmpArgs) {
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
+ list << QUrl::fromUserInput(url, QDir::currentPath(), QUrl::AssumeLocalFile);
+#else
+ QUrl tmpUrl = QUrl(url);
+ if (tmpUrl.scheme().isEmpty() && !url.startsWith(QLatin1Char('/'))) {
+ list << QUrl::fromLocalFile(url);
+ } else {
+ list << QUrl::fromUserInput(url);
+ }
+#endif
}
KIO::CopyJob* job = KIO::link(list, mUrl);
@@ -68,7 +79,7 @@ public:
} else {
QString tmpArg = args.first();
#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
- mUrl = QUrl::fromUserInput(tmpArg, QDir::currentPath());
+ mUrl = QUrl::fromUserInput(tmpArg, QDir::currentPath(), QUrl::AssumeLocalFile);
#else
QUrl tmpUrl = QUrl(tmpArg);
if (tmpUrl.scheme().isEmpty() && !tmpArg.startsWith(QLatin1Char('/'))) {