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[])
// Update execution counter
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)) {
isFullscreen = true;
}
......
......@@ -145,7 +145,7 @@ Window {
+ ", dpi=" + Math.round(Screen.pixelDensity*25.4)
+ ", sharedWritablePath=" + ApplicationInfo.getSharedWritablePath()
+ ")");
if (ApplicationSettings.exeCount == 1 && !ApplicationSettings.isKioskMode) {
if (ApplicationSettings.exeCount === 1 && !ApplicationSettings.isKioskMode) {
// first run
var dialog;
dialog = Core.showMessageDialog(
......@@ -175,6 +175,16 @@ Window {
);
}
else {
// 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)) {
......
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