diff options
| -rw-r--r-- | updater/common.h | 14 | ||||
| -rw-r--r-- | updater/services.cpp | 10 | 
2 files changed, 18 insertions, 6 deletions
diff --git a/updater/common.h b/updater/common.h index 2387c94..890fa47 100644 --- a/updater/common.h +++ b/updater/common.h @@ -69,11 +69,23 @@ typedef struct UpdateInternal_tag {  struct UpdateList : OBJLIST<UpdateInternal> 
  {
  	UpdateList() : OBJLIST<UpdateInternal>(10) {}
 -	UpdateList(const UpdateList& upd) : OBJLIST<UpdateInternal>(10)
 +	UpdateList(const UpdateList& upd) : OBJLIST<UpdateInternal>(10, compareUrl)
  	{
  		for (int i=0; i<upd.getCount(); ++i)
  			insert(new UpdateInternal(upd[i]));
  	}
 +
 +	static int compareUrl(const UpdateInternal* p1, const UpdateInternal* p2)
 +	{ 
 +		if (!p1->update.szBetaVersionURL && !p2->update.szBetaVersionURL)
 +			return 0;
 +		else if (!p1->update.szBetaVersionURL && p2->update.szBetaVersionURL)
 +			return -1;
 +		else if (p1->update.szBetaVersionURL && !p2->update.szBetaVersionURL)
 +			return 1;
 +		else
 +			return _stricmp(p1->update.szBetaVersionURL, p2->update.szBetaVersionURL); 
 +	}
  };
  struct StrList : LIST<TCHAR>
 diff --git a/updater/services.cpp b/updater/services.cpp index 063a907..49b3c91 100644 --- a/updater/services.cpp +++ b/updater/services.cpp @@ -216,13 +216,13 @@ void CheckForUpdatesWorker(void *param) {  	if(options.use_xml_backend)	
      {
 -		if(UpdateXMLData(MC_PLUGINS)) {// prevent double error messages (in some cases)
 +		if (UpdateXMLData(MC_PLUGINS)) {// prevent double error messages (in some cases)
  			// iterate through the registered plugins
 -			if(!use_popup) PostMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Scanning plugins folder"), 0);
 +			if (!use_popup) PostMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Scanning plugins folder"), 0);
  			ScanPlugins(&fn_map, &update_list);
 -			if(UpdateXMLData(MC_LOCALIZATION)) {
 -				if(!use_popup) PostMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Scanning language packs"), 0);
 +			if (UpdateXMLData(MC_LOCALIZATION)) {
 +				if (!use_popup) PostMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Scanning language packs"), 0);
  				ScanLangpacks(&fn_map, &update_list);
  			}
 @@ -230,7 +230,7 @@ void CheckForUpdatesWorker(void *param) {  			UpdateFLIDs(update_list);
  		}
 -		if(!use_popup) PostMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Checking for updates"), 0);
 +		if (!use_popup) PostMessage(hwndProgress, WMU_SETMESSAGE, (WPARAM)TranslateT("Checking for updates"), 0);
  	}
  	UpdateList update_list2(update_list);
  | 
