mirror of
https://github.com/KDE/latte-dock.git
synced 2025-03-27 14:50:21 +03:00
IMPORTANT:fix first run initialization
--dont mess the old migrating process during startup with a new user that uses Latte for first time. This is a very important step during startup otherwise the entire Latte experiences instability. BUG:417886 FIXED-IN:0.9.9
This commit is contained in:
parent
6be5819143
commit
e5111b4716
@ -79,8 +79,8 @@ bool Importer::updateOldConfiguration()
|
||||
}
|
||||
}
|
||||
|
||||
m_manager->corona()->universalSettings()->setCurrentLayoutName(i18n("My Layout"));
|
||||
m_manager->corona()->universalSettings()->setVersion(2);
|
||||
m_manager->corona()->universalSettings()->setCurrentLayoutName(i18n("My Layout"));
|
||||
|
||||
return true;
|
||||
}
|
||||
|
@ -81,25 +81,33 @@ void Manager::load()
|
||||
{
|
||||
m_presetsPaths.clear();
|
||||
|
||||
QDir layoutsDir(QDir::homePath() + "/.config/latte");
|
||||
bool firstRun = !layoutsDir.exists();
|
||||
|
||||
int configVer = m_corona->universalSettings()->version();
|
||||
qDebug() << "Universal Settings version : " << configVer;
|
||||
|
||||
if (configVer < 2 && QFile(QDir::homePath() + "/.config/lattedockrc").exists()) {
|
||||
qDebug() << "Latte must update its configuration...";
|
||||
m_importer->updateOldConfiguration();
|
||||
importPresets(false);
|
||||
} else if (!QFile(QDir::homePath() + "/.config/lattedockrc").exists()) {
|
||||
//startup create what is necessary....
|
||||
QDir layoutDir(QDir::homePath() + "/.config/latte");
|
||||
if (firstRun) {
|
||||
m_corona->universalSettings()->setVersion(2);
|
||||
m_corona->universalSettings()->setCurrentLayoutName(i18n("My Layout"));
|
||||
|
||||
if (!layoutDir.exists()) {
|
||||
//startup create what is necessary....
|
||||
if (!layoutsDir.exists()) {
|
||||
QDir(QDir::homePath() + "/.config").mkdir("latte");
|
||||
}
|
||||
|
||||
newLayout(i18n("My Layout"));
|
||||
importPresets(false);
|
||||
m_corona->universalSettings()->setCurrentLayoutName(i18n("My Layout"));
|
||||
} else if (configVer < 2 && !firstRun) {
|
||||
m_corona->universalSettings()->setVersion(2);
|
||||
|
||||
bool isOlderVersion = m_importer->updateOldConfiguration();
|
||||
if (isOlderVersion) {
|
||||
qDebug() << "Latte is updating its older configuration...";
|
||||
importPresets(false);
|
||||
} else {
|
||||
m_corona->universalSettings()->setCurrentLayoutName(i18n("My Layout"));
|
||||
}
|
||||
}
|
||||
|
||||
//! Check if the multiple-layouts hidden file is present, add it if it isnt
|
||||
|
@ -139,6 +139,7 @@ void UniversalSettings::setVersion(int ver)
|
||||
}
|
||||
|
||||
m_version = ver;
|
||||
qDebug() << "Universal Settings version updated to : " << m_version;
|
||||
|
||||
emit versionChanged();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user