Commit 76055759 authored by David Faure's avatar David Faure

Simplify handling of command line args

using the 2 (or 3) args QUrl::fromUserInput I added to Qt 5.4.
parent 849ed95f
......@@ -231,12 +231,8 @@ int main(int argc, char *argv[])
// take arguments
if( ! urls.isEmpty() )
{
const QRegExp withProtocolChecker( QStringLiteral("^[a-zA-Z]+:") );
foreach (const QString &url, urls) {
const QUrl u = (withProtocolChecker.indexIn(url) == 0) ?
QUrl::fromUserInput( url ) :
QUrl::fromLocalFile(QDir::current().absoluteFilePath(url));
const QUrl u = QUrl::fromUserInput(url, QDir::currentPath());
KStars::Instance()->openFITS(u);
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment