From f5f351c570708f4ca923eeecee483874e673a277 Mon Sep 17 00:00:00 2001 From: Bertram Date: Wed, 21 Oct 2009 23:11:50 +0200 Subject: Made the skip updates (-u) and set custom data path (-d) startup options work again, even separately. Be aware, that skiping the updates download does still the already downloaded data files. If needed, a "don't use updates" options should be made to explicitely get temporary rid of updates files. --- src/main.cpp | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index c05ce193..761f825d 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -920,12 +920,6 @@ int main(int argc, char *argv[]) if (state != oldstate) { - // Load updates after exiting the update state - if (oldstate == STATE_UPDATE) - { - loadUpdates(); - } - //printf("State change: %d to %d\n", oldstate, state); oldstate = state; @@ -1025,19 +1019,20 @@ int main(int argc, char *argv[]) break; case STATE_UPDATE: + + // Determine which source to use for the update host + if (!options.updateHost.empty()) + updateHost = options.updateHost; + else + updateHost = loginData.updateHost; + setUpdatesDir(); + if (options.skipUpdate) { state = STATE_LOAD_DATA; } else { - // Determine which source to use for the update host - if (!options.updateHost.empty()) - updateHost = options.updateHost; - else - updateHost = loginData.updateHost; - - setUpdatesDir(); logger->log("State: UPDATE"); currentDialog = new UpdaterWindow(updateHost, homeDir + "/" + updatesDir); @@ -1047,7 +1042,10 @@ int main(int argc, char *argv[]) case STATE_LOAD_DATA: logger->log("State: LOAD DATA"); - // Add customdata directory + // Load the updates downloaded so far... + loadUpdates(); + + // Also add customdata directory ResourceManager::getInstance()->searchAndAddArchives( "customdata/", "zip", -- cgit v1.2.3-70-g09d2