Fix building.

This commit is contained in:
Roman Telezhynskyi 2023-11-09 17:46:34 +02:00
parent a4f2eefacd
commit 9d652aa3b5
15 changed files with 119 additions and 62 deletions

View File

@ -11,7 +11,7 @@
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2023, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
@ -19,12 +19,12 @@
<key>CFBundleIdentifier</key>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
<key>CFBundleDocumentTypes</key>
<array>
<dict>
<key>CFBundleTypeRole</key>
@ -33,7 +33,7 @@
<string>layout.incs</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina layout</string>
@ -54,7 +54,7 @@
<key>UTTypeIconFile</key>
<string>layout.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -62,7 +62,7 @@
<string>vlt</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
</array>

View File

@ -11,7 +11,7 @@
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2023, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
@ -19,9 +19,9 @@
<key>CFBundleIdentifier</key>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>i-measurements.incs</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vit</string>
<string>ua.com.smart-pattern.vit</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina individual measurements</string>
@ -47,21 +47,21 @@
<string>s-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vst</string>
<string>ua.com.smart-pattern.vst</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina multisize measurements</string>
<key>LSHandlerRank</key>
<string>Owner</string>
</dict>
<dict>
<dict>
<key>CFBundleTypeRole</key>
<string>Editor</string>
<key>CFBundleTypeIconFile</key>
<string>k-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vkm</string>
<string>ua.com.smart-pattern.vkm</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina known measurements</string>
@ -82,7 +82,7 @@
<key>UTTypeIconFile</key>
<string>i-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vit</string>
<string>ua.com.smart-pattern.vit</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -104,7 +104,7 @@
<key>UTTypeIconFile</key>
<string>s-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vst</string>
<string>ua.com.smart-pattern.vst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -114,7 +114,8 @@
<key>public.mime-type</key>
<string>text/xml</string>
</dict>
<dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
@ -125,7 +126,7 @@
<key>UTTypeIconFile</key>
<string>k-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vkm</string>
<string>ua.com.smart-pattern.vkm</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>

View File

@ -11,7 +11,7 @@
<key>LSMinimumSystemVersion</key>
<string>${MACOSX_DEPLOYMENT_TARGET}</string>
<key>NSHumanReadableCopyright</key>
<string>© 2013-2023, Valentina project</string>
<string>© 2013-2023, Valentina project</string>
<key>CFBundleSignature</key>
<string>@TYPEINFO@</string>
<key>CFBundleExecutable</key>
@ -19,9 +19,9 @@
<key>CFBundleIdentifier</key>
<string>ua.com.smart-pattern.@EXECUTABLE@</string>
<key>CFBundleShortVersionString</key>
<string>@SHORT_VERSION@</string>
<string>@SHORT_VERSION@</string>
<key>CFBundleVersion</key>
<string>@FULL_VERSION@</string>
<string>@FULL_VERSION@</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleDocumentTypes</key>
@ -33,7 +33,7 @@
<string>pattern.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.val</string>
<string>ua.com.smart-pattern.val</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina pattern file</string>
@ -47,7 +47,7 @@
<string>i-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vit</string>
<string>ua.com.smart-pattern.vit</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina individual measurements</string>
@ -61,10 +61,10 @@
<string>s-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vst</string>
<string>ua.com.smart-pattern.vst</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina multisize measurements</string>
<string>Valentina multisize measurements</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
@ -75,10 +75,10 @@
<string>k-measurements.icns</string>
<key>LSItemContentTypes</key>
<array>
<string>ua.com.smart-pattern.vkm</string>
<string>ua.com.smart-pattern.vkm</string>
</array>
<key>CFBundleTypeName</key>
<string>Valentina known measurements</string>
<string>Valentina known measurements</string>
<key>LSHandlerRank</key>
<string>Alternate</string>
</dict>
@ -94,9 +94,9 @@
<key>UTTypeDescription</key>
<string>Valentina pattern file</string>
<key>UTTypeIconFile</key>
<string>pattern.icns</string>
<string>pattern.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.val</string>
<string>ua.com.smart-pattern.val</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -104,7 +104,7 @@
<string>val</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
<dict>
@ -118,7 +118,7 @@
<key>UTTypeIconFile</key>
<string>i-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vit</string>
<string>ua.com.smart-pattern.vit</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -126,7 +126,7 @@
<string>vit</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
<dict>
@ -136,11 +136,11 @@
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>Valentina multisize measurements</string>
<string>Valentina multisize measurements</string>
<key>UTTypeIconFile</key>
<string>s-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vst</string>
<string>ua.com.smart-pattern.vst</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -148,20 +148,21 @@
<string>vst</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
<dict>
</dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
<string>public.xml</string>
</array>
<key>UTTypeDescription</key>
<string>Valentina known measurements</string>
<string>Valentina known measurements</string>
<key>UTTypeIconFile</key>
<string>k-measurements.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vkm</string>
<string>ua.com.smart-pattern.vkm</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -169,10 +170,10 @@
<string>vkm</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
<dict>
<dict>
<key>UTTypeConformsTo</key>
<array>
<string>public.text</string>
@ -183,7 +184,7 @@
<key>UTTypeIconFile</key>
<string>layout.icns</string>
<key>UTTypeIdentifier</key>
<string>ua.com.smart-pattern.vlt</string>
<string>ua.com.smart-pattern.vlt</string>
<key>UTTypeTagSpecification</key>
<dict>
<key>public.filename-extension</key>
@ -191,7 +192,7 @@
<string>vlt</string>
</array>
<key>public.mime-type</key>
<string>text/xml</string>
<string>text/xml</string>
</dict>
</dict>
</array>

View File

@ -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
{

View File

@ -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
{

View File

@ -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<QFileOpenEvent *>(e); // NOLINT(cppcoreguidelines-pro-type-static-cast-downcast)
// NOLINTNEXTLINE(cppcoreguidelines-pro-type-static-cast-downcast)
auto *fileOpenEvent = static_cast<QFileOpenEvent *>(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())
{

View File

@ -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)

View File

@ -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

View File

@ -29,6 +29,10 @@
#include "../vmisc/def.h"
#include "vknownmeasurements_p.h"
#include <QMap>
#include <QSet>
#include <QString>
//---------------------------------------------------------------------------------------------------------------------
VKnownMeasurements::VKnownMeasurements()
: d(new VKnownMeasurementsData)
@ -36,7 +40,7 @@ VKnownMeasurements::VKnownMeasurements()
}
//---------------------------------------------------------------------------------------------------------------------
VKnownMeasurements::~VKnownMeasurements()
VKnownMeasurements::~VKnownMeasurements() // NOLINT(modernize-use-equals-default)
{
}

View File

@ -31,7 +31,11 @@
#include "../ifc/xml/vpatternimage.h"
#include "../vmisc/defglobal.h"
#include "vknownmeasurement.h"
#include <QHash>
#include <QMap>
#include <QSharedData>
#include <QString>
#include <QUuid>
QT_WARNING_PUSH

View File

@ -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 <QUuid>

View File

@ -33,7 +33,6 @@
#include <QSet>
#include "../vmisc/def.h"
#include "qglobal.h"
#if QT_VERSION < QT_VERSION_CHECK(5, 13, 0)
#include "../vmisc/defglobal.h"

View File

@ -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<vsizetype>(size));
}
QT_WARNING_POP
//---------------------------------------------------------------------------------------------------------------------
inline auto operator"" _ba(const char *str, size_t size) Q_DECL_NOEXCEPT->QByteArray
{

View File

@ -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

View File

@ -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