Plasma5Support

version.cpp
1/*
2 SPDX-FileCopyrightText: 2008 Aaron Seigo <aseigo@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#include "debug_p.h"
8#include <QDebug>
10
11namespace Plasma5Support
12{
13unsigned int version()
14{
15 return PLASMA5SUPPORT_VERSION;
16}
17
18unsigned int versionMajor()
19{
20 return PLASMA5SUPPORT_VERSION_MAJOR;
21}
22
23unsigned int versionMinor()
24{
25 return PLASMA5SUPPORT_VERSION_MINOR;
26}
27
28unsigned int versionRelease()
29{
30 return PLASMA5SUPPORT_VERSION_PATCH;
31}
32
33const char *versionString()
34{
35 return PLASMA5SUPPORT_VERSION_STRING;
36}
37
39{
40 if (version == quint32(-1)) {
41 // unversioned, just let it through
42 qCWarning(LOG_PLASMA5SUPPORT) << "unversioned plugin detected, may result in instability";
43 return true;
44 }
45
46 // we require PLASMA5SUPPORT_VERSION_MAJOR and PLASMA5SUPPORT_VERSION_MINOR
47 const quint32 minVersion = PLASMA5SUPPORT_MAKE_VERSION(PLASMA5SUPPORT_VERSION_MAJOR, 0, 0);
48 const quint32 maxVersion = PLASMA5SUPPORT_MAKE_VERSION(PLASMA5SUPPORT_VERSION_MAJOR, PLASMA5SUPPORT_VERSION_MINOR, 60);
49
50 if (version < minVersion || version > maxVersion) {
51#ifndef NDEBUG
52 // qCDebug(LOG_PLASMA5SUPPORT) << "plugin is compiled against incompatible Plasma version " << version
53 // << "This build is compatible with" << PLASMA5SUPPORT_VERSION_MAJOR << ".0.0 (" << minVersion
54 // << ") to" << PLASMA5SUPPORT_VERSION_STRING << "(" << maxVersion << ")";
55#endif
56 return false;
57 }
58
59 return true;
60}
61
62} // Plasma namespace
Namespace for everything in libplasma.
Definition datamodel.cpp:15
unsigned int version()
The runtime version of libplasma.
Definition version.cpp:13
unsigned int versionMinor()
The runtime major version of libplasma.
Definition version.cpp:23
const char * versionString()
The runtime version string of libplasma.
Definition version.cpp:33
bool isPluginVersionCompatible(unsigned int version)
Verifies that a plugin is compatible with plasma.
Definition version.cpp:38
unsigned int versionRelease()
The runtime major version of libplasma.
Definition version.cpp:28
unsigned int versionMajor()
The runtime major version of libplasma.
Definition version.cpp:18
<Plasma5Support/Version>
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:08:57 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.