Make it possible to put NetworkPackage right into qDebug

This commit is contained in:
Aleix Pol 2016-06-03 15:50:46 +02:00
parent c89b032569
commit fd19426756
2 changed files with 12 additions and 0 deletions

View file

@ -35,6 +35,16 @@
#include "pluginloader.h"
#include "kdeconnectconfig.h"
QDebug operator<<(QDebug s, const NetworkPackage& pkg)
{
s.nospace() << "NetworkPackage(" << pkg.type() << ':' << pkg.body();
if (pkg.hasPayload()) {
s.nospace() << ":withpayload";
}
s.nospace() << ')';
return s.space();
}
//const QCA::EncryptionAlgorithm NetworkPackage::EncryptionAlgorithm = QCA::EME_PKCS1v15;
const int NetworkPackage::ProtocolVersion = 6;

View file

@ -101,4 +101,6 @@ private:
};
KDECONNECTCORE_EXPORT QDebug operator<<(QDebug s, const NetworkPackage& pkg);
#endif // NETWORKPACKAGE_H