create latte dir if missing when loading presets

--this is critical because it does not open Latte at
first run. The fix is just to make sure that "latte"
directory will be created in case there isnt already

BUG: 404762
pull/5/head
Michail Vourlakos 6 years ago
parent 2af8d6290a
commit 5a0948591e

@ -1083,6 +1083,12 @@ void LayoutManager::importPresets(bool includeDefault)
void LayoutManager::importPreset(int presetNo, bool newInstanceIfPresent)
{
QDir configDir(QDir::homePath() + "/.config");
if (!QDir(configDir.absolutePath() + "/latte").exists()) {
configDir.mkdir("latte");
}
QByteArray presetNameOrig = QString("preset" + QString::number(presetNo)).toUtf8();
QString presetPath = m_corona->kPackage().filePath(presetNameOrig);
QString presetName = Layout::layoutName(presetPath);

Loading…
Cancel
Save