LogoopenSUSE Build Service > Projects
Sign Up | Log In

View File quick-usb-formatter-fix-qt5.patch of Package quick-usb-formatter (Project home:hgraeber:KDE)

diff -up quick-usb-formatter-0.6/src/main.cpp.fix-qt5 quick-usb-formatter-0.6/src/main.cpp
--- quick-usb-formatter-0.6/src/main.cpp.fix-qt5	2017-02-28 23:14:21.382045799 +0100
+++ quick-usb-formatter-0.6/src/main.cpp	2017-03-01 23:13:57.167262044 +0100
@@ -1,6 +1,6 @@
 
 
-#include <QtGui/QApplication>
+#include <QtWidgets/QApplication>
 #include "window.h"
 #include "devices.h"
 #include <QtCore>
@@ -53,7 +53,7 @@ int main(int argc, char *argv[])
     QCommandLineParser parser;
     parser.addHelpOption();
     parser.addVersionOption();
-    parser.addPositionalArgument(QStringLiteral("+udi <argument>"), i18n("Device"));
+    parser.addPositionalArgument(QStringLiteral("udi <argument>"), i18n("Device"));
 
     aboutData.setupCommandLine(&parser);
     parser.process(app);
@@ -65,9 +65,10 @@ int main(int argc, char *argv[])
     */
     DeviceList devList;
 
-    if (parser.positionalArguments().count() > 0)
-        {
-        Device device(parser.positionalArguments().at(0));
+    if (parser.positionalArguments().count() >= 2 &&
+	 parser.positionalArguments().at(0) == QStringLiteral("udi")
+    ) {
+        Device device(parser.positionalArguments().at(1));
         devList.setDeviceNotifier(device);
     }