Francois Gouget : winemenubuilder: Improve traces.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Jan 3 06:37:37 CST 2006


Module: wine
Branch: refs/heads/master
Commit: 6f0ff1496629233e66adecdf2a4c1a8d07ab75e0
URL:    http://source.winehq.org/git/?p=wine.git;a=commit;h=6f0ff1496629233e66adecdf2a4c1a8d07ab75e0

Author: Francois Gouget <fgouget at codeweavers.com>
Date:   Tue Jan  3 12:09:47 2006 +0100

winemenubuilder: Improve traces.
Add some traces to make it easier to debug icon generation problems.

---

 programs/winemenubuilder/winemenubuilder.c |   19 ++++++++++++++-----
 1 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/programs/winemenubuilder/winemenubuilder.c b/programs/winemenubuilder/winemenubuilder.c
index 3823142..50fd615 100644
--- a/programs/winemenubuilder/winemenubuilder.c
+++ b/programs/winemenubuilder/winemenubuilder.c
@@ -162,7 +162,10 @@ static BOOL SaveIconResAsXPM(const BITMA
         return FALSE;
 
     if (!(fXPMFile = fopen(szXPMFileName, "w")))
+    {
+        WINE_TRACE("unable to open '%s' for writing: %s\n", szXPMFileName, strerror(errno));
         return FALSE;
+    }
 
     i = WideCharToMultiByte(CP_UNIXCP, 0, commentW, -1, NULL, 0, NULL, NULL);
     comment = malloc(i);
@@ -361,7 +364,10 @@ static int ExtractFromICO(LPCWSTR szFile
 
     filename = wine_get_unix_file_name(szFileName);
     if (!(fICOFile = fopen(filename, "r")))
+    {
+        WINE_TRACE("unable to open '%s' for reading: %s\n", filename, strerror(errno));
         goto error1;
+    }
 
     if (fread(&iconDir, sizeof (ICONDIR), 1, fICOFile) != 1)
         goto error2;
@@ -487,15 +493,18 @@ static char *extract_icon( LPCWSTR path,
     if (!iconsdir)
     {
         WCHAR path[MAX_PATH];
-
-        if (GetTempPathW(MAX_PATH, path)) iconsdir = wine_get_unix_file_name(path);
+        if (GetTempPathW(MAX_PATH, path))
+            iconsdir = wine_get_unix_file_name(path);
+        if (!iconsdir)
+        {
+            WINE_TRACE("no IconsDir\n");
+            return NULL;  /* No icon created */
+        }
     }
-
-    if (!iconsdir)
-        return NULL;  /* No icon created */
     
     if (!*iconsdir)
     {
+        WINE_TRACE("icon generation disabled\n");
         HeapFree(GetProcessHeap(), 0, iconsdir);
         return NULL;  /* No icon created */
     }




More information about the wine-cvs mailing list