[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-i18n-doc
Subject:    [discover/Plasma/5.8] discover: Display an error if input URL was malformed
From:       Aleix Pol <aleixpol () kde ! org>
Date:       2016-11-22 16:23:18
Message-ID: E1c9Dqo-0004fP-VH () code ! kde ! org
[Download RAW message or body]

Git commit 6dd31d014fa00839791d730b9fdb9c29cabe3518 by Aleix Pol.
Committed on 22/11/2016 at 16:23.
Pushed by apol into branch 'Plasma/5.8'.

Display an error if input URL was malformed

Otherwise, it just opened without warning or such.
CC as it introduces an i18n() call.

CCMAIL: kde-i18n-doc@kde.org

M  +5    -2    discover/main.cpp

http://commits.kde.org/discover/6dd31d014fa00839791d730b9fdb9c29cabe3518

diff --git a/discover/main.cpp b/discover/main.cpp
index d1946f5..15fc8d4 100644
--- a/discover/main.cpp
+++ b/discover/main.cpp
@@ -76,8 +76,11 @@ bool processArgs(QCommandLineParser* parser, DiscoverMainWindow* \
mainWindow)  foreach(const QString &arg, parser->positionalArguments()) {
         QUrl url(arg);
         if (url.scheme() == QLatin1String("appstream")) {
-            QTextStream(stdout) << "opening appstream resource" << url.host() << \
                '\n';
-            mainWindow->openApplication(url.host());
+            QTextStream(stdout) << "opening appstream resource" << url.host() << \
"from" << url.toString() << '\n'; +            if (url.host().isEmpty())
+                mainWindow->showPassiveNotification(i18n("Malformed url '%1'", \
url.toDisplayString())); +            else
+                mainWindow->openApplication(url.host());
         } else {
             QTextStream(stdout) << "unrecognized url" << url.toDisplayString() << \
'\n';  return true;


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic