309 | | if (mflog == "") |
| 311 | if (logOutput) |
| 312 | { |
| 313 | QFileInfo testFile(mflog); |
| 314 | if (testFile.exists()) |
| 315 | { |
| 316 | // If the file or directory is not writable, disable logging |
| 317 | if (!testFile.isWritable()) |
| 318 | { |
| 319 | VERBOSE(VB_IMPORTANT, |
| 320 | QString("Invalid mythfilldatabase log path: %1 " |
| 321 | "is not writable.") |
| 322 | .arg(mflog)); |
| 323 | logOutput = false; |
| 324 | } |
| 325 | else if (testFile.isDir()) |
| 326 | { |
| 327 | mflog.append("/mythfilldatabase.log"); |
| 328 | // Although the directory is writable, the new filename may |
| 329 | // refer to an unwritable file |
| 330 | testFile.setFile(mflog); |
| 331 | if ((testFile.exists()) && (!testFile.isWritable())) |
| 332 | { |
| 333 | VERBOSE(VB_IMPORTANT, |
| 334 | QString("Invalid mythfilldatabase log path: %1 " |
| 335 | "is not writable.") |
| 336 | .arg(mflog)); |
| 337 | logOutput = false; |
| 338 | } |
| 339 | } |
| 340 | } |
| 341 | else |
| 342 | { |
| 343 | // The log file does not yet exist. Verify the directory exists |
| 344 | // and is writable. |
| 345 | QString dir = testFile.dirPath(); |
| 346 | testFile.setFile(dir); |
| 347 | if ((!testFile.exists()) || (!testFile.isWritable())) |
| 348 | { |
| 349 | VERBOSE(VB_IMPORTANT, |
| 350 | QString("Invalid mythfilldatabase log path: %1") |
| 351 | .arg(mflog)); |
| 352 | logOutput = false; |
| 353 | } |
| 354 | } |
| 355 | } |
| 356 | |
| 357 | if (logOutput) |
| 358 | command = QString("%1 %2 >>%3 2>&1").arg(mfpath).arg(mfarg).arg(mflog); |
| 359 | else |