File indexing completed on 2024-04-14 04:53:29

0001 /*
0002     SPDX-FileCopyrightText: 2008 Urs Wolfer <uwolfer@kde.org>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #include "testviewfactory.h"
0008 
0009 #include <KLocalizedString>
0010 
0011 K_PLUGIN_CLASS_WITH_JSON(TestViewFactory, "krdc_test.json")
0012 
0013 TestViewFactory::TestViewFactory(QObject *parent, const QVariantList &args)
0014     : RemoteViewFactory(parent)
0015 {
0016     Q_UNUSED(args);
0017 
0018     KLocalizedString::setApplicationDomain("krdc");
0019 }
0020 
0021 TestViewFactory::~TestViewFactory()
0022 {
0023 }
0024 
0025 bool TestViewFactory::supportsUrl(const QUrl &url) const
0026 {
0027     return (url.scheme().compare(QLatin1String("test"), Qt::CaseInsensitive) == 0);
0028 }
0029 
0030 RemoteView *TestViewFactory::createView(QWidget *parent, const QUrl &url, KConfigGroup configGroup)
0031 {
0032     return new TestView(parent, url, configGroup);
0033 }
0034 
0035 HostPreferences *TestViewFactory::createHostPreferences(KConfigGroup configGroup, QWidget *parent)
0036 {
0037     Q_UNUSED(configGroup);
0038     Q_UNUSED(parent);
0039 
0040     return nullptr;
0041 }
0042 
0043 QString TestViewFactory::scheme() const
0044 {
0045     return QLatin1String("test");
0046 }
0047 
0048 QString TestViewFactory::connectActionText() const
0049 {
0050     return QLatin1String("New Test Connection..."); // no i18n required, just internal test plugin!
0051 }
0052 
0053 QString TestViewFactory::connectButtonText() const
0054 {
0055     return QLatin1String("KRDC Test Connection"); // no i18n required, just internal test plugin!
0056 }
0057 
0058 QString TestViewFactory::connectToolTipText() const
0059 {
0060     return QLatin1String(
0061         "<html>Enter the address here. Port is optional.<br />"
0062         "<i>Example: testserver (host)</i></html>"); // no i18n required, just internal test plugin!
0063 }
0064 
0065 #include "testviewfactory.moc"