Changeset View
Changeset View
Standalone View
Standalone View
src/core/job_p.h
Show First 20 Lines • Show All 243 Lines • ▼ Show 20 Line(s) | 132 | #endif | |||
---|---|---|---|---|---|
244 | static inline SimpleJob *newJob(const QUrl &url, int command, const QByteArray &packedArgs, | 244 | static inline SimpleJob *newJob(const QUrl &url, int command, const QByteArray &packedArgs, | ||
245 | JobFlags flags = HideProgressInfo) | 245 | JobFlags flags = HideProgressInfo) | ||
246 | { | 246 | { | ||
247 | SimpleJob *job = new SimpleJob(*new SimpleJobPrivate(url, command, packedArgs)); | 247 | SimpleJob *job = new SimpleJob(*new SimpleJobPrivate(url, command, packedArgs)); | ||
248 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | 248 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | ||
249 | if (!(flags & HideProgressInfo)) { | 249 | if (!(flags & HideProgressInfo)) { | ||
250 | KIO::getJobTracker()->registerJob(job); | 250 | KIO::getJobTracker()->registerJob(job); | ||
251 | } | 251 | } | ||
252 | if (!(flags & NoPrivilegeExecution)) { | ||||
253 | job->d_func()->m_privilegeExecutionEnabled = true; | ||||
254 | // Only delete, rename and symlink operation accept JobFlags. | ||||
255 | FileOperationType opType; | ||||
256 | switch (command) { | ||||
257 | case CMD_DEL: | ||||
258 | opType = Delete; | ||||
259 | break; | ||||
260 | case CMD_RENAME: | ||||
261 | opType = Rename; | ||||
262 | break; | ||||
263 | case CMD_SYMLINK: | ||||
264 | opType = Symlink; | ||||
265 | break; | ||||
266 | } | ||||
267 | job->d_func()->m_operationType = opType; | ||||
268 | } | ||||
252 | return job; | 269 | return job; | ||
253 | } | 270 | } | ||
254 | }; | 271 | }; | ||
255 | 272 | | |||
256 | class TransferJobPrivate: public SimpleJobPrivate | 273 | class TransferJobPrivate: public SimpleJobPrivate | ||
257 | { | 274 | { | ||
258 | public: | 275 | public: | ||
259 | inline TransferJobPrivate(const QUrl &url, int command, const QByteArray &packedArgs, | 276 | inline TransferJobPrivate(const QUrl &url, int command, const QByteArray &packedArgs, | ||
▲ Show 20 Lines • Show All 57 Lines • ▼ Show 20 Line(s) | 332 | static inline TransferJob *newJob(const QUrl &url, int command, | |||
317 | const QByteArray &_staticData, | 334 | const QByteArray &_staticData, | ||
318 | JobFlags flags) | 335 | JobFlags flags) | ||
319 | { | 336 | { | ||
320 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, _staticData)); | 337 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, _staticData)); | ||
321 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | 338 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | ||
322 | if (!(flags & HideProgressInfo)) { | 339 | if (!(flags & HideProgressInfo)) { | ||
323 | KIO::getJobTracker()->registerJob(job); | 340 | KIO::getJobTracker()->registerJob(job); | ||
324 | } | 341 | } | ||
342 | if (!(flags & NoPrivilegeExecution)) { | ||||
343 | job->d_func()->m_privilegeExecutionEnabled = true; | ||||
344 | job->d_func()->m_operationType = Transfer; | ||||
345 | } | ||||
325 | return job; | 346 | return job; | ||
326 | } | 347 | } | ||
327 | 348 | | |||
328 | static inline TransferJob *newJob(const QUrl &url, int command, | 349 | static inline TransferJob *newJob(const QUrl &url, int command, | ||
329 | const QByteArray &packedArgs, | 350 | const QByteArray &packedArgs, | ||
330 | QIODevice *ioDevice, | 351 | QIODevice *ioDevice, | ||
331 | JobFlags flags) | 352 | JobFlags flags) | ||
332 | { | 353 | { | ||
333 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, ioDevice)); | 354 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, ioDevice)); | ||
334 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | 355 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | ||
335 | if (!(flags & HideProgressInfo)) { | 356 | if (!(flags & HideProgressInfo)) { | ||
336 | KIO::getJobTracker()->registerJob(job); | 357 | KIO::getJobTracker()->registerJob(job); | ||
337 | } | 358 | } | ||
359 | if (!(flags & NoPrivilegeExecution)) { | ||||
360 | job->d_func()->m_privilegeExecutionEnabled = true; | ||||
361 | job->d_func()->m_operationType = Transfer; | ||||
362 | } | ||||
338 | return job; | 363 | return job; | ||
339 | } | 364 | } | ||
340 | }; | 365 | }; | ||
341 | 366 | | |||
342 | class DirectCopyJobPrivate; | 367 | class DirectCopyJobPrivate; | ||
343 | /** | 368 | /** | ||
344 | * @internal | 369 | * @internal | ||
345 | * Used for direct copy from or to the local filesystem (i.e. SlaveBase::copy()) | 370 | * Used for direct copy from or to the local filesystem (i.e. SlaveBase::copy()) | ||
Show All 26 Lines |