From 90dac31a2e5d4f0f2c4208ffa5ef565940c00249 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Sat, 19 Dec 2015 16:38:24 +0200 Subject: [PATCH] Discard vmargins.h. Build backport files if only need. --HG-- branch : develop --- .../valentina/dialogs/dialoglayoutsettings.h | 7 +++- src/libs/vlayout/vlayoutgenerator.h | 9 ++++- src/libs/vmisc/vmargins.h | 40 ------------------- src/libs/vmisc/vmisc.pri | 25 ++++++++---- src/libs/vmisc/vsettings.h | 6 ++- 5 files changed, 36 insertions(+), 51 deletions(-) delete mode 100644 src/libs/vmisc/vmargins.h diff --git a/src/app/valentina/dialogs/dialoglayoutsettings.h b/src/app/valentina/dialogs/dialoglayoutsettings.h index a3395a36a..d5559467b 100644 --- a/src/app/valentina/dialogs/dialoglayoutsettings.h +++ b/src/app/valentina/dialogs/dialoglayoutsettings.h @@ -35,7 +35,12 @@ #include "../vlayout/vbank.h" #include "../ifc/ifcdef.h" #include "../vlayout/vlayoutgenerator.h" -#include "../vmisc/vmargins.h" + +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) +# include "../vmisc/backport/qmarginsf.h" +#else +# include +#endif namespace Ui { diff --git a/src/libs/vlayout/vlayoutgenerator.h b/src/libs/vlayout/vlayoutgenerator.h index 2f57538ea..198b6bf45 100644 --- a/src/libs/vlayout/vlayoutgenerator.h +++ b/src/libs/vlayout/vlayoutgenerator.h @@ -31,11 +31,16 @@ #include #include +#include #include "vlayoutdef.h" #include "vbank.h" -#include "../vmisc/vmargins.h" -#include + +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) +# include "../vmisc/backport/qmarginsf.h" +#else +# include +#endif class VLayoutPaper; class VLayoutDetail; diff --git a/src/libs/vmisc/vmargins.h b/src/libs/vmisc/vmargins.h deleted file mode 100644 index 5f3a339f6..000000000 --- a/src/libs/vmisc/vmargins.h +++ /dev/null @@ -1,40 +0,0 @@ -/************************************************************************ - ** - ** @file vmargins.h - ** @author Roman Telezhynskyi - ** @date 7 11, 2015 - ** - ** @brief - ** @copyright - ** This source code is part of the Valentine project, a pattern making - ** program, whose allow create and modeling patterns of clothing. - ** Copyright (C) 2015 Valentina project - ** All Rights Reserved. - ** - ** Valentina 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 3 of the License, or - ** (at your option) any later version. - ** - ** Valentina 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 Valentina. If not, see . - ** - *************************************************************************/ - -#ifndef VMARGINS_H -#define VMARGINS_H - -#include - -#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) -# include "backport/qmarginsf.h" -#else -# include -#endif - -#endif // VMARGINS_H diff --git a/src/libs/vmisc/vmisc.pri b/src/libs/vmisc/vmisc.pri index c85a099c4..30ce688dd 100644 --- a/src/libs/vmisc/vmisc.pri +++ b/src/libs/vmisc/vmisc.pri @@ -4,14 +4,11 @@ SOURCES += \ $$PWD/def.cpp \ $$PWD/undoevent.cpp \ - $$PWD/backport/qcommandlineoption.cpp \ - $$PWD/backport/qcommandlineparser.cpp \ $$PWD/vsettings.cpp \ $$PWD/vabstractapplication.cpp \ $$PWD/projectversion.cpp \ $$PWD/vcommonsettings.cpp \ $$PWD/vtapesettings.cpp \ - $$PWD/backport/qmarginsf.cpp \ $$PWD/commandoptions.cpp win32-msvc*:SOURCES += $$PWD/stable.cpp @@ -22,8 +19,6 @@ HEADERS += \ $$PWD/logging.h \ $$PWD/vmath.h \ $$PWD/undoevent.h \ - $$PWD/backport/qcommandlineoption.h \ - $$PWD/backport/qcommandlineparser.h \ $$PWD/vsettings.h \ $$PWD/vabstractapplication.h \ $$PWD/projectversion.h \ @@ -32,6 +27,22 @@ HEADERS += \ $$PWD/debugbreak.h \ $$PWD/vlockguard.h \ $$PWD/vsysexits.h \ - $$PWD/backport/qmarginsf.h \ - $$PWD/vmargins.h \ $$PWD/commandoptions.h + +contains(QT_VERSION, ^5\\.[0-1]\\.[0-2]$) { # Since Qt 5.2.0 + HEADERS += \ + $$PWD/backport/qcommandlineoption.h \ + $$PWD/backport/qcommandlineparser.h + + SOURCES += \ + $$PWD/backport/qcommandlineoption.cpp \ + $$PWD/backport/qcommandlineparser.cpp +} + +contains(QT_VERSION, ^5\\.[0-2]\\.[0-2]$) { # Since Qt 5.3.0 + HEADERS += \ + $$PWD/backport/qmarginsf.h + + SOURCES += \ + $$PWD/backport/qmarginsf.cpp +} diff --git a/src/libs/vmisc/vsettings.h b/src/libs/vmisc/vsettings.h index ade568104..2032d8ce7 100644 --- a/src/libs/vmisc/vsettings.h +++ b/src/libs/vmisc/vsettings.h @@ -32,7 +32,11 @@ #include "vcommonsettings.h" #include "../vlayout/vbank.h" -#include "../vmisc/vmargins.h" +#if QT_VERSION < QT_VERSION_CHECK(5, 3, 0) +# include "../vmisc/backport/qmarginsf.h" +#else +# include +#endif class VSettings : public VCommonSettings {