From 23267d5abae6802da9fce1eb85ccebad1de9b814 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kubern=C3=A1t?= Date: Wed, 2 Oct 2024 15:09:04 +0200 Subject: [PATCH 1/3] Remove deprecated accesLevelForMethodCall --- libshvbroker/src/currentclientshvnode.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libshvbroker/src/currentclientshvnode.cpp b/libshvbroker/src/currentclientshvnode.cpp index 7e42da262..b19f323e2 100644 --- a/libshvbroker/src/currentclientshvnode.cpp +++ b/libshvbroker/src/currentclientshvnode.cpp @@ -28,7 +28,6 @@ const string M_MOUNT_POINT = "mountPoint"; const string M_USER_ROLES = "userRoles"; const string M_USER_PROFILE = "userProfile"; const string M_CHANGE_PASSWORD = "changePassword"; -const string M_ACCES_LEVEL_FOR_METHOD_CALL = "accesLevelForMethodCall"; // deprecated typo const string M_ACCESS_LEVEL_FOR_METHOD_CALL = "accessLevelForMethodCall"; const string M_ACCESS_GRANT_FOR_METHOD_CALL = "accessGrantForMethodCall"; } @@ -44,7 +43,6 @@ CurrentClientShvNode::CurrentClientShvNode(shv::iotqt::node::ShvNode *parent) {M_USER_PROFILE, cp::MetaMethod::Flag::None, {}, "RpcValue", cp::AccessLevel::Read}, {M_ACCESS_GRANT_FOR_METHOD_CALL, cp::MetaMethod::Flag::None, "List", "String", cp::AccessLevel::Read, {}, R"(params: ["shv_path", "method"])"}, {M_ACCESS_LEVEL_FOR_METHOD_CALL, cp::MetaMethod::Flag::None, "List", "Int", cp::AccessLevel::Read, {}, "deprecated, use accessGrantForMethodCall instead"}, - {M_ACCES_LEVEL_FOR_METHOD_CALL, cp::MetaMethod::Flag::None, "List", "Int", cp::AccessLevel::Read, {}, "deprecated, use accessGrantForMethodCall instead"}, {M_CHANGE_PASSWORD, cp::MetaMethod::Flag::None, "List", "Bool", cp::AccessLevel::Write, {} , R"(params: ["old_password", "new_password"], old and new passwords can be plain or SHA1)"}, } { @@ -115,7 +113,7 @@ shv::chainpack::RpcValue CurrentClientShvNode::callMethodRq(const shv::chainpack } return nullptr; } - if(method == M_ACCESS_LEVEL_FOR_METHOD_CALL || method == M_ACCES_LEVEL_FOR_METHOD_CALL) { + if(method == M_ACCESS_LEVEL_FOR_METHOD_CALL) { int client_id = rq.peekCallerId(); auto *app = shv::broker::BrokerApp::instance(); auto *cli = app->clientById(client_id); From 7d331df158dba6c97cd489addd534f2a7ff5e830 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kubern=C3=A1t?= Date: Wed, 2 Oct 2024 15:14:26 +0200 Subject: [PATCH 2/3] Remove deprecated stuff --- .../include/shv/chainpack/irpcconnection.h | 2 -- .../include/shv/chainpack/metatypes.h | 3 +-- .../include/shv/chainpack/rpcmessage.h | 1 - .../include/shv/chainpack/rpcvalue.h | 6 ------ libshvchainpack/src/irpcconnection.cpp | 10 ---------- libshvchainpack/src/rpcmessage.cpp | 5 ----- libshvchainpack/src/rpcvalue.cpp | 10 ---------- .../include/shv/core/utils/shvlogtypeinfo.h | 5 ----- .../include/shv/core/utils/shvtypeinfo.h | 18 ------------------ libshvcore/src/string.cpp | 1 - libshvcore/src/utils/shvtypeinfo.cpp | 5 ----- libshvcoreqt/include/shv/coreqt/utils.h | 2 -- libshvcoreqt/src/utils.cpp | 10 ---------- libshviotqt/CMakeLists.txt | 1 - .../include/shv/iotqt/rpc/clientconnection.h | 1 - .../shv/iotqt/rpc/rpcresponsecallback.h | 5 ----- 16 files changed, 1 insertion(+), 84 deletions(-) delete mode 100644 libshvcore/include/shv/core/utils/shvlogtypeinfo.h delete mode 100644 libshviotqt/include/shv/iotqt/rpc/rpcresponsecallback.h diff --git a/libshvchainpack/include/shv/chainpack/irpcconnection.h b/libshvchainpack/include/shv/chainpack/irpcconnection.h index e3620da02..d842fa4be 100644 --- a/libshvchainpack/include/shv/chainpack/irpcconnection.h +++ b/libshvchainpack/include/shv/chainpack/irpcconnection.h @@ -34,8 +34,6 @@ class SHVCHAINPACK_DECL_EXPORT IRpcConnection void sendSignal(std::string method, const shv::chainpack::RpcValue ¶ms = shv::chainpack::RpcValue()); void sendShvSignal(const std::string &shv_path, std::string method, const shv::chainpack::RpcValue ¶ms = shv::chainpack::RpcValue()); - [[deprecated("Use sendSignal instead")]] void sendNotify(std::string method, const shv::chainpack::RpcValue ¶ms = shv::chainpack::RpcValue()); - [[deprecated("Use sendShvSignal instead")]] void sendShvNotify(const std::string &shv_path, std::string method, const shv::chainpack::RpcValue ¶ms = shv::chainpack::RpcValue()); void sendResponse(const shv::chainpack::RpcValue &request_id, const shv::chainpack::RpcValue &result); void sendError(const shv::chainpack::RpcValue &request_id, const shv::chainpack::RpcResponse::Error &error); diff --git a/libshvchainpack/include/shv/chainpack/metatypes.h b/libshvchainpack/include/shv/chainpack/metatypes.h index 2fc6ecab7..b010ccd44 100644 --- a/libshvchainpack/include/shv/chainpack/metatypes.h +++ b/libshvchainpack/include/shv/chainpack/metatypes.h @@ -88,8 +88,7 @@ class SHVCHAINPACK_DECL_EXPORT GlobalNS : public meta::MetaNameSpace AccessGrant, DataChange, NodeDrop, - ValueNotAvailable [[deprecated("Use Null instead")]], // DEPRECATED WE ARE USING null INSTEAD - ShvJournalEntry, + ShvJournalEntry = 8, NodePropertyMap, }; }; diff --git a/libshvchainpack/include/shv/chainpack/rpcmessage.h b/libshvchainpack/include/shv/chainpack/rpcmessage.h index 5a80179d2..0f993619d 100644 --- a/libshvchainpack/include/shv/chainpack/rpcmessage.h +++ b/libshvchainpack/include/shv/chainpack/rpcmessage.h @@ -278,7 +278,6 @@ class SHVCHAINPACK_DECL_EXPORT RpcResponse : public RpcMessage static RpcResponse forRequest(const RpcValue::MetaData &meta); static RpcResponse forRequest(const RpcRequest &rq); public: - [[deprecated("Use RpcMessage::hasResult")]] bool hasRetVal() const; bool hasResult() const; bool isSuccess() const; diff --git a/libshvchainpack/include/shv/chainpack/rpcvalue.h b/libshvchainpack/include/shv/chainpack/rpcvalue.h index 7536cefd2..62dc69252 100644 --- a/libshvchainpack/include/shv/chainpack/rpcvalue.h +++ b/libshvchainpack/include/shv/chainpack/rpcvalue.h @@ -136,7 +136,6 @@ class SHVCHAINPACK_DECL_EXPORT RpcValue DateTime(); int64_t msecsSinceEpoch() const; int utcOffsetMin() const; - [[deprecated("Use RpcValue::utcOffsetMin")]] int minutesFromUtc() const; bool isZero() const; static DateTime now(); @@ -149,7 +148,6 @@ class SHVCHAINPACK_DECL_EXPORT RpcValue void setMsecsSinceEpoch(int64_t msecs); void setUtcOffsetMin(int utc_offset_min); #pragma GCC diagnostic pop - [[deprecated("Use RpcValue::setUtcOffsetMin")]]void setTimeZone(int utc_offset_min); std::string toLocalString() const; std::string toIsoString() const; @@ -487,7 +485,3 @@ class SHVCHAINPACK_DECL_EXPORT RpcValueGenList }; } -template [[deprecated("Use RpcValue::to<>")]] T rpcvalue_cast(const shv::chainpack::RpcValue &v) -{ - return v.to(); -} diff --git a/libshvchainpack/src/irpcconnection.cpp b/libshvchainpack/src/irpcconnection.cpp index 5c556a2fd..0c4a8c529 100644 --- a/libshvchainpack/src/irpcconnection.cpp +++ b/libshvchainpack/src/irpcconnection.cpp @@ -28,16 +28,6 @@ void IRpcConnection::sendShvSignal(const std::string &shv_path, std::string meth sendRpcMessage(rq); } -[[deprecated("Use sendSignal instead")]] void IRpcConnection::sendNotify(std::string method, const shv::chainpack::RpcValue ¶ms) -{ - sendSignal(method, params); -} - -[[deprecated("Use sendShvSignal instead")]] void IRpcConnection::sendShvNotify(const std::string &shv_path, std::string method, const shv::chainpack::RpcValue ¶ms) -{ - sendShvSignal(shv_path, method, params); -} - void IRpcConnection::sendResponse(const RpcValue &request_id, const RpcValue &result) { RpcResponse resp; diff --git a/libshvchainpack/src/rpcmessage.cpp b/libshvchainpack/src/rpcmessage.cpp index 1c854d576..ae98824ce 100644 --- a/libshvchainpack/src/rpcmessage.cpp +++ b/libshvchainpack/src/rpcmessage.cpp @@ -890,11 +890,6 @@ RpcResponse RpcResponse::forRequest(const RpcRequest &rq) return forRequest(rq.metaData()); } -bool RpcResponse::hasRetVal() const -{ - return error().isValid() || result().isValid(); -} - bool RpcResponse::hasResult() const { return error().isValid() || result().isValid(); diff --git a/libshvchainpack/src/rpcvalue.cpp b/libshvchainpack/src/rpcvalue.cpp index 757208348..da7c8d781 100644 --- a/libshvchainpack/src/rpcvalue.cpp +++ b/libshvchainpack/src/rpcvalue.cpp @@ -954,11 +954,6 @@ int RpcValue::DateTime::utcOffsetMin() const return m_dtm.tz * 15; } -int RpcValue::DateTime::minutesFromUtc() const -{ - return utcOffsetMin(); -} - bool RpcValue::DateTime::isZero() const { return msecsSinceEpoch() == 0; @@ -1048,11 +1043,6 @@ void RpcValue::DateTime::setUtcOffsetMin(int utc_offset_min) m_dtm.tz = (utc_offset_min / 15) & 0x7F; #pragma GCC diagnostic pop } -void RpcValue::DateTime::setTimeZone(int utc_offset_min) -{ - setUtcOffsetMin(utc_offset_min); -} - std::string RpcValue::DateTime::toLocalString() const { diff --git a/libshvcore/include/shv/core/utils/shvlogtypeinfo.h b/libshvcore/include/shv/core/utils/shvlogtypeinfo.h deleted file mode 100644 index d04b34e13..000000000 --- a/libshvcore/include/shv/core/utils/shvlogtypeinfo.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include -namespace [[deprecated("#include is deprecated, use #include instead")]] deprecated_shvlogtype_h { -} -using namespace deprecated_shvlogtype_h; diff --git a/libshvcore/include/shv/core/utils/shvtypeinfo.h b/libshvcore/include/shv/core/utils/shvtypeinfo.h index ab1c07df5..687d87af0 100644 --- a/libshvcore/include/shv/core/utils/shvtypeinfo.h +++ b/libshvcore/include/shv/core/utils/shvtypeinfo.h @@ -142,7 +142,6 @@ class SHVCORE_DECL_EXPORT ShvPropertyDescr : public ShvFieldDescr public: ShvPropertyDescr(); ShvPropertyDescr(const std::string &name, const std::string &type_name); - [[deprecated]] ShvPropertyDescr(const std::string &type_name); std::vector methods() const; ShvMethodDescr method(const std::string &name) const; @@ -214,11 +213,6 @@ class SHVCORE_DECL_EXPORT ShvTypeInfo ShvTypeInfo& setExtraTags(const std::string &node_path, const shv::chainpack::RpcValue &tags); shv::chainpack::RpcValue extraTags(const std::string &node_path) const; - [[deprecated("setTypeDescription(const ShvTypeDescr &type_descr, const std::string &type_name) is deprecated, use setTypeDescription(const std::string &type_name, const ShvTypeDescr &type_descr)")]] ShvTypeInfo& setTypeDescription(const ShvTypeDescr &type_descr, const std::string &type_name) - { - setTypeDescription(type_name, type_descr); - return *this; - } ShvTypeInfo& setTypeDescription(const std::string &type_name, const ShvTypeDescr &type_descr); ShvPropertyDescr propertyDescriptionForPath(const std::string &shv_path, std::string *p_field_name = nullptr) const; @@ -271,16 +265,4 @@ class SHVCORE_DECL_EXPORT ShvTypeInfo std::map m_blacklistedPaths; // shv-path -> blacklist std::map m_propertyDeviations; // should be empty, devices should not have different property descriptions for same device-type }; - -// backward compatibility -using ShvLogMethodDescr [[deprecated("ShvLogMethodDescr is deprecated, use ShvMethodDescr instead")]] = ShvMethodDescr; -using ShvLogFieldDescr [[deprecated("ShvLogFieldDescr is deprecated, use ShvFieldDescr instead")]] = ShvFieldDescr; -using ShvLogTypeDescr [[deprecated("ShvLogTypeDescr is deprecated, use ShvTypeDescr instead")]] = ShvTypeDescr; -using ShvLogNodeDescr [[deprecated("ShvLogNodeDescr is deprecated, use ShvPropertyDescr instead")]] = ShvPropertyDescr; -using ShvNodeDescr [[deprecated("ShvNodeDescr is deprecated, use ShvPropertyDescr instead")]] = ShvPropertyDescr; -using ShvLogTypeInfo [[deprecated("ShvLogTypeInfo is deprecated, use ShvTypeInfo instead")]] = ShvTypeInfo; -using ShvLogPathDescr [[deprecated("ShvLogPathDescr is deprecated, use ShvPropertyDescr instead")]] = ShvPropertyDescr; -using ShvLogTypeDescrField [[deprecated("ShvLogTypeDescrField is deprecated, use ShvFieldDescr instead")]] = ShvFieldDescr; - - } // namespace shv::core::utils diff --git a/libshvcore/src/string.cpp b/libshvcore/src/string.cpp index e296400d3..37dfe030c 100644 --- a/libshvcore/src/string.cpp +++ b/libshvcore/src/string.cpp @@ -1,4 +1,3 @@ -// NOLINTNEXTLINE(modernize-deprecated-headers) #include #include diff --git a/libshvcore/src/utils/shvtypeinfo.cpp b/libshvcore/src/utils/shvtypeinfo.cpp index aa332352b..8d6793edf 100644 --- a/libshvcore/src/utils/shvtypeinfo.cpp +++ b/libshvcore/src/utils/shvtypeinfo.cpp @@ -550,11 +550,6 @@ ShvPropertyDescr::ShvPropertyDescr(const std::string &name, const std::string &t { } -[[deprecated]] ShvPropertyDescr::ShvPropertyDescr(const std::string &type_name) -{ - setTypeName(type_name); -} - std::vector ShvPropertyDescr::methods() const { std::vector ret; diff --git a/libshvcoreqt/include/shv/coreqt/utils.h b/libshvcoreqt/include/shv/coreqt/utils.h index dce41f43d..43ec02636 100644 --- a/libshvcoreqt/include/shv/coreqt/utils.h +++ b/libshvcoreqt/include/shv/coreqt/utils.h @@ -132,8 +132,6 @@ class SHVCOREQT_DECL_EXPORT Utils static chainpack::RpcValue qVariantToRpcValue(const QVariant &v, bool *ok = nullptr); static QStringList rpcValueToStringList(const shv::chainpack::RpcValue &rpcval); static shv::chainpack::RpcValue stringListToRpcValue(const QStringList &sl); - [[deprecated("Use shv::coreqt::utils::joinPath")]] static QString joinPath(const QString &p1, const QString &p2); - [[deprecated("Use shv::coreqt::utils::joinPath")]] static QString joinPath(const QString &p1, const QString &p2, const QString &p3); static std::vector compressGZip(const std::vector &data); diff --git a/libshvcoreqt/src/utils.cpp b/libshvcoreqt/src/utils.cpp index ae5673c62..e1a62c375 100644 --- a/libshvcoreqt/src/utils.cpp +++ b/libshvcoreqt/src/utils.cpp @@ -54,16 +54,6 @@ QString utils::joinPath(const QString &p1, const QString &p2) return sv1.toString() + '/' + sv2.toString(); } -QString Utils::joinPath(const QString &p1, const QString &p2) -{ - return utils::joinPath(p1, p2); -} - -QString Utils::joinPath(const QString &p1, const QString &p2, const QString &p3) -{ - return utils::joinPath(p1, p2, p3); -} - bool Utils::isValueNotAvailable(const QVariant &val) { return !val.isValid(); diff --git a/libshviotqt/CMakeLists.txt b/libshviotqt/CMakeLists.txt index 53c0cb528..986d21d17 100644 --- a/libshviotqt/CMakeLists.txt +++ b/libshviotqt/CMakeLists.txt @@ -36,7 +36,6 @@ qt_add_library(libshviotqt include/shv/iotqt/rpc/deviceconnection.h include/shv/iotqt/rpc/tcpserver.h include/shv/iotqt/rpc/rpccall.h - include/shv/iotqt/rpc/rpcresponsecallback.h include/shv/iotqt/rpc/socket.h include/shv/iotqt/rpc/localsocket.h include/shv/iotqt/rpc/clientconnection.h diff --git a/libshviotqt/include/shv/iotqt/rpc/clientconnection.h b/libshviotqt/include/shv/iotqt/rpc/clientconnection.h index e790046ec..4687f94af 100644 --- a/libshviotqt/include/shv/iotqt/rpc/clientconnection.h +++ b/libshviotqt/include/shv/iotqt/rpc/clientconnection.h @@ -73,7 +73,6 @@ class SHVIOTQT_DECL_EXPORT ClientConnection : public SocketRpcConnection protected: bool isShvPathMutedInLog(const std::string &shv_path, const std::string &method) const; public: - [[deprecated]] void sendMessage(const shv::chainpack::RpcMessage &rpc_msg) { sendRpcMessage(rpc_msg); } /// IRpcConnection interface implementation void sendRpcMessage(const shv::chainpack::RpcMessage &rpc_msg) override; void onRpcMessageReceived(const shv::chainpack::RpcMessage &msg) override; diff --git a/libshviotqt/include/shv/iotqt/rpc/rpcresponsecallback.h b/libshviotqt/include/shv/iotqt/rpc/rpcresponsecallback.h deleted file mode 100644 index be18e8230..000000000 --- a/libshviotqt/include/shv/iotqt/rpc/rpcresponsecallback.h +++ /dev/null @@ -1,5 +0,0 @@ -#pragma once -#include -namespace [[deprecated("#include is deprecated, use #include instead")]] deprecated_rpccall_h { -} -using namespace deprecated_rpccall_h; From f2d05a39329d4898544ff20b1a3e9d7368b9b0f4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Kubern=C3=A1t?= Date: Mon, 7 Oct 2024 16:11:27 +0200 Subject: [PATCH 3/3] CI: Fix windows build --- .github/actions/cmake/action.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/actions/cmake/action.yml b/.github/actions/cmake/action.yml index 604c86c97..e73afd994 100644 --- a/.github/actions/cmake/action.yml +++ b/.github/actions/cmake/action.yml @@ -40,6 +40,10 @@ runs: - name: Install Windows deps if: runner.os == 'Windows' run: | + # https://github.com/microsoft/vcpkg/issues/41199#issuecomment-2378255699 + export SystemDrive="$SYSTEMDRIVE" + export SystemRoot="$SYSTEMROOT" + export windir="$WINDIR" vcpkg install doctest:x64-mingw-dynamic trompeloeil:x64-mingw-dynamic echo cmake_extra_args="'-DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake' '-DMINGW=ON' '-G MinGW Makefiles'" >> "$GITHUB_ENV" shell: bash