File indexing completed on 2024-07-14 14:29:49

0001 /*  This file is part of the KDE libraries
0002     SPDX-FileCopyrightText: 2013 Aleix Pol Gonzalez <aleixpol@blue-systems.com>
0003 
0004     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0005 */
0006 
0007 #include <QDebug>
0008 #include <QDesktopServices>
0009 #include <QGuiApplication>
0010 #include <QUrl>
0011 
0012 int main(int argc, char **argv)
0013 {
0014     QGuiApplication app(argc, argv);
0015     if (app.arguments().count() <= 1 || app.arguments().last() == QLatin1String("--help")) {
0016         qDebug() << "please use ./openurltest <url>";
0017         return 0;
0018     }
0019     QDesktopServices::openUrl(QUrl(app.arguments().last()));
0020 
0021     QMetaObject::invokeMethod(&app, "quit", Qt::QueuedConnection);
0022     return app.exec();
0023 }