Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove deprecations #496

Merged
merged 3 commits into from
Oct 7, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/actions/cmake/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions libshvbroker/src/currentclientshvnode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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";
}
Expand All @@ -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)"},
}
{
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions libshvchainpack/include/shv/chainpack/irpcconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@ class SHVCHAINPACK_DECL_EXPORT IRpcConnection

void sendSignal(std::string method, const shv::chainpack::RpcValue &params = shv::chainpack::RpcValue());
void sendShvSignal(const std::string &shv_path, std::string method, const shv::chainpack::RpcValue &params = shv::chainpack::RpcValue());
[[deprecated("Use sendSignal instead")]] void sendNotify(std::string method, const shv::chainpack::RpcValue &params = shv::chainpack::RpcValue());
[[deprecated("Use sendShvSignal instead")]] void sendShvNotify(const std::string &shv_path, std::string method, const shv::chainpack::RpcValue &params = 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);
Expand Down
3 changes: 1 addition & 2 deletions libshvchainpack/include/shv/chainpack/metatypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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,
};
};
Expand Down
1 change: 0 additions & 1 deletion libshvchainpack/include/shv/chainpack/rpcmessage.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
6 changes: 0 additions & 6 deletions libshvchainpack/include/shv/chainpack/rpcvalue.h
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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;
Expand Down Expand Up @@ -487,7 +485,3 @@ class SHVCHAINPACK_DECL_EXPORT RpcValueGenList
};

}
template<typename T> [[deprecated("Use RpcValue::to<>")]] T rpcvalue_cast(const shv::chainpack::RpcValue &v)
{
return v.to<T>();
}
10 changes: 0 additions & 10 deletions libshvchainpack/src/irpcconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &params)
{
sendSignal(method, params);
}

[[deprecated("Use sendShvSignal instead")]] void IRpcConnection::sendShvNotify(const std::string &shv_path, std::string method, const shv::chainpack::RpcValue &params)
{
sendShvSignal(shv_path, method, params);
}

void IRpcConnection::sendResponse(const RpcValue &request_id, const RpcValue &result)
{
RpcResponse resp;
Expand Down
5 changes: 0 additions & 5 deletions libshvchainpack/src/rpcmessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
10 changes: 0 additions & 10 deletions libshvchainpack/src/rpcvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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
{
Expand Down
5 changes: 0 additions & 5 deletions libshvcore/include/shv/core/utils/shvlogtypeinfo.h

This file was deleted.

18 changes: 0 additions & 18 deletions libshvcore/include/shv/core/utils/shvtypeinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<ShvMethodDescr> methods() const;
ShvMethodDescr method(const std::string &name) const;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -271,16 +265,4 @@ class SHVCORE_DECL_EXPORT ShvTypeInfo
std::map<std::string, chainpack::RpcValue> m_blacklistedPaths; // shv-path -> blacklist
std::map<std::string, ShvPropertyDescr> 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
1 change: 0 additions & 1 deletion libshvcore/src/string.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
// NOLINTNEXTLINE(modernize-deprecated-headers)
#include <shv/core/string.h>
#include <shv/core/stringview.h>

Expand Down
5 changes: 0 additions & 5 deletions libshvcore/src/utils/shvtypeinfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<ShvMethodDescr> ShvPropertyDescr::methods() const
{
std::vector<ShvMethodDescr> ret;
Expand Down
2 changes: 0 additions & 2 deletions libshvcoreqt/include/shv/coreqt/utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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<uint8_t> compressGZip(const std::vector<uint8_t> &data);

Expand Down
10 changes: 0 additions & 10 deletions libshvcoreqt/src/utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
1 change: 0 additions & 1 deletion libshviotqt/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion libshviotqt/include/shv/iotqt/rpc/clientconnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
5 changes: 0 additions & 5 deletions libshviotqt/include/shv/iotqt/rpc/rpcresponsecallback.h

This file was deleted.