Commit 89bcdb3e authored by Laurent Montel's avatar Laurent Montel 😁

Remove usage of kaboutdata and i18n in test apps

parent b98af2f2
......@@ -19,7 +19,6 @@
#include <KLocalizedString>
#include <QApplication>
#include <KAboutData>
#include <QCommandLineParser>
#include <QStandardPaths>
#include "../widgets/gravatarupdatedialog.h"
......@@ -28,17 +27,12 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
KAboutData aboutData(QStringLiteral("gravatarupdatedialog_gui"), i18n("Gravatarupdatedialog_Gui"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("Test for Gravatar update dialog"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
aboutData.setupCommandLine(&parser);
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("email"), i18n("Email address"), QStringLiteral("emailaddress")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("email"), QStringLiteral("Email address"), QStringLiteral("emailaddress")));
parser.process(app);
aboutData.processCommandLine(&parser);
QString email;
if (!parser.value(QStringLiteral("email")).isEmpty()) {
email = parser.value(QStringLiteral("email"));
......
......@@ -21,9 +21,7 @@
#include "pimcommon_debug.h"
#include <KLocalizedString>
#include <QApplication>
#include <KAboutData>
#include <QCommandLineParser>
#include <QStandardPaths>
......@@ -31,15 +29,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
KAboutData aboutData(QStringLiteral("shorturlng_gui"), i18n("ShortUrlNgTest_Gui"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("Test for short url widgetng"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
ShortUrlMainWidgetNg *w = new ShortUrlMainWidgetNg;
......
......@@ -20,10 +20,8 @@
#include "headerstylemenu_gui.h"
#include "messageviewer/headerstylemenumanager.h"
#include <QStandardPaths>
#include <KLocalizedString>
#include <QApplication>
#include <KAboutData>
#include <QCommandLineParser>
#include <QMenu>
#include <QMenuBar>
......@@ -65,15 +63,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
KAboutData aboutData(QStringLiteral("headerstylemenu_gui"), i18n("headerstylemenu_Gui"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("Test for headerstylemenu"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
HeaderStyleMenuTest *w = new HeaderStyleMenuTest();
w->resize(800, 200);
......
......@@ -20,8 +20,6 @@
#include "adblockautomaticruleslistwidget_gui.h"
#include "../widgets/adblockautomaticruleslistwidget.h"
#include <KAboutData>
#include <KLocalizedString>
#include <QCommandLineParser>
#include <QHBoxLayout>
#include <QApplication>
......@@ -50,23 +48,18 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
KAboutData aboutData(QStringLiteral("AdBlockAutomaticRulesListWidget_gui"), i18n("AdBlockAutomaticRulesListWidget_Gui"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("Test for AdBlockAutomaticRulesListWidget"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[url]"), i18n("URL of adblock file list")));
parser.addOption(QCommandLineOption(QStringList() << QStringLiteral("+[url]"), QStringLiteral("URL of adblock file list")));
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
QString fileName;
if (!parser.positionalArguments().isEmpty()) {
fileName = parser.positionalArguments().at(0);
} else {
fileName = QFileDialog::getOpenFileName(nullptr, QString(), QString(), i18n("Adblock File (*)"));
fileName = QFileDialog::getOpenFileName(nullptr, QString(), QString(), QStringLiteral("Adblock File (*)"));
}
if (fileName.isEmpty()) {
return 0;
......
......@@ -18,8 +18,6 @@
*/
#include <QApplication>
#include <KAboutData>
#include <KLocalizedString>
#include <QCommandLineParser>
#include <QStandardPaths>
......@@ -29,15 +27,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
KAboutData aboutData(QStringLiteral("adblocksettings_gui"), i18n("adblocksettingstest_Gui"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("Test for adblocksettings"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
AdBlock::AdBlockSettingWidget *w = new AdBlock::AdBlockSettingWidget;
w->show();
return app.exec();
......
......@@ -19,10 +19,8 @@
#include <QDialog>
#include <QApplication>
#include <KAboutData>
#include <QVBoxLayout>
#include <QPushButton>
#include <KLocalizedString>
#include <QCommandLineParser>
#include <QDialogButtonBox>
#include <QStandardPaths>
......@@ -32,15 +30,10 @@ int main(int argc, char **argv)
{
QApplication app(argc, argv);
QStandardPaths::setTestModeEnabled(true);
KAboutData aboutData(QStringLiteral("adblocksettings_gui"), i18n("adblocksettingstest_Gui"), QStringLiteral("1.0"));
aboutData.setShortDescription(i18n("Test for adblocksettings"));
QCommandLineParser parser;
KAboutData::setApplicationData(aboutData);
parser.addVersionOption();
parser.addHelpOption();
aboutData.setupCommandLine(&parser);
parser.process(app);
aboutData.processCommandLine(&parser);
AdBlock::AdBlockSettingWidget *w = new AdBlock::AdBlockSettingWidget;
QDialog dlg;
......
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