Add:graphics_qt_qpainter:Enable -qws switch optionally
authormartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 15 Sep 2011 15:48:50 +0000 (15:48 +0000)
committermartin-s <martin-s@ffa7fe5e-494d-0410-b361-a75ebd5db220>
Thu, 15 Sep 2011 15:48:50 +0000 (15:48 +0000)
git-svn-id: https://navit.svn.sourceforge.net/svnroot/navit/trunk@4783 ffa7fe5e-494d-0410-b361-a75ebd5db220

navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.cpp
navit/navit/graphics/qt_qpainter/graphics_qt_qpainter.h

index 61cb8a9..b6201b5 100644 (file)
@@ -614,7 +614,7 @@ static void draw_mode(struct graphics_priv *gr, enum draw_mode_num mode)
 static struct graphics_priv * overlay_new(struct graphics_priv *gr, struct graphics_methods *meth, struct point *p, int w, int h,int alpha, int wraparound);
 
 static int argc=1;
-static char *argv[]={(char *)"navit",NULL};
+static char *argv[]={(char *)"navit",NULL,NULL};
 
 static int
 fullscreen(struct window *win, int on)
@@ -958,7 +958,12 @@ static struct graphics_priv * graphics_qt_qpainter_new(struct navit *nav, struct
        else
                QApplication::setGraphicsSystem("raster");
 #endif
-
+       if ((attr=attr_search(attrs, NULL, attr_flags)))
+               ret->flags=attr->u.num;
+       if (ret->flags & 1) {
+               argv[1]="-qws";
+               argc++;
+       }
 #ifndef QT_QPAINTER_NO_APP
 #ifdef HAVE_QPE
        ret->app = new QPEApplication(argc, argv);
index e570842..7b784bd 100644 (file)
@@ -140,7 +140,7 @@ struct graphics_priv {
        struct font_priv * (*font_freetype_new)(void *meth);
        struct font_freetype_methods freetype_methods;
 #endif
-       int w,h;
+       int w,h,flags;
        struct navit* nav;
 };