From a4f2eefacd67815efb20bbb0b1032903986d1d28 Mon Sep 17 00:00:00 2001 From: Roman Telezhynskyi Date: Thu, 9 Nov 2023 15:36:50 +0200 Subject: [PATCH] Fix building. --- .../dialogknownmeasurementscsvcolumns.cpp | 13 ++++++++ .../dialogknownmeasurementscsvcolumns.h | 9 ------ .../dialogs/dialogmeasurementscsvcolumns.cpp | 15 +++++++++- .../dialogs/dialogmeasurementscsvcolumns.h | 30 ++++++------------- src/app/tape/tkmmainwindow.cpp | 2 +- src/app/translations.pri | 11 ------- src/libs/vmisc/theme/vtheme.cpp | 2 +- 7 files changed, 38 insertions(+), 44 deletions(-) diff --git a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp index e42626526..d5ffc9eec 100644 --- a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp +++ b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.cpp @@ -34,6 +34,13 @@ #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vtools/dialogs/dialogtoolbox.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include "../vmisc/vtextcodec.h" +#else +#include +using VTextCodec = QTextCodec; +#endif + #include #include @@ -548,3 +555,9 @@ template void DialogKnownMeasurementsCSVColumns::SaveColum(QComboBox * ShowImportPreview(); CheckStatus(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogKnownMeasurementsCSVColumns::SetCodec(VTextCodec *codec) +{ + m_codec = codec; +} diff --git a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h index 044536026..db589ae57 100644 --- a/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h +++ b/src/app/tape/dialogs/dialogknownmeasurementscsvcolumns.h @@ -32,10 +32,7 @@ class QxtCsvModel; class QComboBox; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; -#endif enum class KnownMeasurementsColumns : qint8 { @@ -129,10 +126,4 @@ inline void DialogKnownMeasurementsCSVColumns::SetSeparator(const QChar &separat m_separator = separator; } -//--------------------------------------------------------------------------------------------------------------------- -inline void DialogKnownMeasurementsCSVColumns::SetCodec(VTextCodec *codec) -{ - m_codec = codec; -} - #endif // DIALOGKNOWNMEASUREMENTSCSVCOLUMNS_H diff --git a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp index 8637db0fb..b839a9cab 100644 --- a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp +++ b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.cpp @@ -26,14 +26,21 @@ ** *************************************************************************/ #include "dialogmeasurementscsvcolumns.h" +#include "../vmisc/qxtcsvmodel.h" #include "ui_dialogmeasurementscsvcolumns.h" -#include "../vmisc/qxtcsvmodel.h" #if QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vmisc/backport/qoverload.h" #endif // QT_VERSION < QT_VERSION_CHECK(5, 7, 0) #include "../vtools/dialogs/dialogtoolbox.h" +#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) +#include "../vmisc/vtextcodec.h" +#else +#include +using VTextCodec = QTextCodec; +#endif + #include #include @@ -897,3 +904,9 @@ template void DialogMeasurementsCSVColumns::SaveColum(QComboBox *contr ShowImportPreview(); CheckStatus(); } + +//--------------------------------------------------------------------------------------------------------------------- +void DialogMeasurementsCSVColumns::SetCodec(VTextCodec *codec) +{ + m_codec = codec; +} diff --git a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h index b4c2dd311..087a4a8f4 100644 --- a/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h +++ b/src/app/tape/dialogs/dialogmeasurementscsvcolumns.h @@ -33,21 +33,18 @@ #include "../vformat/vdimensions.h" class QxtCsvModel; - -#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) class VTextCodec; -#endif -enum class IndividualMeasurementsColumns: qint8 +enum class IndividualMeasurementsColumns : qint8 { Name = 0, Value = 1, - FullName = 2, // optional + FullName = 2, // optional Description = 3, // optional LAST_DO_NOT_USE = 4 }; -enum class MultisizeMeasurementsColumns: qint8 +enum class MultisizeMeasurementsColumns : qint8 { Name = 0, BaseValue = 1, @@ -59,8 +56,8 @@ enum class MultisizeMeasurementsColumns: qint8 LAST_DO_NOT_USE = 7 }; - -namespace Ui { +namespace Ui +{ class DialogMeasurementsCSVColumns; } @@ -81,7 +78,7 @@ public: void SetCodec(VTextCodec *codec); protected: - void changeEvent(QEvent* event) override; + void changeEvent(QEvent *event) override; void showEvent(QShowEvent *event) override; private slots: @@ -117,8 +114,7 @@ private: void ShowInputPreview(); void ShowImportPreview(); - template - void HackWidget(T **widget); + template void HackWidget(T **widget); void HackColumnControls(); void RetranslateLabels(); @@ -127,11 +123,9 @@ private: void CheckStatus(); - template - auto ColumnValid(T column) const -> bool; + template auto ColumnValid(T column) const -> bool; - template - void SaveColum(QComboBox *control, T column); + template void SaveColum(QComboBox *control, T column); }; //--------------------------------------------------------------------------------------------------------------------- @@ -152,10 +146,4 @@ inline void DialogMeasurementsCSVColumns::SetSeparator(const QChar &separator) m_separator = separator; } -//--------------------------------------------------------------------------------------------------------------------- -inline void DialogMeasurementsCSVColumns::SetCodec(VTextCodec *codec) -{ - m_codec = codec; -} - #endif // DIALOGMEASUREMENTSCSVCOLUMNS_H diff --git a/src/app/tape/tkmmainwindow.cpp b/src/app/tape/tkmmainwindow.cpp index 1e130928f..e8e912084 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 TMainWindow::OpenAt(QAction *where) +void TKMainWindow::OpenAt(QAction *where) { const QString path = m_curFile.left(m_curFile.indexOf(where->text())) + where->text(); if (path == m_curFile) diff --git a/src/app/translations.pri b/src/app/translations.pri index 93a8567d8..93eaab971 100755 --- a/src/app/translations.pri +++ b/src/app/translations.pri @@ -3,11 +3,6 @@ TRANSLATIONS_PATH = $${PWD}/../../share/translations # Add to this variable all translation files that you want install with program. # For generation *.qm file first you need create *.ts. # See section TRANSLATIONS in file ../../share/translations/translations.pro. -# See section TRANSLATIONS in file ../../share/translations/measurements.pro. - -PMSYSTEMS += \ - p0 p1 p2 p3 p4 p5 p6 p7 p8 p9 p10 p11 p12 p13 p14 p15 p16 p17 p18 p19 p20 p21 p22 p23 p24 p25 p26 p27 p28 p29 p30 \ - p31 p32 p33 p34 p35 p36 p37 p38 p39 p40 p41 p42 p43 p44 p45 p46 p47 p48 p49 p50 p51 p52 p53 p54 p998 # An example of using LOCALES="de_DE nl_NL" isEmpty(LOCALES){ @@ -38,12 +33,6 @@ for(lang, LANGUAGES) { INSTALL_TRANSLATIONS += $${TRANSLATIONS_PATH}/valentina_$${lang}.qm } -for(lang, LANGUAGES) { - for(sys, PMSYSTEMS) { - INSTALL_TRANSLATIONS += $${TRANSLATIONS_PATH}/measurements_$${sys}_$${lang}.qm - } -} - # Some systems use special name for lrelease. For example opensuse 13.2 has lrelease-qt5. isEmpty(LRELEASE){ win32{ diff --git a/src/libs/vmisc/theme/vtheme.cpp b/src/libs/vmisc/theme/vtheme.cpp index b015bc54b..520d4f8c9 100644 --- a/src/libs/vmisc/theme/vtheme.cpp +++ b/src/libs/vmisc/theme/vtheme.cpp @@ -73,7 +73,7 @@ using namespace bpstd::literals::chrono_literals; #include "vscenestylesheet.h" #if QT_VERSION < QT_VERSION_CHECK(6, 4, 0) -#include "../vmisc/compatibility.h" +#include "../compatibility.h" #endif using namespace Qt::Literals::StringLiterals;