1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-19 10:16:34 +01:00

Files with relative paths can now be opened from command line

Closes #1109
This commit is contained in:
nowrep 2013-12-18 17:51:38 +01:00
parent a84bafe1f3
commit 3295899230
2 changed files with 8 additions and 1 deletions

View File

@ -32,6 +32,7 @@ Version 1.5.0
* fixed: parsing OpenSearch files with XML declaration
* fixed: don't show urls multiple times in url completer
* fixed: drag & drop moving folders under bookmarks toolbar
* fixed: files with relative paths can now be opened from command line
Version 1.4.4
* released 1 September 2013

View File

@ -19,6 +19,7 @@
#include "qupzilla.h"
#include <QCoreApplication>
#include <QFileInfo>
CommandLineOptions::CommandLineOptions(int &argc)
: m_argc(argc)
@ -176,7 +177,12 @@ void CommandLineOptions::parseActions()
}
}
const QString &url = arguments.last();
QString url = arguments.last();
QFileInfo fileInfo(url);
if (fileInfo.exists()) {
url = fileInfo.absoluteFilePath();
}
if (m_argc > 1 && !url.isEmpty() && !url.startsWith(QLatin1Char('-')) &&
(url.contains(QLatin1Char('.')) || url.contains(QLatin1Char('/'))