]> git.saurik.com Git - wxWidgets.git/blobdiff - src/unix/mimetype.cpp
switched back to old use of DrawBitmap for transparent bitmaps
[wxWidgets.git] / src / unix / mimetype.cpp
index 8130ffda6ee7db69aeb9287c3474c3f5c8efb169..aa0fc4f3de9be44e6b3f855612f38367773037e3 100644 (file)
@@ -560,8 +560,14 @@ void wxGNOMEIconHandler::GetMimeInfoRecords(wxMimeTypesManagerImpl *manager)
     }
 }
 
+#if wxUSE_GUI
+    #define WXUNUSED_UNLESS_GUI(p)  p
+#else
+    #define WXUNUSED_UNLESS_GUI(p)
+#endif
 
-bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
+bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype,
+                                 wxIcon * WXUNUSED_UNLESS_GUI(icon))
 {
     if ( !m_inited )
     {
@@ -581,8 +587,11 @@ bool wxGNOMEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
         icn = wxIcon(iconname);
     else
         icn = wxIcon(iconname, wxBITMAP_TYPE_ANY);
-    if (icn.Ok()) *icon = icn;
-    else return FALSE;
+    if ( !icn.Ok() )
+        return FALSE;
+
+    if ( icon )
+        *icon = icn;
 #else
     // helpful for testing in console mode
     wxLogDebug(_T("Found GNOME icon for '%s': '%s'\n"),
@@ -801,7 +810,8 @@ void wxKDEIconHandler::Init()
     m_inited = TRUE;
 }
 
-bool wxKDEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
+bool wxKDEIconHandler::GetIcon(const wxString& mimetype,
+                               wxIcon * WXUNUSED_UNLESS_GUI(icon))
 {
     if ( !m_inited )
     {
@@ -821,8 +831,12 @@ bool wxKDEIconHandler::GetIcon(const wxString& mimetype, wxIcon *icon)
         icn = wxIcon(iconname);
     else
         icn = wxIcon(iconname, wxBITMAP_TYPE_ANY);
-    if (icn.Ok()) *icon = icn;
-    else return FALSE;
+
+    if ( !icn.Ok() )
+        return FALSE;
+
+    if ( icon )
+        *icon = icn;
 #else
     // helpful for testing in console mode
     wxLogDebug(_T("Found KDE icon for '%s': '%s'\n"),