[poppler] qt5/src

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Dec 18 23:58:17 UTC 2018


 qt5/src/CMakeLists.txt       |    4 ++
 qt5/src/poppler-version.cpp  |   40 ++++++++++++++++++++++++++
 qt5/src/poppler-version.h.in |   66 +++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 110 insertions(+)

New commits:
commit e676558a8b2d71906f1bf77407318a4fef6a60c2
Author: Albert Astals Cid <aacid at kde.org>
Date:   Sun Dec 16 23:40:02 2018 +0100

    qt5: Add the possibility of getting version
    
    We provide both the build and runtime version, so if an app was built
    against poppler 0.65 but running against 0.72, the app can say somewhere
    in it's about/config dialogs
    
    Running poppler 0.72 (built against 0.65)
    
    This way we can explain to users while some features are not available
    even if they should be, because the runtime and build time differences
    sometimes matter

diff --git a/qt5/src/CMakeLists.txt b/qt5/src/CMakeLists.txt
index de565b23..5269d620 100644
--- a/qt5/src/CMakeLists.txt
+++ b/qt5/src/CMakeLists.txt
@@ -12,6 +12,8 @@ set(CMAKE_C_VISIBILITY_PRESET hidden)
 set(CMAKE_CXX_VISIBILITY_PRESET hidden)
 set(CMAKE_VISIBILITY_INLINES_HIDDEN 1)
 
+configure_file(poppler-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h @ONLY)
+
 set(poppler_qt5_SRCS
   poppler-annotation.cc
   poppler-document.cc
@@ -33,6 +35,7 @@ set(poppler_qt5_SRCS
   poppler-page-transition.cc
   poppler-media.cc
   ArthurOutputDev.cc
+  poppler-version.cpp
 )
 add_library(poppler-qt5 ${poppler_qt5_SRCS})
 set_target_properties(poppler-qt5 PROPERTIES VERSION 1.17.0 SOVERSION 1)
@@ -55,5 +58,6 @@ install(FILES
   poppler-export.h
   poppler-page-transition.h
   poppler-media.h
+  ${CMAKE_CURRENT_BINARY_DIR}/poppler-version.h
   DESTINATION include/poppler/qt5)
 
diff --git a/qt5/src/poppler-version.cpp b/qt5/src/poppler-version.cpp
new file mode 100644
index 00000000..015267c1
--- /dev/null
+++ b/qt5/src/poppler-version.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2009-2010, Pino Toscano <pino at kde.org>
+ * Copyright (C) 2018, Albert Astals Cid <aacid at kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#include "poppler-version.h"
+
+QString Poppler::Version::string()
+{
+    return QStringLiteral(POPPLER_VERSION);
+}
+
+unsigned int Poppler::Version::major()
+{
+    return POPPLER_VERSION_MAJOR;
+}
+
+unsigned int Poppler::Version::minor()
+{
+    return POPPLER_VERSION_MINOR;
+}
+
+unsigned int Poppler::Version::micro()
+{
+    return POPPLER_VERSION_MICRO;
+}
diff --git a/qt5/src/poppler-version.h.in b/qt5/src/poppler-version.h.in
new file mode 100644
index 00000000..9dd3c1e1
--- /dev/null
+++ b/qt5/src/poppler-version.h.in
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2009, Pino Toscano <pino at kde.org>
+ * Copyright (C) 2018, Albert Astals Cid <aacid at kde.org>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2, or (at your option)
+ * any later version.
+ *
+ * This program 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+#ifndef POPPLER_VERSION_H
+#define POPPLER_VERSION_H
+
+#include "poppler-export.h"
+
+#include <QString>
+
+#define POPPLER_VERSION "@POPPLER_VERSION@"
+#define POPPLER_VERSION_MAJOR @POPPLER_MAJOR_VERSION@
+#define POPPLER_VERSION_MINOR @POPPLER_MINOR_VERSION@
+#define POPPLER_VERSION_MICRO @POPPLER_MICRO_VERSION@
+
+namespace Poppler
+{
+
+namespace Version
+{
+
+/**
+ \since 0.73
+ \returns the version string of the current poppler-qt5 library
+ */
+POPPLER_QT5_EXPORT QString string();
+
+/**
+ \since 0.73
+ \returns the "major" number of the version of the current poppler-qt5 library
+ */
+POPPLER_QT5_EXPORT unsigned int major();
+
+/**
+ \since 0.73
+ \returns the "minor" number of the version of the current poppler-qt5 library
+ */
+POPPLER_QT5_EXPORT unsigned int minor();
+
+/**
+ \since 0.73
+ \returns the "micro" number of the version of the current poppler-qt5 library
+ */
+POPPLER_QT5_EXPORT unsigned int micro();
+
+}
+
+}
+
+#endif


More information about the poppler mailing list