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