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 60 Lines • ▼ Show 20 Line(s) | 335 | static inline TransferJob *newJob(const QUrl &url, int command, | |||
320 | const QByteArray &_staticData, | 337 | const QByteArray &_staticData, | ||
321 | JobFlags flags) | 338 | JobFlags flags) | ||
322 | { | 339 | { | ||
323 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, _staticData)); | 340 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, _staticData)); | ||
324 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | 341 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | ||
325 | if (!(flags & HideProgressInfo)) { | 342 | if (!(flags & HideProgressInfo)) { | ||
326 | KIO::getJobTracker()->registerJob(job); | 343 | KIO::getJobTracker()->registerJob(job); | ||
327 | } | 344 | } | ||
345 | if (!(flags & NoPrivilegeExecution)) { | ||||
346 | job->d_func()->m_privilegeExecutionEnabled = true; | ||||
347 | job->d_func()->m_operationType = Transfer; | ||||
348 | } | ||||
328 | return job; | 349 | return job; | ||
329 | } | 350 | } | ||
330 | 351 | | |||
331 | static inline TransferJob *newJob(const QUrl &url, int command, | 352 | static inline TransferJob *newJob(const QUrl &url, int command, | ||
332 | const QByteArray &packedArgs, | 353 | const QByteArray &packedArgs, | ||
333 | QIODevice *ioDevice, | 354 | QIODevice *ioDevice, | ||
334 | JobFlags flags) | 355 | JobFlags flags) | ||
335 | { | 356 | { | ||
336 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, ioDevice)); | 357 | TransferJob *job = new TransferJob(*new TransferJobPrivate(url, command, packedArgs, ioDevice)); | ||
337 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | 358 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | ||
338 | if (!(flags & HideProgressInfo)) { | 359 | if (!(flags & HideProgressInfo)) { | ||
339 | KIO::getJobTracker()->registerJob(job); | 360 | KIO::getJobTracker()->registerJob(job); | ||
340 | } | 361 | } | ||
362 | if (!(flags & NoPrivilegeExecution)) { | ||||
363 | job->d_func()->m_privilegeExecutionEnabled = true; | ||||
364 | job->d_func()->m_operationType = Transfer; | ||||
365 | } | ||||
341 | return job; | 366 | return job; | ||
342 | } | 367 | } | ||
343 | }; | 368 | }; | ||
344 | 369 | | |||
345 | class DirectCopyJobPrivate; | 370 | class DirectCopyJobPrivate; | ||
346 | /** | 371 | /** | ||
347 | * @internal | 372 | * @internal | ||
348 | * Used for direct copy from or to the local filesystem (i.e. SlaveBase::copy()) | 373 | * Used for direct copy from or to the local filesystem (i.e. SlaveBase::copy()) | ||
Show All 26 Lines |