19 uint64_t freeBytesAvailable = 0;
20 int replyStatus =
ST_OK;
21 QString replyMessage = tr(
"A new data directory will be created.");
26 while(parentDir.has_parent_path() && !
fs::exists(parentDir))
28 parentDir = parentDir.parent_path();
31 if (parentDirOld == parentDir)
34 parentDirOld = parentDir;
38 freeBytesAvailable = fs::space(parentDir).available;
41 if(fs::is_directory(dataDir))
43 QString separator =
"<code>" + QDir::toNativeSeparators(
"/") + tr(
"name") +
"</code>";
45 replyMessage = tr(
"Directory already exists. Add %1 if you intend to create a new directory here.").arg(separator);
48 replyMessage = tr(
"Path already exists, and is not a directory.");
51 }
catch (
const fs::filesystem_error&)
55 replyMessage = tr(
"Cannot create data directory here.");
57 Q_EMIT
reply(replyStatus, replyMessage, freeBytesAvailable);
void reply(int status, const QString &message, quint64 available)
virtual QString getPathToCheck()=0
static bool exists(const path &p)
fs::path QStringToPath(const QString &path)
Convert QString to OS specific boost path through UTF-8.
Path class wrapper to block calls to the fs::path(std::string) implicit constructor and the fs::path:...