Skip to content

Commit

Permalink
fix(core): fix docset storage not created in portable build
Browse files Browse the repository at this point in the history
Regression from b7d7e0a.
  • Loading branch information
trollixx committed Oct 20, 2018
1 parent 25a2227 commit d34d7b5
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/libs/core/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@

#include <QCoreApplication>
#include <QDir>
#include <QFileInfo>
#include <QSettings>
#include <QStandardPaths>
#include <QUrl>
Expand Down Expand Up @@ -160,10 +161,20 @@ void Settings::load()
#else
docsetPath = QStringLiteral("docsets");
#endif
QDir().mkpath(docsetPath);
}
settings->endGroup();

// Create the docset storage directory if it doesn't exist.
const QFileInfo fi(docsetPath);
if (!fi.exists()) {
// TODO: Report QDir::mkpath() errors.
if (fi.isRelative()) {
QDir().mkpath(QCoreApplication::applicationDirPath() + "/" + docsetPath);
} else {
QDir().mkpath(docsetPath);
}
}

settings->beginGroup(GroupState);
windowGeometry = settings->value(QStringLiteral("window_geometry")).toByteArray();
verticalSplitterGeometry = settings->value(QStringLiteral("splitter_geometry")).toByteArray();
Expand Down

0 comments on commit d34d7b5

Please sign in to comment.