Changeset View
Changeset View
Standalone View
Standalone View
src/ioslaves/file/file.cpp
Show First 20 Lines • Show All 236 Lines • ▼ Show 20 Line(s) | 236 | if (!QFile::remove(path)) { | |||
---|---|---|---|---|---|
237 | execWithElevatedPrivilege(DEL, {path}, errno); | 237 | execWithElevatedPrivilege(DEL, {path}, errno); | ||
238 | } | 238 | } | ||
239 | } | 239 | } | ||
240 | 240 | | |||
241 | QT_STATBUF buff; | 241 | QT_STATBUF buff; | ||
242 | if (QT_LSTAT(QFile::encodeName(path).constData(), &buff) == -1) { | 242 | if (QT_LSTAT(QFile::encodeName(path).constData(), &buff) == -1) { | ||
243 | bool dirCreated = QDir().mkdir(path); | 243 | bool dirCreated = QDir().mkdir(path); | ||
244 | if (!dirCreated) { | 244 | if (!dirCreated) { | ||
245 | if (auto err = execWithElevatedPrivilege(MKDIR, {path}, errno)) { | 245 | if (auto err = execWithElevatedPrivilege(MKDIR, {path, permissions}, errno)) { | ||
246 | if (!err.wasCanceled()) { | 246 | if (!err.wasCanceled()) { | ||
247 | //TODO: add access denied & disk full (or another reasons) handling (into Qt, possibly) | 247 | //TODO: add access denied & disk full (or another reasons) handling (into Qt, possibly) | ||
248 | error(KIO::ERR_CANNOT_MKDIR, path); | 248 | error(KIO::ERR_CANNOT_MKDIR, path); | ||
249 | } | 249 | } | ||
250 | return; | 250 | return; | ||
251 | } | 251 | } | ||
252 | dirCreated = true; | 252 | dirCreated = true; | ||
253 | } | 253 | } | ||
▲ Show 20 Lines • Show All 964 Lines • Show Last 20 Lines |