Commit 25ed22a4 authored by Holger Kaelberer's avatar Holger Kaelberer
Browse files

core: fix duplicate download at first run on desktop

On platforms where automatic downloads are enabled (desktop) we
triggered a second download of the voices from our 1st-run-dialog
leading to a race for the target download file.

Now voices are automatically registered later (in Window's
onCompleted()).
parent 468f800e
...@@ -210,12 +210,6 @@ int main(int argc, char *argv[]) ...@@ -210,12 +210,6 @@ int main(int argc, char *argv[])
// Update execution counter // Update execution counter
ApplicationSettings::getInstance()->setExeCount(ApplicationSettings::getInstance()->exeCount() + 1); ApplicationSettings::getInstance()->setExeCount(ApplicationSettings::getInstance()->exeCount() + 1);
// Register voices-resources for current locale, updates/downloads only if
// not prohibited by the settings
if(!DownloadManager::getInstance()->areVoicesRegistered())
DownloadManager::getInstance()->updateResource(DownloadManager::getInstance()
->getVoicesResourceForLocale(locale));
if(parser.isSet(clFullscreen)) { if(parser.isSet(clFullscreen)) {
isFullscreen = true; isFullscreen = true;
} }
......
...@@ -145,7 +145,7 @@ Window { ...@@ -145,7 +145,7 @@ Window {
+ ", dpi=" + Math.round(Screen.pixelDensity*25.4) + ", dpi=" + Math.round(Screen.pixelDensity*25.4)
+ ", sharedWritablePath=" + ApplicationInfo.getSharedWritablePath() + ", sharedWritablePath=" + ApplicationInfo.getSharedWritablePath()
+ ")"); + ")");
if (ApplicationSettings.exeCount == 1 && !ApplicationSettings.isKioskMode) { if (ApplicationSettings.exeCount === 1 && !ApplicationSettings.isKioskMode) {
// first run // first run
var dialog; var dialog;
dialog = Core.showMessageDialog( dialog = Core.showMessageDialog(
...@@ -175,7 +175,17 @@ Window { ...@@ -175,7 +175,17 @@ Window {
); );
} }
else { else {
checkWordset() // Register voices-resources for current locale, updates/downloads only if
// not prohibited by the settings
if (!DownloadManager.areVoicesRegistered())
if (DownloadManager.downloadResource(
DownloadManager.getVoicesResourceForLocale(ApplicationSettings.locale))) {
DownloadManager.downloadFinished.connect(function() {
checkWordset();
DownloadManager.downloadFinished.disconnect(arguments.callee);
});
} else
checkWordset()
if(changelog.isNewerVersion(ApplicationSettings.lastGCVersionRan, ApplicationInfo.GCVersionCode)) { if(changelog.isNewerVersion(ApplicationSettings.lastGCVersionRan, ApplicationInfo.GCVersionCode)) {
// display log between ApplicationSettings.lastGCVersionRan and ApplicationInfo.GCVersionCode // display log between ApplicationSettings.lastGCVersionRan and ApplicationInfo.GCVersionCode
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment