Revert "Revert "added error message if settings initalizion failed""

This reverts commit f3ff40385d.
This commit is contained in:
fourtf
2019-10-05 16:40:04 +02:00
parent 37ceeb3945
commit b64e2e9b70
4 changed files with 40 additions and 10 deletions
+8 -6
View File
@@ -11,6 +11,8 @@
#include "common/Modes.hpp"
#include "util/CombinePath.hpp"
using namespace std::literals;
namespace chatterino {
Paths *Paths::instance = nullptr;
@@ -22,7 +24,7 @@ Paths::Paths()
this->initAppFilePathHash();
this->initCheckPortable();
this->initAppDataDirectory();
this->initRootDirectory();
this->initSubDirectories();
}
@@ -76,7 +78,7 @@ void Paths::initCheckPortable()
combinePath(QCoreApplication::applicationDirPath(), "portable"));
}
void Paths::initAppDataDirectory()
void Paths::initRootDirectory()
{
assert(this->portable_.is_initialized());
@@ -95,8 +97,8 @@ void Paths::initAppDataDirectory()
QStandardPaths::writableLocation(QStandardPaths::AppDataLocation);
if (path.isEmpty())
{
throw std::runtime_error(
"Error finding writable location for settings");
throw std::runtime_error("Could not create directory \""s +
path.toStdString() + "\"");
}
// create directory Chatterino2 instead of chatterino on windows because the
@@ -123,8 +125,8 @@ void Paths::initSubDirectories()
if (!QDir().mkpath(path))
{
throw std::runtime_error(
"Error creating appdata path %appdata%/chatterino/" + name);
throw std::runtime_error("Could not create directory \""s +
path.toStdString() + "\"");
}
return path;