# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1255078596 -7200
# Node ID 7d93d9bea9de39a00fa751a7578850ec1780b282
# Parent  aa57290fc6845230c0723d331248ef56cf2b1af6
shellext: InitMenuMaps: ignore template entry from menuDescList

This change is not fixing a specific bug (at least not as far as I
can see). It also doesn't fix the problem I found when building
the shell extension with mingw (Issue 624).

It just makes not much sense to go ask for the translation
of a menu entry having the empty string as its name.

There will be no key in the registry having the empty
string as its last component, so the registry lookup will
fail anyway (as it will ask for the UI text and help text
at the parent node of the translation keys in the registry).

Also essentially doing

   MenuDescMap[''] = ...

later on in that function (as before this change), doesn't
make much sense IMHO.

I see no code part that is expecting an entry under the empty
string in MenuDescMap anyway. And if it would, it would most
likely be a bug anyway.

diff --git a/win32/shellext/ContextMenu.cpp b/win32/shellext/ContextMenu.cpp
--- a/win32/shellext/ContextMenu.cpp
+++ b/win32/shellext/ContextMenu.cpp
@@ -198,6 +198,10 @@ void InitMenuMaps()
         for (std::size_t i = 0; i < sz; i++)
         {
             MenuDescription md = menuDescList[i];
+
+            if (md.name.size() == 0)
+                break;
+
             TDEBUG_TRACE("InitMenuMaps: adding " << md.name);
 
             // Look for translation of menu and help text

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to