diff --git a/pglab/BackupDialog.cpp b/pglab/BackupDialog.cpp index 55a4404..30e5ee8 100644 --- a/pglab/BackupDialog.cpp +++ b/pglab/BackupDialog.cpp @@ -439,7 +439,7 @@ void BackupDialog::on_btnStart_clicked() QSettings user_settings; // Default constructor is for UserScope QVariant var = user_settings.value("pg_tools_path", {}); QDir dir; - if (var.typeId() == QMetaType::QString) { + if (var.type() == QMetaType::QString) { dir.setPath(var.toString()); } if (!dir.exists() || !dir.exists("pg_dump.exe")) { diff --git a/pglab/CMakeLists.txt b/pglab/CMakeLists.txt index 724530b..46ace2b 100644 --- a/pglab/CMakeLists.txt +++ b/pglab/CMakeLists.txt @@ -1,4 +1,5 @@ set(PGLAB_SOURCES + main.cpp About.cpp catalog/delegates/IconColumnDelegate.cpp catalog/models/BaseTableModel.cpp @@ -84,16 +85,18 @@ set(PGLAB_FORMS CodeGenerator.ui ) -add_library(pglabapp STATIC +add_executable(pglab ${PGLAB_SOURCES} ${PGLAB_FORMS} + resources.qrc ) if(WIN32) - target_link_libraries(pglabapp PUBLIC ws2_32) + set_target_properties(pglab PROPERTIES WIN32_EXECUTABLE ON) + target_link_libraries(pglab PRIVATE ws2_32) endif() -target_link_libraries(pglabapp PUBLIC +target_link_libraries(pglab PRIVATE pglablib pgsql core @@ -104,27 +107,10 @@ target_link_libraries(pglabapp PUBLIC Qt6::Concurrent ) -target_include_directories(pglabapp PUBLIC +target_include_directories(pglab PRIVATE ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/crud ) -set_target_properties(pglabapp PROPERTIES - CXX_STANDARD 20 - CXX_STANDARD_REQUIRED ON - ) - -add_executable(pglab - main.cpp - resources.qrc - ) - -if(WIN32) - set_target_properties(pglab PROPERTIES WIN32_EXECUTABLE ON) -endif() - -target_link_libraries(pglab PRIVATE pglabapp) - set_target_properties(pglab PROPERTIES CXX_STANDARD 20 CXX_STANDARD_REQUIRED ON diff --git a/pglablib/catalog/PgSequenceContainer.cpp b/pglablib/catalog/PgSequenceContainer.cpp index 0d3604f..5a31a6d 100644 --- a/pglablib/catalog/PgSequenceContainer.cpp +++ b/pglablib/catalog/PgSequenceContainer.cpp @@ -77,7 +77,7 @@ void PgSequenceContainer::loadAll(Pgsql::Connection &conn) q += ", start_value, increment_by, max_value, \n" " min_value, cache_value, is_cycled"; } - q += "\nFROM " + std::string(fqn.data(), static_cast(fqn.size())); + q += "\nFROM " + std::string(fqn.data(), static_cast(fqn.count())); auto && res = conn.query(q.c_str()); if (res.rows() == 1) { Pgsql::Row row(res, 0); diff --git a/tests/PgsqlTests/tst_Value.cpp b/tests/PgsqlTests/tst_Value.cpp index 14e690f..6642b8e 100644 --- a/tests/PgsqlTests/tst_Value.cpp +++ b/tests/PgsqlTests/tst_Value.cpp @@ -2,7 +2,6 @@ #include #include "Pgsql_Value.h" #include "PrintTo_Qt.h" -#include #include #include #include @@ -30,7 +29,7 @@ TEST(Pgsql_Value, test_QDateTime_2) Pgsql::Value v("2017-12-01 09:38:17.339817+02", timestamptz_oid); QDateTime dt = (QDateTime)v; QDateTime exp(QDate(2017, 12, 1), QTime(9, 38, 17, 340), - QTimeZone::fromSecondsAheadOfUtc(2 * 3600)); + Qt::OffsetFromUTC, 2*3600); ASSERT_EQ(dt, exp); } diff --git a/tests/integration/CMakeLists.txt b/tests/integration/CMakeLists.txt index f4b3695..ec8f25c 100644 --- a/tests/integration/CMakeLists.txt +++ b/tests/integration/CMakeLists.txt @@ -6,11 +6,22 @@ add_executable(IntegrationTests tst_DataGridMapping.cpp tst_DataGridUpdate.cpp tst_CrudModelBehavior.cpp + ${CMAKE_SOURCE_DIR}/pglab/crud/CrudModel.cpp + ${CMAKE_SOURCE_DIR}/pglab/crud/DataGridWidget.cpp + ${CMAKE_SOURCE_DIR}/pglab/crud/RecordPanel.cpp + ${CMAKE_SOURCE_DIR}/pglab/OpenDatabase.cpp + ${CMAKE_SOURCE_DIR}/pglab/util/PgLabItemDelegate.cpp + ${CMAKE_SOURCE_DIR}/pglab/util/Colors.cpp + ${CMAKE_SOURCE_DIR}/pglab/ResultTableModelUtil.cpp + ) + +target_include_directories(IntegrationTests PRIVATE + ${CMAKE_SOURCE_DIR}/pglab + ${CMAKE_SOURCE_DIR}/pglab/crud ) target_link_libraries(IntegrationTests PRIVATE pgintegration - pglabapp pglablib GTest::gtest Qt6::Core