mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-07 19:35:32 +08:00
Smart xswiftbus compatibility check based on git commit SHA-1
This is more tolerant that the simple check based on version numbers. Different versions can be compatible if they have the same SHA-1 when considering only those files that can influence xswiftbus.
This commit is contained in:
@@ -58,6 +58,11 @@ namespace XSwiftBus
|
||||
return version;
|
||||
}
|
||||
|
||||
std::string CService::getCommitHash() const
|
||||
{
|
||||
return XSWIFTBUS_COMMIT;
|
||||
}
|
||||
|
||||
void CService::addTextMessage(const std::string &text, double red, double green, double blue)
|
||||
{
|
||||
if (text.empty()) { return; }
|
||||
@@ -253,6 +258,13 @@ namespace XSwiftBus
|
||||
sendDBusReply(sender, serial, getVersionNumber());
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "getCommitHash")
|
||||
{
|
||||
queueDBusCall([ = ]()
|
||||
{
|
||||
sendDBusReply(sender, serial, getCommitHash());
|
||||
});
|
||||
}
|
||||
else if (message.getMethodName() == "addTextMessage")
|
||||
{
|
||||
maybeSendEmptyDBusReply(wantsReply, sender, serial);
|
||||
|
||||
Reference in New Issue
Block a user