Changeset View
Changeset View
Standalone View
Standalone View
src/core/chmodjob.cpp
Show First 20 Lines • Show All 81 Lines • ▼ Show 20 Line(s) | 81 | static inline ChmodJob *newJob(const KFileItemList &lstItems, int permissions, int mask, | |||
---|---|---|---|---|---|
82 | KUserId newOwner, KGroupId newGroup, bool recursive, JobFlags flags) | 82 | KUserId newOwner, KGroupId newGroup, bool recursive, JobFlags flags) | ||
83 | { | 83 | { | ||
84 | ChmodJob *job = new ChmodJob(*new ChmodJobPrivate(lstItems, permissions, mask, | 84 | ChmodJob *job = new ChmodJob(*new ChmodJobPrivate(lstItems, permissions, mask, | ||
85 | newOwner, newGroup, recursive)); | 85 | newOwner, newGroup, recursive)); | ||
86 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | 86 | job->setUiDelegate(KIO::createDefaultJobUiDelegate()); | ||
87 | if (!(flags & HideProgressInfo)) { | 87 | if (!(flags & HideProgressInfo)) { | ||
88 | KIO::getJobTracker()->registerJob(job); | 88 | KIO::getJobTracker()->registerJob(job); | ||
89 | } | 89 | } | ||
90 | if (!(flags & NoPrivilegeExecution)) { | ||||
91 | job->d_func()->m_privilegeExecutionEnabled = true; | ||||
92 | job->d_func()->m_operationType = ChangeAttr; | ||||
93 | } | ||||
90 | return job; | 94 | return job; | ||
91 | } | 95 | } | ||
92 | }; | 96 | }; | ||
93 | 97 | | |||
94 | } // namespace KIO | 98 | } // namespace KIO | ||
95 | 99 | | |||
96 | using namespace KIO; | 100 | using namespace KIO; | ||
97 | 101 | | |||
▲ Show 20 Lines • Show All 128 Lines • ▼ Show 20 Line(s) | 207 | } else if (!m_bAutoSkipFiles) { | |||
226 | } | 230 | } | ||
227 | } | 231 | } | ||
228 | } | 232 | } | ||
229 | } | 233 | } | ||
230 | 234 | | |||
231 | /*qDebug() << "chmod'ing" << info.url | 235 | /*qDebug() << "chmod'ing" << info.url | ||
232 | << "to" << QString::number(info.permissions,8);*/ | 236 | << "to" << QString::number(info.permissions,8);*/ | ||
233 | KIO::SimpleJob *job = KIO::chmod(info.url, info.permissions); | 237 | KIO::SimpleJob *job = KIO::chmod(info.url, info.permissions); | ||
238 | job->setParentJob(q); | ||||
dfaure: Maybe all these if()s can be removed? I assume setParentJob just stores a pointer, we could do… | |||||
234 | // copy the metadata for acl and default acl | 239 | // copy the metadata for acl and default acl | ||
235 | const QString aclString = q->queryMetaData(QStringLiteral("ACL_STRING")); | 240 | const QString aclString = q->queryMetaData(QStringLiteral("ACL_STRING")); | ||
236 | const QString defaultAclString = q->queryMetaData(QStringLiteral("DEFAULT_ACL_STRING")); | 241 | const QString defaultAclString = q->queryMetaData(QStringLiteral("DEFAULT_ACL_STRING")); | ||
237 | if (!aclString.isEmpty()) { | 242 | if (!aclString.isEmpty()) { | ||
238 | job->addMetaData(QStringLiteral("ACL_STRING"), aclString); | 243 | job->addMetaData(QStringLiteral("ACL_STRING"), aclString); | ||
239 | } | 244 | } | ||
240 | if (!defaultAclString.isEmpty()) { | 245 | if (!defaultAclString.isEmpty()) { | ||
241 | job->addMetaData(QStringLiteral("DEFAULT_ACL_STRING"), defaultAclString); | 246 | job->addMetaData(QStringLiteral("DEFAULT_ACL_STRING"), defaultAclString); | ||
▲ Show 20 Lines • Show All 47 Lines • Show Last 20 Lines |
Maybe all these if()s can be removed? I assume setParentJob just stores a pointer, we could do this in all case --- it's less code, and just in case we need the parent job for something else later, it'll be available.