From 9d652aa3b50cff99b0d8bcb479885b9acada27f2 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 9 Nov 2023 17:46:34 +0200 Subject: [PATCH] Fix building. --- dist/macx/puzzle/Info.plist | 14 +++--- dist/macx/tape/Info.plist | 23 ++++----- dist/macx/valentina/Info.plist | 49 ++++++++++--------- .../dialogknownmeasurementscsvcolumns.h | 6 +++ .../dialogs/dialogmeasurementscsvcolumns.h | 6 +++ src/app/tape/mapplication.cpp | 49 ++++++++++++++----- src/app/tape/tkmmainwindow.cpp | 2 +- src/libs/vdxf/vdxfengine.h | 3 ++ .../knownmeasurements/vknownmeasurements.cpp | 6 ++- .../knownmeasurements/vknownmeasurements_p.h | 4 ++ .../vknownmeasurementsdocument.cpp | 7 ++- src/libs/vformat/vdimensions.h | 1 - src/libs/vmisc/compatibility.h | 5 ++ src/libs/vmisc/qxtcsvmodel.h | 3 ++ src/libs/vmisc/vabstractapplication.h | 3 ++ 15 files changed, 119 insertions(+), 62 deletions(-) diff --git a/dist/macx/puzzle/Info.plist b/dist/macx/puzzle/Info.plist index f6977f8e5..fbca1a46e 100755 --- a/dist/macx/puzzle/Info.plist +++ b/dist/macx/puzzle/Info.plist @@ -11,7 +11,7 @@ LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - © 2013-2023, Valentina project + © 2013-2023, Valentina project CFBundleSignature @TYPEINFO@ CFBundleExecutable @@ -19,12 +19,12 @@ CFBundleIdentifier ua.com.smart-pattern.@EXECUTABLE@ CFBundleShortVersionString - @SHORT_VERSION@ + @SHORT_VERSION@ CFBundleVersion - @FULL_VERSION@ + @FULL_VERSION@ CFBundleInfoDictionaryVersion 6.0 - CFBundleDocumentTypes + CFBundleDocumentTypes CFBundleTypeRole @@ -33,7 +33,7 @@ layout.incs LSItemContentTypes - ua.com.smart-pattern.vlt + ua.com.smart-pattern.vlt CFBundleTypeName Valentina layout @@ -54,7 +54,7 @@ UTTypeIconFile layout.icns UTTypeIdentifier - ua.com.smart-pattern.vlt + ua.com.smart-pattern.vlt UTTypeTagSpecification public.filename-extension @@ -62,7 +62,7 @@ vlt public.mime-type - text/xml + text/xml diff --git a/dist/macx/tape/Info.plist b/dist/macx/tape/Info.plist index 53fdebdb9..0bed4187e 100755 --- a/dist/macx/tape/Info.plist +++ b/dist/macx/tape/Info.plist @@ -11,7 +11,7 @@ LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - © 2013-2023, Valentina project + © 2013-2023, Valentina project CFBundleSignature @TYPEINFO@ CFBundleExecutable @@ -19,9 +19,9 @@ CFBundleIdentifier ua.com.smart-pattern.@EXECUTABLE@ CFBundleShortVersionString - @SHORT_VERSION@ + @SHORT_VERSION@ CFBundleVersion - @FULL_VERSION@ + @FULL_VERSION@ CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes @@ -33,7 +33,7 @@ i-measurements.incs LSItemContentTypes - ua.com.smart-pattern.vit + ua.com.smart-pattern.vit CFBundleTypeName Valentina individual measurements @@ -47,21 +47,21 @@ s-measurements.icns LSItemContentTypes - ua.com.smart-pattern.vst + ua.com.smart-pattern.vst CFBundleTypeName Valentina multisize measurements LSHandlerRank Owner - + CFBundleTypeRole Editor CFBundleTypeIconFile k-measurements.icns LSItemContentTypes - ua.com.smart-pattern.vkm + ua.com.smart-pattern.vkm CFBundleTypeName Valentina known measurements @@ -82,7 +82,7 @@ UTTypeIconFile i-measurements.icns UTTypeIdentifier - ua.com.smart-pattern.vit + ua.com.smart-pattern.vit UTTypeTagSpecification public.filename-extension @@ -104,7 +104,7 @@ UTTypeIconFile s-measurements.icns UTTypeIdentifier - ua.com.smart-pattern.vst + ua.com.smart-pattern.vst UTTypeTagSpecification public.filename-extension @@ -114,7 +114,8 @@ public.mime-type text/xml - + + UTTypeConformsTo public.text @@ -125,7 +126,7 @@ UTTypeIconFile k-measurements.icns UTTypeIdentifier - ua.com.smart-pattern.vkm + ua.com.smart-pattern.vkm UTTypeTagSpecification public.filename-extension diff --git a/dist/macx/valentina/Info.plist b/dist/macx/valentina/Info.plist index a7368dcc6..0f16f771c 100755 --- a/dist/macx/valentina/Info.plist +++ b/dist/macx/valentina/Info.plist @@ -11,7 +11,7 @@ LSMinimumSystemVersion ${MACOSX_DEPLOYMENT_TARGET} NSHumanReadableCopyright - © 2013-2023, Valentina project + © 2013-2023, Valentina project CFBundleSignature @TYPEINFO@ CFBundleExecutable @@ -19,9 +19,9 @@ CFBundleIdentifier ua.com.smart-pattern.@EXECUTABLE@ CFBundleShortVersionString - @SHORT_VERSION@ + @SHORT_VERSION@ CFBundleVersion - @FULL_VERSION@ + @FULL_VERSION@ CFBundleInfoDictionaryVersion 6.0 CFBundleDocumentTypes @@ -33,7 +33,7 @@ pattern.icns LSItemContentTypes - ua.com.smart-pattern.val + ua.com.smart-pattern.val CFBundleTypeName Valentina pattern file @@ -47,7 +47,7 @@ i-measurements.icns LSItemContentTypes - ua.com.smart-pattern.vit + ua.com.smart-pattern.vit CFBundleTypeName Valentina individual measurements @@ -61,10 +61,10 @@ s-measurements.icns LSItemContentTypes - ua.com.smart-pattern.vst + ua.com.smart-pattern.vst CFBundleTypeName - Valentina multisize measurements + Valentina multisize measurements LSHandlerRank Alternate @@ -75,10 +75,10 @@ k-measurements.icns LSItemContentTypes - ua.com.smart-pattern.vkm + ua.com.smart-pattern.vkm CFBundleTypeName - Valentina known measurements + Valentina known measurements LSHandlerRank Alternate @@ -94,9 +94,9 @@ UTTypeDescription Valentina pattern file UTTypeIconFile - pattern.icns + pattern.icns UTTypeIdentifier - ua.com.smart-pattern.val + ua.com.smart-pattern.val UTTypeTagSpecification public.filename-extension @@ -104,7 +104,7 @@ val public.mime-type - text/xml + text/xml @@ -118,7 +118,7 @@ UTTypeIconFile i-measurements.icns UTTypeIdentifier - ua.com.smart-pattern.vit + ua.com.smart-pattern.vit UTTypeTagSpecification public.filename-extension @@ -126,7 +126,7 @@ vit public.mime-type - text/xml + text/xml @@ -136,11 +136,11 @@ public.xml UTTypeDescription - Valentina multisize measurements + Valentina multisize measurements UTTypeIconFile s-measurements.icns UTTypeIdentifier - ua.com.smart-pattern.vst + ua.com.smart-pattern.vst UTTypeTagSpecification public.filename-extension @@ -148,20 +148,21 @@ vst public.mime-type - text/xml + text/xml - + + UTTypeConformsTo public.text public.xml UTTypeDescription - Valentina known measurements + Valentina known measurements UTTypeIconFile k-measurements.icns UTTypeIdentifier - ua.com.smart-pattern.vkm + ua.com.smart-pattern.vkm UTTypeTagSpecification public.filename-extension @@ -169,10 +170,10 @@ vkm public.mime-type - text/xml + text/xml - + UTTypeConformsTo public.text @@ -183,7 +184,7 @@ UTTypeIconFile layout.icns UTTypeIdentifier - ua.com.smart-pattern.vlt + ua.com.smart-pattern.vlt UTTypeTagSpecification public.filename-extension @@ -191,7 +192,7 @@ vlt public.mime-type - text/xml + text/xml diff --git a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h index db589ae57..76a81a9f1 100644 --- a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h +++ b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h @@ -32,7 +32,13 @@ class QxtCsvModel; class QComboBox; + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; +#else +class QTextCodec; +using VTextCodec = QTextCodec; +#endif enum class KnownMeasurementsColumns : qint8 { diff --git a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h index 087a4a8f4..2311fd7b0 100644 --- a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h +++ b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h @@ -33,7 +33,13 @@ #include "../vformat/vdimensions.h" class QxtCsvModel; + +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; +#else +class QTextCodec; +using VTextCodec = QTextCodec; +#endif enum class IndividualMeasurementsColumns : qint8 { diff --git a/src/app/tape/mapplication.cpp b/src/app/tape/mapplication.cpp index 8635e7ed7..9778f68d4 100644 --- a/src/app/tape/mapplication.cpp +++ b/src/app/tape/mapplication.cpp @@ -332,7 +332,7 @@ MApplication::MApplication(int &argc, char **argv) //--------------------------------------------------------------------------------------------------------------------- MApplication::~MApplication() { - if (IsAppInGUIMode() && settings->IsCollectStatistic()) + if (MApplication::IsAppInGUIMode() && settings->IsCollectStatistic()) { auto *statistic = VGAnalytics::Instance(); @@ -541,15 +541,26 @@ auto MApplication::event(QEvent *e) -> bool // Mac specific). case QEvent::FileOpen: { - auto *fileOpenEvent = - static_cast(e); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast) + auto *fileOpenEvent = static_cast(e); const QString macFileOpen = fileOpenEvent->file(); if (not macFileOpen.isEmpty()) { - TMainWindow *mw = MainTapeWindow(); - if (mw) + if (macFileOpen.endsWith(".vkm"_L1)) { - mw->LoadFile(macFileOpen); // open file in existing window + TKMMainWindow *mw = MainKMWindow(); + if (mw) + { + mw->LoadFile(macFileOpen); // open file in existing window + } + } + else + { + TMainWindow *mw = MainTapeWindow(); + if (mw) + { + mw->LoadFile(macFileOpen); // open file in existing window + } } return true; } @@ -558,11 +569,23 @@ auto MApplication::event(QEvent *e) -> bool #if defined(Q_OS_MAC) case QEvent::ApplicationActivate: { - Clean(); - TMainWindow *mw = MainWindow(); - if (mw && not mw->isMinimized()) + if (m_knownMeasurementsMode) { - mw->show(); + CleanKMWindows(); + TKMMainWindow *mw = MainKMWindow(); + if (mw && not mw->isMinimized()) + { + mw->show(); + } + } + else + { + CleanTapeWindows(); + TMainWindow *mw = MainTapeWindow(); + if (mw && not mw->isMinimized()) + { + mw->show(); + } } return true; } @@ -686,7 +709,7 @@ void MApplication::Preferences(QWidget *parent) guard = preferences; // Must be first - for (const auto &w : m_mainWindows) + for (const auto &w : qAsConst(m_mainWindows)) { if (!w.isNull()) { @@ -697,7 +720,7 @@ void MApplication::Preferences(QWidget *parent) } } - for (const auto &w : m_kmMainWindows) + for (const auto &w : qAsConst(m_kmMainWindows)) { if (!w.isNull()) { @@ -844,7 +867,7 @@ void MApplication::KnownMeasurementsPathChanged(const QString &oldPath, const QS //--------------------------------------------------------------------------------------------------------------------- void MApplication::SyncKnownMeasurements() { - for (const auto &w : m_mainWindows) + for (const auto &w : qAsConst(m_mainWindows)) { if (!w.isNull()) { diff --git a/src/app/tape/tkmmainwindow.cpp b/src/app/tape/tkmmainwindow.cpp index e8e912084..7d6e4fb3d 100644 --- a/src/app/tape/tkmmainwindow.cpp +++ b/src/app/tape/tkmmainwindow.cpp @@ -1465,7 +1465,7 @@ void TKMMainWindow::SaveImageTitle() //--------------------------------------------------------------------------------------------------------------------- #if defined(Q_OS_MAC) //--------------------------------------------------------------------------------------------------------------------- -void TKMainWindow::OpenAt(QAction *where) +void TKMMainWindow::OpenAt(QAction *where) { const QString path = m_curFile.left(m_curFile.indexOf(where->text())) + where->text(); if (path == m_curFile) diff --git a/src/libs/vdxf/vdxfengine.h b/src/libs/vdxf/vdxfengine.h index b3686911e..b58c74573 100644 --- a/src/libs/vdxf/vdxfengine.h +++ b/src/libs/vdxf/vdxfengine.h @@ -53,6 +53,9 @@ class DRW_Point; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; +#else +class QTextCodec; +using VTextCodec = QTextCodec; #endif class VDxfEngine final : public QPaintEngine diff --git a/src/libs/vformat/knownmeasurements/vknownmeasurements.cpp b/src/libs/vformat/knownmeasurements/vknownmeasurements.cpp index 947dfb0df..bfc1ecae4 100644 --- a/src/libs/vformat/knownmeasurements/vknownmeasurements.cpp +++ b/src/libs/vformat/knownmeasurements/vknownmeasurements.cpp @@ -29,6 +29,10 @@ #include "../vmisc/def.h" #include "vknownmeasurements_p.h" +#include +#include +#include + //--------------------------------------------------------------------------------------------------------------------- VKnownMeasurements::VKnownMeasurements() : d(new VKnownMeasurementsData) @@ -36,7 +40,7 @@ VKnownMeasurements::VKnownMeasurements() } //--------------------------------------------------------------------------------------------------------------------- -VKnownMeasurements::~VKnownMeasurements() +VKnownMeasurements::~VKnownMeasurements() // NOLINT(modernize-use-equals-default) { } diff --git a/src/libs/vformat/knownmeasurements/vknownmeasurements_p.h b/src/libs/vformat/knownmeasurements/vknownmeasurements_p.h index 7feed3e86..d8879ef02 100644 --- a/src/libs/vformat/knownmeasurements/vknownmeasurements_p.h +++ b/src/libs/vformat/knownmeasurements/vknownmeasurements_p.h @@ -31,7 +31,11 @@ #include "../ifc/xml/vpatternimage.h" #include "../vmisc/defglobal.h" #include "vknownmeasurement.h" + +#include +#include #include +#include #include QT_WARNING_PUSH diff --git a/src/libs/vformat/knownmeasurements/vknownmeasurementsdocument.cpp b/src/libs/vformat/knownmeasurements/vknownmeasurementsdocument.cpp index 080d5c0d8..cdfcfa7cc 100644 --- a/src/libs/vformat/knownmeasurements/vknownmeasurementsdocument.cpp +++ b/src/libs/vformat/knownmeasurements/vknownmeasurementsdocument.cpp @@ -26,13 +26,12 @@ ** *************************************************************************/ #include "vknownmeasurementsdocument.h" +#include "../ifc/ifcdef.h" #include "../ifc/xml/vknownmeasurementsconverter.h" #include "../ifc/xml/vpatternimage.h" +#include "../vmisc/literals.h" #include "../vmisc/projectversion.h" -#include "ifcdef.h" -#include "literals.h" -#include "quuid.h" -#include "vformat/knownmeasurements/vknownmeasurement.h" +#include "vknownmeasurement.h" #include "vknownmeasurements.h" #include diff --git a/src/libs/vformat/vdimensions.h b/src/libs/vformat/vdimensions.h index 825f1559d..06764e46d 100644 --- a/src/libs/vformat/vdimensions.h +++ b/src/libs/vformat/vdimensions.h @@ -33,7 +33,6 @@ #include #include "../vmisc/def.h" -#include "qglobal.h" #if QT_VERSION < QT_VERSION_CHECK(5, 13, 0) #include "../vmisc/defglobal.h" diff --git a/src/libs/vmisc/compatibility.h b/src/libs/vmisc/compatibility.h index 0aad75e3f..3c8ca605d 100644 --- a/src/libs/vmisc/compatibility.h +++ b/src/libs/vmisc/compatibility.h @@ -109,6 +109,9 @@ inline namespace Literals inline namespace StringLiterals { +QT_WARNING_PUSH +QT_WARNING_DISABLE_CLANG("-Wreserved-identifier") + //--------------------------------------------------------------------------------------------------------------------- Q_DECL_CONSTEXPR inline auto operator"" _L1(char ch) Q_DECL_NOEXCEPT->QLatin1Char { @@ -121,6 +124,8 @@ Q_DECL_CONSTEXPR inline auto operator"" _L1(const char *str, size_t size) Q_DECL return QLatin1String(str, static_cast(size)); } +QT_WARNING_POP + //--------------------------------------------------------------------------------------------------------------------- inline auto operator"" _ba(const char *str, size_t size) Q_DECL_NOEXCEPT->QByteArray { diff --git a/src/libs/vmisc/qxtcsvmodel.h b/src/libs/vmisc/qxtcsvmodel.h index b8526e919..d6990f064 100644 --- a/src/libs/vmisc/qxtcsvmodel.h +++ b/src/libs/vmisc/qxtcsvmodel.h @@ -50,6 +50,9 @@ class QxtCsvModelPrivate; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; +#else +class QTextCodec; +using VTextCodec = QTextCodec; #endif class QxtCsvModel final : public QAbstractTableModel diff --git a/src/libs/vmisc/vabstractapplication.h b/src/libs/vmisc/vabstractapplication.h index bb958d43d..247545c64 100644 --- a/src/libs/vmisc/vabstractapplication.h +++ b/src/libs/vmisc/vabstractapplication.h @@ -55,6 +55,9 @@ class VKnownMeasurementsDatabase; #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; +#else +class QTextCodec; +using VTextCodec = QTextCodec; #endif QT_WARNING_PUSH