Make test not crash
This commit is contained in:
parent
4d059af839
commit
a8e9c0d002
3 changed files with 10 additions and 2 deletions
|
@ -89,7 +89,7 @@ private Q_SLOTS:
|
|||
void onNewDeviceLink(const NetworkPacket& identityPacket, DeviceLink* dl);
|
||||
void onDeviceStatusChanged();
|
||||
|
||||
private:
|
||||
protected:
|
||||
void addDevice(Device* device);
|
||||
bool isDiscoveringDevices() const;
|
||||
void removeDevice(Device* d);
|
||||
|
|
|
@ -103,6 +103,10 @@ class TestSendFile : public QObject
|
|||
kcc->addTrustedDevice(deviceId, deviceName, deviceType);
|
||||
kcc->setDeviceProperty(deviceId, QStringLiteral("certificate"), QString::fromLatin1(kcc->certificate().toPem())); // Using same certificate from kcc, instead of generating
|
||||
|
||||
//We need the device to be loaded on the daemon, otherwise CompositeUploadJob will get a null device
|
||||
Device* device = new Device(this, deviceId);
|
||||
m_daemon->addDevice(device);
|
||||
|
||||
QSharedPointer<QFile> f(new QFile(aFile));
|
||||
NetworkPacket np(PACKET_TYPE_SHARE_REQUEST);
|
||||
np.setPayload(f, aFile.size());
|
||||
|
|
|
@ -33,6 +33,10 @@ public:
|
|||
{
|
||||
}
|
||||
|
||||
void addDevice(Device* device) {
|
||||
Daemon::addDevice(device);
|
||||
}
|
||||
|
||||
void reportError(const QString & title, const QString & description) override
|
||||
{
|
||||
qWarning() << "error:" << title << description;
|
||||
|
@ -50,7 +54,7 @@ public:
|
|||
return m_nam;
|
||||
}
|
||||
|
||||
Q_SCRIPTABLE virtual void sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) override
|
||||
Q_SCRIPTABLE virtual void sendSimpleNotification(const QString &eventId, const QString &title, const QString &text, const QString &iconName) override
|
||||
{
|
||||
qDebug() << eventId << title << text << iconName;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue