2 * Copyright 2008 by Aaron Seigo <aseigo@kde.org>
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Library General Public License as
6 * published by the Free Software Foundation; either version 2, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details
14 * You should have received a copy of the GNU Library General Public
15 * License along with this program; if not, write to the
16 * Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
20 #include <plasma/version.h>
26 unsigned int version()
28 return PLASMA_VERSION
;
31 unsigned int versionMajor()
33 return PLASMA_VERSION_MAJOR
;
36 unsigned int versionMinor()
38 return PLASMA_VERSION_MINOR
;
41 unsigned int versionRelease()
43 return PLASMA_VERSION_RELEASE
;
46 const char *versionString()
48 return PLASMA_VERSION_STRING
;
51 bool isPluginVersionCompatible(unsigned int version
)
53 // we require PLASMA_VERSION_MAJOR and PLASMA_VERSION_MINOR
54 const quint32 minVersion
= PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR
, 0, 0);
55 const quint32 maxVersion
= PLASMA_MAKE_VERSION(PLASMA_VERSION_MAJOR
, PLASMA_VERSION_MINOR
, 60);
57 if (version
< minVersion
|| version
> maxVersion
) {
58 kDebug() << "plugin is compiled against incompatible Plasma version " << version
59 << "This build is compatible with" << PLASMA_VERSION_MAJOR
<< ".0.0 (" << minVersion
60 << ") to" << PLASMA_VERSION_STRING
<< "(" << maxVersion
<< ")";