MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / createAndMakeWritable

Function createAndMakeWritable

src/loglist.cpp:378–392  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

376}
377
378bool 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
394bool setLogDirectory(const QString& dir)
395{

Callers 1

setLogDirectoryFunction · 0.85

Calls 3

QDirClass · 0.85
toStringMethod · 0.45
existsMethod · 0.45

Tested by

no test coverage detected