Rename calligraversion.h -> kritaversion.h

parent d179a967
......@@ -73,29 +73,29 @@ endif()
#######################
######################
# define common versions of Calligra applications, used to generate calligraversion.h
# define common versions of Krita applications, used to generate kritaversion.h
# update these version for every release:
set(CALLIGRA_VERSION_STRING "3.0 Beta")
set(CALLIGRA_STABLE_VERSION_MAJOR 3) # 3 for 3.x, 4 for 4.x, etc.
set(CALLIGRA_STABLE_VERSION_MINOR 0) # 0 for 3.0, 1 for 3.1, etc.
set(CALLIGRA_VERSION_RELEASE 90) # 89 for Alpha, increase for next test releases, set 0 for first Stable, etc.
#set(CALLIGRA_ALPHA 1) # uncomment only for Alpha
set(CALLIGRA_BETA 1) # uncomment only for Beta
#set(CALLIGRA_RC 1) # uncomment only for RC
set(CALLIGRA_YEAR 2016) # update every year
if(NOT DEFINED CALLIGRA_ALPHA AND NOT DEFINED CALLIGRA_BETA AND NOT DEFINED CALLIGRA_RC)
set(CALLIGRA_STABLE 1) # do not edit
set(KRITA_VERSION_STRING "3.0 Beta")
set(KRITA_STABLE_VERSION_MAJOR 3) # 3 for 3.x, 4 for 4.x, etc.
set(KRITA_STABLE_VERSION_MINOR 0) # 0 for 3.0, 1 for 3.1, etc.
set(KRITA_VERSION_RELEASE 90) # 89 for Alpha, increase for next test releases, set 0 for first Stable, etc.
#set(KRITA_ALPHA 1) # uncomment only for Alpha
set(KRITA_BETA 1) # uncomment only for Beta
#set(KRITA_RC 1) # uncomment only for RC
set(KRITA_YEAR 2016) # update every year
if(NOT DEFINED KRITA_ALPHA AND NOT DEFINED KRITA_BETA AND NOT DEFINED KRITA_RC)
set(KRITA_STABLE 1) # do not edit
endif()
message(STATUS "Krita version: ${CALLIGRA_VERSION_STRING}")
message(STATUS "Krita version: ${KRITA_VERSION_STRING}")
# Define the generic version of the Krita libraries here
# This makes it easy to advance it when the next Krita release comes.
# 14 was the last GENERIC_KRITA_LIB_VERSION_MAJOR of the previous Krita series
# (2.x) so we're starting with 15 in 3.x series.
if(CALLIGRA_STABLE_VERSION_MAJOR EQUAL 3)
math(EXPR GENERIC_KRITA_LIB_VERSION_MAJOR "${CALLIGRA_STABLE_VERSION_MINOR} + 15")
if(KRITA_STABLE_VERSION_MAJOR EQUAL 3)
math(EXPR GENERIC_KRITA_LIB_VERSION_MAJOR "${KRITA_STABLE_VERSION_MINOR} + 15")
else()
# let's make sure we won't forget to update the "15"
message(FATAL_ERROR "Reminder: please update offset == 15 used to compute GENERIC_KRITA_LIB_VERSION_MAJOR to something bigger")
......
......@@ -27,23 +27,23 @@
#include <KAboutData>
#include <kis_debug.h>
#include <calligraversion.h>
#include <kritaversion.h>
#include <kritagitversion.h>
#include "mainwindow.h"
int main( int argc, char **argv )
{
QString calligraVersion(CALLIGRA_VERSION_STRING);
QString kritaVersion(KRITA_VERSION_STRING);
QString version;
KLocalizedString::setApplicationDomain( "crashhandler" );
#ifdef KRITA_GIT_SHA1_STRING
QString gitVersion(KRITA_GIT_SHA1_STRING);
version = QString("%1 (git %2)").arg(calligraVersion).arg(gitVersion).toLatin1();
version = QString("%1 (git %2)").arg(kritaVersion).arg(gitVersion).toLatin1();
#else
version = calligraVersion;
version = kritaVersion;
#endif
KAboutData aboutData("krita",
i18n("Krita Crash Reporter"),
......
......@@ -25,7 +25,7 @@
#include <klocalizedstring.h>
#include <KoResourcePaths.h>
#include <calligraversion.h>
#include <kritaversion.h>
#include <kritagitversion.h>
#include <cstdlib>
......@@ -283,15 +283,15 @@ void MainWindow::startUpload()
typedef QPair<QByteArray, QByteArray> Field;
QList<Field> fields;
QString calligraVersion(CALLIGRA_VERSION_STRING);
QString kritaVersion(KRITA_VERSION_STRING);
QString version;
#ifdef KRITA_GIT_SHA1_STRING
QString gitVersion(KRITA_GIT_SHA1_STRING);
version = QString("%1-%2").arg(calligraVersion).arg(gitVersion).toLatin1();
version = QString("%1-%2").arg(kritaVersion).arg(gitVersion).toLatin1();
#else
version = calligraVersion;
version = kritaVersion;
#endif
fields << Field("BuildID", KRITA_GIT_SHA1_STRING)
......
......@@ -38,7 +38,7 @@
#include "sketch/SketchInputContext.h"
#include <calligraversion.h>
#include <kritaversion.h>
#include <kritagitversion.h>
#if defined Q_OS_WIN
......@@ -51,15 +51,15 @@
int main( int argc, char** argv )
{
QString calligraVersion(CALLIGRA_VERSION_STRING);
QString kritaVersion(KRITA_VERSION_STRING);
QString version;
#ifdef KRITA_GIT_SHA1_STRING
QString gitVersion(KRITA_GIT_SHA1_STRING);
version = QString("%1 (git %2)").arg(calligraVersion).arg(gitVersion).toLatin1();
version = QString("%1 (git %2)").arg(kritaVersion).arg(gitVersion).toLatin1();
#else
version = calligraVersion;
version = kritaVersion;
#endif
......@@ -69,7 +69,7 @@ int main( int argc, char** argv )
version.toLatin1(),
ki18n("Krita Gemini: Painting at Home and on the Go for Artists"),
KAboutData::License_GPL,
ki18n("(c) 1999-%1 The Krita team.\n").subs(CALLIGRA_YEAR),
ki18n("(c) 1999-%1 The Krita team.\n").subs(KRITA_YEAR),
KLocalizedString(),
"http://www.kritastudio.com",
"submit@bugs.kde.org");
......
......@@ -31,7 +31,7 @@
#include "KoGlobal.h"
#include <KoResourcePaths.h>
#include <calligraversion.h>
#include <kritaversion.h>
#include <kritagitversion.h>
#include <opengl/kis_opengl.h>
#include <kis_icon.h>
......@@ -53,15 +53,15 @@
int main( int argc, char** argv )
{
QString calligraVersion(CALLIGRA_VERSION_STRING);
QString kritaVersion(KRITA_VERSION_STRING);
QString version;
#ifdef KRITA_GIT_SHA1_STRING
QString gitVersion(KRITA_GIT_SHA1_STRING);
version = QString("%1 (git %2)").arg(calligraVersion).arg(gitVersion).toLatin1();
version = QString("%1 (git %2)").arg(kritaVersion).arg(gitVersion).toLatin1();
#else
version = calligraVersion;
version = kritaVersion;
#endif
KLocalizedString::setApplicationDomain("krita");
......@@ -71,7 +71,7 @@ int main( int argc, char** argv )
QStringLiteral("0.1"),
i18n("Krita Sketch: Painting on the Go for Artists"),
KAboutLicense::GPL,
i18n("(c) 1999-%1 The Krita team.\n").arg(CALLIGRA_YEAR),
i18n("(c) 1999-%1 The Krita team.\n").arg(KRITA_YEAR),
QString(),
QStringLiteral("https://www.krita.org"),
QStringLiteral("submit@bugs.kde.org"));
......
......@@ -719,16 +719,16 @@ void KisMainWindow::updateCaption()
void KisMainWindow::updateCaption(const QString & caption, bool mod)
{
dbgUI << "KisMainWindow::updateCaption(" << caption << "," << mod << ")";
#ifdef CALLIGRA_ALPHA
setCaption(QString("ALPHA %1: %2").arg(CALLIGRA_ALPHA).arg(caption), mod);
#ifdef KRITA_ALPHA
setCaption(QString("ALPHA %1: %2").arg(KRITA_ALPHA).arg(caption), mod);
return;
#endif
#ifdef CALLIGRA_BETA
setCaption(QString("BETA %1: %2").arg(CALLIGRA_BETA).arg(caption), mod);
#ifdef KRITA_BETA
setCaption(QString("BETA %1: %2").arg(KRITA_BETA).arg(caption), mod);
return;
#endif
#ifdef CALLIGRA_RC
setCaption(QString("RELEASE CANDIDATE %1: %2").arg(CALLIGRA_RC).arg(caption), mod);
#ifdef KRITA_RC
setCaption(QString("RELEASE CANDIDATE %1: %2").arg(KRITA_RC).arg(caption), mod);
return;
#endif
......
# generate calligraversion.h
configure_file(calligraversion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/calligraversion.h)
# generate kritaversion.h
configure_file(kritaversion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kritaversion.h)
# generate kritagitversion.h
configure_file(kritagitversion.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/kritagitversion.h)
set(kritaversion_LIB_SRCS
calligraversion.cpp
KritaVersionWrapper.cpp
)
......
......@@ -17,18 +17,18 @@
*/
#include <KritaVersionWrapper.h>
#include <calligraversion.h>
#include <kritaversion.h>
#include <kritagitversion.h>
QString KritaVersionWrapper::versionString(bool checkGit)
{
QString calligraVersion(CALLIGRA_VERSION_STRING);
QString version = calligraVersion;
QString kritaVersion(KRITA_VERSION_STRING);
QString version = kritaVersion;
if (checkGit) {
#ifdef KRITA_GIT_SHA1_STRING
QString gitVersion(KRITA_GIT_SHA1_STRING);
version = QString("%1 (git %2)").arg(calligraVersion).arg(gitVersion).toLatin1();
version = QString("%1 (git %2)").arg(kritaVersion).arg(gitVersion).toLatin1();
#endif
}
return version;
......
/* This file is part of the Calligra libraries
Copyright (c) 2003 David Faure <faure@kde.org>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
#include "calligraversion.h"
/* This file is part of the Calligra libraries
/* This file is part of the Krita libraries
Copyright (c) 2003 David Faure <faure@kde.org>
Copyright (c) 2003 Lukas Tinkl <lukas@kde.org>
Copyright (c) 2004 Nicolas Goutte <goutte@kde.org>
......@@ -20,154 +20,153 @@
* Boston, MA 02110-1301, USA.
*/
#ifndef _CALLIGRA_VERSION_H_
#define _CALLIGRA_VERSION_H_
#ifndef _KRITA_VERSION_H_
#define _KRITA_VERSION_H_
#include "kritaversion_export.h"
// -- WARNING: do not edit values below, instead edit CALLIGRA_* in /CMakeLists.txt --
// -- WARNING: do not edit values below, instead edit KRITA_* in /CMakeLists.txt --
/**
* @def CALLIGRA_VERSION_STRING
* @ingroup CalligraMacros
* @brief Version of Calligra as string, at compile time
* @def KRITA_VERSION_STRING
* @ingroup KritaMacros
* @brief Version of Krita as string, at compile time
*
* This macro contains the Calligra version in string form. As it is a macro,
* it contains the version at compile time. See Calligra::versionString() if you need
* the Calligra version used at runtime.
* This macro contains the Krita version in string form. As it is a macro,
* it contains the version at compile time.
*
* @note The version string might contain spaces and special characters,
* especially for development versions of Calligra.
* especially for development versions of Krita.
* If you use that macro directly for a file format (e.g. OASIS Open Document)
* or for a protocol (e.g. http) be careful that it is appropriate.
* (Fictional) example: "3.0 Alpha"
*/
#define CALLIGRA_VERSION_STRING "@CALLIGRA_VERSION_STRING@"
#define KRITA_VERSION_STRING "@KRITA_VERSION_STRING@"
/**
* @def CALLIGRA_STABLE_VERSION_MAJOR
* @ingroup CalligraMacros
* @brief Major version of stable Calligra, at compile time
* CALLIGRA_VERSION_MAJOR is computed based on this value.
* @def KRITA_STABLE_VERSION_MAJOR
* @ingroup KritaMacros
* @brief Major version of stable Krita, at compile time
* KRITA_VERSION_MAJOR is computed based on this value.
*/
#define CALLIGRA_STABLE_VERSION_MAJOR @CALLIGRA_STABLE_VERSION_MAJOR@
#define KRITA_STABLE_VERSION_MAJOR @KRITA_STABLE_VERSION_MAJOR@
/**
* @def CALLIGRA_VERSION_MAJOR
* @ingroup CalligraMacros
* @brief Major version of Calligra, at compile time
* @def KRITA_VERSION_MAJOR
* @ingroup KritaMacros
* @brief Major version of Krita, at compile time
*
* Generally it's the same as CALLIGRA_STABLE_VERSION_MAJOR but for unstable x.0
* Generally it's the same as KRITA_STABLE_VERSION_MAJOR but for unstable x.0
* x is decreased by one, e.g. 3.0 Beta is 2.99.
*/
#if !defined CALLIGRA_STABLE && @CALLIGRA_STABLE_VERSION_MINOR@ == 0
# define CALLIGRA_VERSION_MAJOR (CALLIGRA_STABLE_VERSION_MAJOR - 1)
#if !defined KRITA_STABLE && @KRITA_STABLE_VERSION_MINOR@ == 0
# define KRITA_VERSION_MAJOR (KRITA_STABLE_VERSION_MAJOR - 1)
#else
# define CALLIGRA_VERSION_MAJOR CALLIGRA_STABLE_VERSION_MAJOR
# define KRITA_VERSION_MAJOR KRITA_STABLE_VERSION_MAJOR
#endif
/**
* @def CALLIGRA_STABLE_VERSION_MINOR
* @ingroup CalligraMacros
* @brief Minor version of stable Calligra, at compile time
* CALLIGRA_VERSION_MINOR is computed based on this value.
* @def KRITA_STABLE_VERSION_MINOR
* @ingroup KritaMacros
* @brief Minor version of stable Krita, at compile time
* KRITA_VERSION_MINOR is computed based on this value.
*/
#define CALLIGRA_STABLE_VERSION_MINOR @CALLIGRA_STABLE_VERSION_MINOR@
#define KRITA_STABLE_VERSION_MINOR @KRITA_STABLE_VERSION_MINOR@
/**
* @def CALLIGRA_VERSION_MINOR
* @ingroup CalligraMacros
* @brief Minor version of Calligra, at compile time
* @def KRITA_VERSION_MINOR
* @ingroup KritaMacros
* @brief Minor version of Krita, at compile time
*
* Generally it's equal to CALLIGRA_STABLE_VERSION_MINOR for stable releases,
* Generally it's equal to KRITA_STABLE_VERSION_MINOR for stable releases,
* equal to 99 for x.0 unstable releases (e.g. it's 3.0 Beta has minor version 99),
* and equal to CALLIGRA_STABLE_VERSION_MINOR-1 for unstable releases other than x.0.
* and equal to KRITA_STABLE_VERSION_MINOR-1 for unstable releases other than x.0.
*/
#ifdef CALLIGRA_STABLE
# define CALLIGRA_VERSION_MINOR CALLIGRA_STABLE_VERSION_MINOR
#elif CALLIGRA_STABLE_VERSION_MINOR == 0
# define CALLIGRA_VERSION_MINOR 99
#ifdef KRITA_STABLE
# define KRITA_VERSION_MINOR KRITA_STABLE_VERSION_MINOR
#elif KRITA_STABLE_VERSION_MINOR == 0
# define KRITA_VERSION_MINOR 99
#else
# define CALLIGRA_VERSION_MINOR (CALLIGRA_STABLE_VERSION_MINOR - 1)
# define KRITA_VERSION_MINOR (KRITA_STABLE_VERSION_MINOR - 1)
#endif
/**
* @def CALLIGRA_VERSION_RELEASE
* @ingroup CalligraMacros
* @brief Release version of Calligra, at compile time.
* @def KRITA_VERSION_RELEASE
* @ingroup KritaMacros
* @brief Release version of Krita, at compile time.
* 89 for Alpha.
*/
#define CALLIGRA_VERSION_RELEASE @CALLIGRA_VERSION_RELEASE@
#define KRITA_VERSION_RELEASE @KRITA_VERSION_RELEASE@
/**
* @def CALLIGRA_STABLE_VERSION_RELEASE
* @ingroup CalligraMacros
* @brief Release version of Calligra, at compile time.
* @def KRITA_STABLE_VERSION_RELEASE
* @ingroup KritaMacros
* @brief Release version of Krita, at compile time.
*
* Equal to CALLIGRA_VERSION_RELEASE for stable releases and 0 for unstable ones.
* Equal to KRITA_VERSION_RELEASE for stable releases and 0 for unstable ones.
*/
#ifdef CALLIGRA_STABLE
# define CALLIGRA_STABLE_VERSION_RELEASE 0
#ifdef KRITA_STABLE
# define KRITA_STABLE_VERSION_RELEASE 0
#else
# define CALLIGRA_STABLE_VERSION_RELEASE @CALLIGRA_VERSION_RELEASE@
# define KRITA_STABLE_VERSION_RELEASE @KRITA_VERSION_RELEASE@
#endif
/**
* @def CALLIGRA_ALPHA
* @ingroup CalligraMacros
* @brief If defined (1..9), indicates at compile time that Calligra is in alpha stage
* @def KRITA_ALPHA
* @ingroup KritaMacros
* @brief If defined (1..9), indicates at compile time that Krita is in alpha stage
*/
#cmakedefine CALLIGRA_ALPHA @CALLIGRA_ALPHA@
#cmakedefine KRITA_ALPHA @KRITA_ALPHA@
/**
* @def CALLIGRA_BETA
* @ingroup CalligraMacros
* @brief If defined (1..9), indicates at compile time that Calligra is in beta stage
* @def KRITA_BETA
* @ingroup KritaMacros
* @brief If defined (1..9), indicates at compile time that Krita is in beta stage
*/
#cmakedefine CALLIGRA_BETA @CALLIGRA_BETA@
#cmakedefine KRITA_BETA @KRITA_BETA@
/**
* @def CALLIGRA_RC
* @ingroup CalligraMacros
* @brief If defined (1..9), indicates at compile time that Calligra is in "release candidate" stage
* @def KRITA_RC
* @ingroup KritaMacros
* @brief If defined (1..9), indicates at compile time that Krita is in "release candidate" stage
*/
#cmakedefine CALLIGRA_RC @CALLIGRA_RC@
#cmakedefine KRITA_RC @KRITA_RC@
/**
* @def CALLIGRA_STABLE
* @ingroup CalligraMacros
* @brief If defined, indicates at compile time that Calligra is in stable stage
* @def KRITA_STABLE
* @ingroup KritaMacros
* @brief If defined, indicates at compile time that Krita is in stable stage
*/
#cmakedefine CALLIGRA_STABLE @CALLIGRA_STABLE@
#cmakedefine KRITA_STABLE @KRITA_STABLE@
/**
* @ingroup CalligraMacros
* @brief Make a number from the major, minor and release number of a Calligra version
* @ingroup KritaMacros
* @brief Make a number from the major, minor and release number of a Krita version
*
* This function can be used for preprocessing when CALLIGRA_IS_VERSION is not
* This function can be used for preprocessing when KRITA_IS_VERSION is not
* appropriate.
*/
#define CALLIGRA_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c))
#define KRITA_MAKE_VERSION( a,b,c ) (((a) << 16) | ((b) << 8) | (c))
/**
* @ingroup CalligraMacros
* @brief Version of Calligra as number, at compile time
* @ingroup KritaMacros
* @brief Version of Krita as number, at compile time
*
* This macro contains the Calligra version in number form. As it is a macro,
* This macro contains the Krita version in number form. As it is a macro,
* it contains the version at compile time. See version() if you need
* the Calligra version used at runtime.
* the Krita version used at runtime.
*/
#define CALLIGRA_VERSION \
CALLIGRA_MAKE_VERSION(CALLIGRA_VERSION_MAJOR,CALLIGRA_VERSION_MINOR,CALLIGRA_VERSION_RELEASE)
#define KRITA_VERSION \
KRITA_MAKE_VERSION(KRITA_VERSION_MAJOR,KRITA_VERSION_MINOR,KRITA_VERSION_RELEASE)
/**
* @def CALLIGRA_YEAR
* @ingroup CalligraMacros
* @brief Year of the Calligra release, set at compile time
* @def KRITA_YEAR
* @ingroup KritaMacros
* @brief Year of the Krita release, set at compile time
*
* This macro is used in "About application" dialog for strings such as "© 2012-..., The Author Team".
*/
#define CALLIGRA_YEAR "@CALLIGRA_YEAR@"
#define KRITA_YEAR "@KRITA_YEAR@"
#endif // _CALLIGRA_VERSION_H_
#endif // _KRITA_VERSION_H_
......@@ -12,7 +12,7 @@ APP=krita
cd $BUILDROOT
VER=$(grep "#define CALLIGRA_VERSION_STRING" /build/libs/version/calligraversion.h | cut -d '"' -f 2)
VER=$(grep "#define KRITA_VERSION_STRING" /build/libs/version/kritaversion.h | cut -d '"' -f 2)
cd $BUILDROOT/krita
BRANCH=$( git branch | cut -d ' ' -f 2)
REVISION=$(git rev-parse --short HEAD)
......
......@@ -12,7 +12,7 @@ APP=krita
cd $BUILDROOT
VER=$(grep "#define CALLIGRA_VERSION_STRING" /build/libs/version/calligraversion.h | cut -d '"' -f 2)
VER=$(grep "#define KRITA_VERSION_STRING" /build/libs/version/kritaversion.h | cut -d '"' -f 2)
cd $BUILDROOT/krita
BRANCH=$( git branch | cut -d ' ' -f 2)
REVISION=$(git rev-parse --short HEAD)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment