Use initializers to construct it

This commit is contained in:
Aleix Pol 2016-07-04 19:18:13 +02:00
parent 308a89f5ea
commit 359194c2ed
2 changed files with 8 additions and 12 deletions

View file

@ -29,16 +29,12 @@
UploadJob::UploadJob(const QSharedPointer<QIODevice>& source, const QString& deviceId)
: KJob()
, mInput(source)
, mServer(new Server(this))
, mSocket(nullptr)
, mPort(0)
, mDeviceId(deviceId) // We will use this info if link is on ssl, to send encrypted payload
{
// TODO: initialize in constructor
mInput = source;
mServer = new Server(this);
mSocket = nullptr;
mPort = 0;
// We will use this info if link is on ssl, to send encrypted payload
this->mDeviceId = deviceId;
connect(mInput.data(), SIGNAL(readyRead()), this, SLOT(startUploading()));
connect(mInput.data(), SIGNAL(aboutToClose()), this, SLOT(aboutToClose()));
}

View file

@ -41,11 +41,11 @@ public:
QVariantMap transferInfo();
private:
QSharedPointer<QIODevice> mInput;
Server* mServer;
const QSharedPointer<QIODevice> mInput;
Server * const mServer;
QSslSocket* mSocket;
quint16 mPort;
QString mDeviceId;
const QString mDeviceId;
private Q_SLOTS:
void startUploading();