Changeset View
Changeset View
Standalone View
Standalone View
src/core/simplejob.cpp
Show First 20 Lines • Show All 122 Lines • ▼ Show 20 Line(s) | |||||
123 | } | 123 | } | ||
124 | 124 | | |||
125 | void SimpleJobPrivate::start(Slave *slave) | 125 | void SimpleJobPrivate::start(Slave *slave) | ||
126 | { | 126 | { | ||
127 | Q_Q(SimpleJob); | 127 | Q_Q(SimpleJob); | ||
128 | m_slave = slave; | 128 | m_slave = slave; | ||
129 | 129 | | |||
130 | // Slave::setJob can send us SSL metadata if there is a persistent connection | 130 | // Slave::setJob can send us SSL metadata if there is a persistent connection | ||
131 | q->connect(slave, SIGNAL(metaData(KIO::MetaData)), | 131 | QObject::connect(slave, &Slave::metaData, q, &SimpleJob::slotMetaData); | ||
132 | SLOT(slotMetaData(KIO::MetaData))); | | |||
133 | 132 | | |||
134 | slave->setJob(q); | 133 | slave->setJob(q); | ||
135 | 134 | | |||
136 | q->connect(slave, SIGNAL(error(int,QString)), | 135 | QObject::connect(slave, &Slave::error, q, &SimpleJob::slotError); | ||
137 | SLOT(slotError(int,QString))); | | |||
138 | 136 | | |||
139 | q->connect(slave, SIGNAL(warning(QString)), | 137 | QObject::connect(slave, &Slave::warning, q, &SimpleJob::slotWarning); | ||
140 | SLOT(slotWarning(QString))); | 138 | | ||
139 | QObject::connect(slave, &Slave::finished, q, &SimpleJob::slotFinished); | ||||
141 | 140 | | |||
142 | q->connect(slave, SIGNAL(infoMessage(QString)), | 141 | q->connect(slave, SIGNAL(infoMessage(QString)), | ||
broulik: Try something along the lines of
```
q->connect(slave, &Slave::infoMessage, q, std::bind… | |||||
143 | SLOT(_k_slotSlaveInfoMessage(QString))); | 142 | SLOT(_k_slotSlaveInfoMessage(QString))); | ||
144 | 143 | | |||
145 | q->connect(slave, SIGNAL(connected()), | 144 | q->connect(slave, SIGNAL(connected()), | ||
146 | SLOT(slotConnected())); | 145 | SLOT(slotConnected())); | ||
mwolff: use four-arg connect, i.e. also add `q` as context | |||||
147 | 146 | | |||
148 | q->connect(slave, SIGNAL(finished()), | | |||
149 | SLOT(slotFinished())); | | |||
150 | | ||||
151 | q->connect(slave, SIGNAL(privilegeOperationRequested()), | 147 | q->connect(slave, SIGNAL(privilegeOperationRequested()), | ||
mwolff: dito | |||||
152 | SLOT(slotPrivilegeOperationRequested())); | 148 | SLOT(slotPrivilegeOperationRequested())); | ||
mwolff: dito | |||||
153 | 149 | | |||
154 | if ((m_extraFlags & EF_TransferJobDataSent) == 0) { // this is a "get" job | 150 | if ((m_extraFlags & EF_TransferJobDataSent) == 0) { // this is a "get" job | ||
155 | q->connect(slave, SIGNAL(totalSize(KIO::filesize_t)), | 151 | q->connect(slave, SIGNAL(totalSize(KIO::filesize_t)), | ||
156 | SLOT(slotTotalSize(KIO::filesize_t))); | 152 | SLOT(slotTotalSize(KIO::filesize_t))); | ||
157 | 153 | | |||
158 | q->connect(slave, SIGNAL(processedSize(KIO::filesize_t)), | 154 | q->connect(slave, SIGNAL(processedSize(KIO::filesize_t)), | ||
159 | SLOT(slotProcessedSize(KIO::filesize_t))); | 155 | SLOT(slotProcessedSize(KIO::filesize_t))); | ||
mwolff: dito | |||||
160 | 156 | | |||
161 | q->connect(slave, SIGNAL(speed(ulong)), | 157 | q->connect(slave, SIGNAL(speed(ulong)), | ||
162 | SLOT(slotSpeed(ulong))); | 158 | SLOT(slotSpeed(ulong))); | ||
mwolff: dito | |||||
163 | } | 159 | } | ||
164 | 160 | | |||
165 | const QVariant windowIdProp = q->property("window-id"); // see KJobWidgets::setWindow | 161 | const QVariant windowIdProp = q->property("window-id"); // see KJobWidgets::setWindow | ||
mwolff: dito | |||||
166 | if (windowIdProp.isValid()) { | 162 | if (windowIdProp.isValid()) { | ||
167 | m_outgoingMetaData.insert(QStringLiteral("window-id"), QString::number(windowIdProp.toULongLong())); | 163 | m_outgoingMetaData.insert(QStringLiteral("window-id"), QString::number(windowIdProp.toULongLong())); | ||
168 | } | 164 | } | ||
169 | 165 | | |||
170 | const QVariant userTimestampProp = q->property("userTimestamp"); // see KJobWidgets::updateUserTimestamp | 166 | const QVariant userTimestampProp = q->property("userTimestamp"); // see KJobWidgets::updateUserTimestamp | ||
171 | if (userTimestampProp.isValid()) { | 167 | if (userTimestampProp.isValid()) { | ||
172 | m_outgoingMetaData.insert(QStringLiteral("user-timestamp"), QString::number(userTimestampProp.toULongLong())); | 168 | m_outgoingMetaData.insert(QStringLiteral("user-timestamp"), QString::number(userTimestampProp.toULongLong())); | ||
173 | } | 169 | } | ||
▲ Show 20 Lines • Show All 256 Lines • Show Last 20 Lines |
Try something along the lines of
Note that if there's a disconnect for that particular signal somewhere in the code this will not work but at a quick glance I can only see a disconnect(m_slave); which is fine
QObject::connect is static, so you might as well do QObject::connect instead of q->connect