File indexing completed on 2024-10-13 05:12:37

0001 /*
0002     SPDX-FileCopyrightText: 2017, 2020 Friedrich W. H. Kossebau <kossebau@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-or-later
0005 */
0006 
0007 #include "markdownpartfactory.hpp"
0008 
0009 // part
0010 #include "markdownpart.hpp"
0011 // KF
0012 #include <KLocalizedString>
0013 
0014 
0015 MarkdownPartFactory::MarkdownPartFactory() = default;
0016 
0017 MarkdownPartFactory::~MarkdownPartFactory() = default;
0018 
0019 QObject* MarkdownPartFactory::create(const char* iface,
0020                                      QWidget* parentWidget, QObject* parent,
0021                                      const QVariantList& args)
0022 {
0023     const bool wantBrowserView = (args.contains(QStringLiteral("Browser/View")) ||
0024                                  (strcmp(iface, "Browser/View") == 0));
0025     const MarkdownPart::Modus modus =
0026         wantBrowserView ? MarkdownPart::BrowserViewModus :
0027         /* else */        MarkdownPart::ReadOnlyModus;
0028 
0029     return new MarkdownPart(parentWidget, parent, metaData(), modus);
0030 }
0031 
0032 #include "moc_markdownpartfactory.cpp"