Use initializers to construct it
This commit is contained in:
parent
308a89f5ea
commit
359194c2ed
2 changed files with 8 additions and 12 deletions
|
@ -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()));
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue