[PATCH 2/2] wpa_gui-qt4: tweak icon Makefile

Kel Modderman kel
Tue Nov 11 14:00:45 PST 2008


On Wednesday 12 November 2008 01:48:28 Jouni Malinen wrote:
> On Sun, Nov 09, 2008 at 09:03:49PM +1000, Kel Modderman wrote:
> > Output the xpm icons in more convenient location.
> 
> Thanks, applied.
> 
> By the way, the current code (or well, at least before this change and
> likely after) does not fully work in MinGW builds for Windows XP. The
> wpa_gui icon in the tray is "invisible" (i.e., its place is reserved in
> the tray, but the actually icon does not show up). Would you happen to
> have any idea what would be causing this and whether this could be fixed
> by building a different format of the icon or something similar?
> 

Please check to see if the SVG plugin was loaded, by looking for 'svg' in
the supported image type list using below patch.

On a deeper look, the win32 deployment guide [1] states that extra plugins
(such as for SVG) should be distributed with the application... I do not like
the sound of this very much, and guess you may not either.

However, I really would like to avoid using any other image format such as png
just for the sake of win32, perhaps the tray icon can be disabled for platforms
which do not have the SVG loader available at runtime? Added that to the patch
too for comment.

Thanks, Kel.

[1] http://doc.trolltech.com/4.4/deployment-windows.html#qt-plugins
---
--- a/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
+++ b/wpa_supplicant/wpa_gui-qt4/wpagui.cpp
@@ -20,6 +20,7 @@
 #include <cstdio>
 #include <QMessageBox>
 #include <QCloseEvent>
+#include <QImageReader>
 
 #include "wpagui.h"
 #include "dirent.h"
@@ -30,6 +31,13 @@
 WpaGui::WpaGui(QWidget *parent, const char *, Qt::WFlags)
 	: QMainWindow(parent)
 {
+	printf("Supported image types:");
+	for (int i = 0; i < QImageReader::supportedImageFormats().count(); ++i) {
+		QString type(QImageReader::supportedImageFormats().at(i));
+		printf(" %s", type.toAscii().constData());
+	}
+	printf("\n");
+
 	setupUi(this);
 
 	(void) statusBar();
@@ -90,7 +98,8 @@ WpaGui::WpaGui(QWidget *parent, const ch
 
 	parse_argv();
 
-	if (QSystemTrayIcon::isSystemTrayAvailable())
+	if (QSystemTrayIcon::isSystemTrayAvailable() &&
+	    QImageReader::supportedImageFormats().contains(QByteArray("svg")))
 		createTrayIcon(startInTray);
 	else
 		show();
---



More information about the Hostap mailing list