Commit 16551fc6 authored by Guillaume Roguez's avatar Guillaume Roguez Committed by Nicolas Jager

datatransfer: add account+peer information

Add AccountId and PeerUri to DataTransfertInfo structure.

Change-Id: I6cf3661d7d7f451da713a036c66c4aa5a1c671d8
Reviewed-by: default avatarNicolas Jäger <nicolas.jager@savoirfairelinux.com>
parent c598cf48
......@@ -1420,7 +1420,7 @@
<method name="dataTransferInfo" tp:name-for-bindings="dataTransferInfo">
<tp:added version="4.2.0"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="DataTransferInfo"/>
<arg type="(buttss)" name="DataTransferInfo" direction="out">
<arg type="(buttssss)" name="DataTransferInfo" direction="out">
</arg>
<arg type="t" name="DataTransferId" direction="in">
</arg>
......
......@@ -621,10 +621,10 @@ DBusConfigurationManager::sendFile(const std::string& account_id, const std::str
return DRing::sendFile(account_id, peer_uri, file_path, display_name);
}
DBus::Struct<bool, uint32_t, uint64_t, uint64_t, std::string, std::string>
DBus::Struct<bool, uint32_t, uint64_t, uint64_t, std::string, std::string, std::string, std::string>
DBusConfigurationManager::dataTransferInfo(const DRing::DataTransferId& id)
{
DBus::Struct<bool, uint32_t, uint64_t, uint64_t, std::string, std::string> out;
DBus::Struct<bool, uint32_t, uint64_t, uint64_t, std::string, std::string, std::string, std::string> out;
auto info = DRing::dataTransferInfo(id);
out._1 = info.isOutgoing;
out._2 = uint32_t(info.lastEvent);
......@@ -632,6 +632,8 @@ DBusConfigurationManager::dataTransferInfo(const DRing::DataTransferId& id)
out._4 = info.bytesProgress;
out._5 = info.displayName;
out._6 = info.path;
out._7 = info.accountId;
out._8 = info.peer;
return out;
}
......
......@@ -155,7 +155,7 @@ class DBusConfigurationManager :
void connectivityChanged();
DRing::DataTransferId sendFile(const std::string& account_id, const std::string& peer_uri,
const std::string& file_path, const std::string& display_name);
DBus::Struct<bool, uint32_t, uint64_t, uint64_t, std::string, std::string> dataTransferInfo(const DRing::DataTransferId& id);
DBus::Struct<bool, uint32_t, uint64_t, uint64_t, std::string, std::string, std::string, std::string> dataTransferInfo(const DRing::DataTransferId& id);
uint64_t dataTransferBytesProgress(const uint64_t& id);
std::vector<uint64_t> dataTransferList();
void acceptFileTransfer(const uint64_t& id, const std::string& file_path, const uint64_t& offset);
......
......@@ -56,6 +56,8 @@ struct DataTransferInfo
std::streamsize bytesProgress {0}; ///< Number of bytes sent/received
std::string displayName; ///< Human oriented transfer name
std::string path; ///< associated local file path if supported (empty, if not)
std::string accountId; ///< Identifier of the emiter/receiver account
std::string peer; ///< Identifier of the remote peer (in the semantic of the associated account)
};
std::vector<DataTransferId> dataTransferList();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment