diff --git a/.gitignore b/.gitignore index 4b13717..88525b6 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,8 @@ TeSettings.pro.user.98dd4ea TeSettings.pro.user *.user /lib +/build-TeSettings-Desktop_Qt_5_15_2_MSVC2019_64bit +*.stash +/build-TeSettings-Desktop_Qt_6_9_0_MinGW_64_bit +/build-TeSettings-Desktop_Qt_5_15_2_MinGW_64_bit +/build-TeSettings-Desktop_Qt_6_9_1_MinGW_64_bit diff --git a/TeSettings.pro b/TeSettings.pro index f90fad4..6c66fe9 100644 --- a/TeSettings.pro +++ b/TeSettings.pro @@ -3,19 +3,17 @@ QT -= gui CONFIG += c++17 console CONFIG -= app_bundle +CONFIG(debug, debug|release) TARGET = TeSettingsd +CONFIG(release, debug|release) TARGET = TeSettings VERSION = 1.0.3 DEFINES += APP_VERSION=\\\"$$VERSION\\\" DEFINES += TE_SETTINGS_LIBRARY -CONFIG(debug, debug |release) { - TEMPLATE = app -} else { - DESTDIR = $$PWD/lib/te_settings - TEMPLATE = lib - QMAKE_POST_LINK += cp $$PWD/te_settings/tesettings.h $$PWD/lib/te_settings/tesettings.h - win32: HEADERS += te_settings/te_settingsGlobal.h -} +TEMPLATE = lib +DESTDIR = $$PWD/lib/te_settings +win32: QMAKE_POST_LINK += $$QMAKE_COPY $$system_path($$PWD/te_settings/tesettings.h) $$system_path($$PWD/lib/te_settings/tesettings.h) +else: QMAKE_POST_LINK += cp $$PWD/te_settings/tesettings.h $$PWD/lib/te_settings/tesettings.h # You can make your code fail to compile if it uses deprecated APIs. diff --git a/te_settings/te_settingsGlobal.h b/te_settings/te_settingsGlobal.h deleted file mode 100644 index fcc0c6d..0000000 --- a/te_settings/te_settingsGlobal.h +++ /dev/null @@ -1,12 +0,0 @@ -#ifndef TE_SETTINGSGLOBAL_H -#define TE_SETTINGSGLOBAL_H - -#include - -#if defined(TE_SETTINGS_LIBRARY) -#define TE_SETTINGS_EXPORT Q_DECL_EXPORT -#else -#define TE_SETTINGS_EXPORT Q_DECL_IMPORT -#endif - -#endif // TE_SETTINGSGLOBAL_H diff --git a/te_settings/tesettings.cpp b/te_settings/tesettings.cpp index 4f58e8b..a0b20c9 100644 --- a/te_settings/tesettings.cpp +++ b/te_settings/tesettings.cpp @@ -105,7 +105,10 @@ void TeSettings::setValue(QString key, const QVariant &value) } auto ¶ms (data_[group].params); - params.insert(key, ParamData {.value = value.toString(), .comment = ""}); + ParamData paramData; + paramData.value = value.toString(); + paramData.comment = ""; + params.insert(key, paramData); } void TeSettings::setComment(QString key, const QString &comment) @@ -304,7 +307,10 @@ void TeSettings::parseLine(QString &line, const int &lineNum) // Если ещё нет такой группы if (!data_.contains(group_)) { - data_.insert(group_, GroupData {.params = {}, .comment = lastComment_}); + GroupData groupData; + groupData.params = {}; + groupData.comment = lastComment_; + data_.insert(group_, groupData); lastComment_.clear(); } } @@ -353,7 +359,10 @@ void TeSettings::parseLine(QString &line, const int &lineNum) const QString key (line.mid(0, equal_idx).trimmed()); const QString value (line.mid(equal_idx + 1).trimmed()); - data_[group_].params.insert(key, ParamData {.value = value, .comment = lastComment_}); + ParamData paramData; + paramData.value = value; + paramData.comment = lastComment_; + data_[group_].params.insert(key, paramData); lastComment_.clear(); } } diff --git a/te_settings/tesettings.h b/te_settings/tesettings.h index 4f8fa27..9f315fa 100644 --- a/te_settings/tesettings.h +++ b/te_settings/tesettings.h @@ -5,9 +5,14 @@ #include #include #include +#include #ifdef Q_OS_WIN -#include "te_settingsGlobal.h" +#if defined(TE_SETTINGS_LIBRARY) +#define TE_SETTINGS_EXPORT Q_DECL_EXPORT +#else +#define TE_SETTINGS_EXPORT Q_DECL_IMPORT +#endif #endif // Этот дефайн включает дополнительный вывод для отладки возможных проблем парсинга