| 376 | } |
| 377 | |
| 378 | bool createAndMakeWritable(const std::wstring& subPath) |
| 379 | { |
| 380 | QString const dataPath = qApp->property("dataPath").toString(); |
| 381 | QString fullPath = dataPath + "/" + QString::fromStdWString(subPath); |
| 382 | |
| 383 | if (!QDir(fullPath).exists() && !QDir().mkdir(fullPath)) { |
| 384 | QMessageBox::critical(nullptr, QObject::tr("Error"), |
| 385 | QObject::tr("Failed to create \"%1\". Your user " |
| 386 | "account probably lacks permission.") |
| 387 | .arg(fullPath)); |
| 388 | return false; |
| 389 | } else { |
| 390 | return true; |
| 391 | } |
| 392 | } |
| 393 | |
| 394 | bool setLogDirectory(const QString& dir) |
| 395 | { |
no test coverage detected