~neon/kompare/master

« back to all changes in this revision

Viewing changes to src/komparepart/kompare_partfactory.cpp

  • Committer: Friedrich W. H. Kossebau
  • Date: 2020-12-05 12:59:32 UTC
  • Revision ID: git-v1:832efc037be13732da76b49200098eff83d7f4ed
Port to new KPluginMetaData-based KParts API

NO_CHANGELOG

Show diffs side-by-side

added added

removed removed

Lines of Context:
7
7
#include "kompare_partfactory.h"
8
8
 
9
9
#include "kompare_part.h"
 
10
#if KPARTS_VERSION < QT_VERSION_CHECK(5, 77, 0)
10
11
#include "../kompare_version.h"
 
12
#endif
11
13
 
12
14
// KF
13
15
#include <KLocalizedString>
 
16
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
 
17
#include <KPluginMetaData>
 
18
#endif
14
19
 
15
20
KomparePartFactory::KomparePartFactory()
 
21
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
 
22
{
 
23
#else
16
24
    : m_aboutData(QStringLiteral("komparepart"),
17
25
                  i18n("KomparePart"),
18
26
                  QStringLiteral(KOMPARE_VERSION_STRING),
23
31
    m_aboutData.addAuthor(i18n("John Firebaugh"), i18n("Author"), QStringLiteral("jfirebaugh@kde.org"));
24
32
    m_aboutData.addAuthor(i18n("Otto Bruggeman"), i18n("Author"), QStringLiteral("bruggie@gmail.com"));
25
33
    m_aboutData.addAuthor(i18n("Kevin Kofler"), i18n("Author"), QStringLiteral("kevin.kofler@chello.at"));
 
34
#endif
26
35
}
27
36
 
28
37
KomparePartFactory::~KomparePartFactory() = default;
39
48
        wantReadOnly ? KomparePart::ReadOnlyModus :
40
49
        /* else */     KomparePart::ReadWriteModus;
41
50
 
 
51
#if KPARTS_VERSION >= QT_VERSION_CHECK(5, 77, 0)
 
52
    KomparePart* part = new KomparePart(parentWidget, parent, metaData(), modus);
 
53
#else
42
54
    KomparePart* part = new KomparePart(parentWidget, parent, m_aboutData, modus);
 
55
#endif
43
56
 
44
57
    return part;
45
58
}