[PATCH] Fix KApplication for non-gui apps

George Staikos staikos at kde.org
Thu Feb 17 14:48:05 GMT 2005


On Thursday 17 February 2005 05:13, Clarence Dang wrote:
> On Thu, 17 Feb 2005 01:40 pm, George Staikos wrote:
> >    This evening, on the second most lousy flight I've ever been on (Air
> > Canada can really suck sometimes), I got a chance to implement this patch
> > for KApplication that Lars and I (well, mostly Lars) came up with.  It
> > should fix the problems with creating a pixmap in non-gui mode.  It seems
> > to be binary compatible, but it needs testing on different platforms. 
> > Any comments?
>
> -  QPixmap aIconPixmap;
> -  QPixmap aMiniIconPixmap;
> +  mutable QPixmap *aIconPixmap;
> +  mutable QPixmap *aMiniIconPixmap;
> +  char unused[sizeof(QPixmap)*2 - sizeof(QPixmap*)*2];
>
> Aren't you making an assumption that the padding between the 2 QPixmap's is
> equal to that between the 2 QPixmap *'s?

   This is mostly the question.  Are there any alignment problems with this on 
platforms we target?  There are alternative approaches such as:

struct {
QPixmap foo, bar;
} justforadding;

char unused[sizeof(justforadding)*2 - sizeof(QPixmap*)*2];

If there's no alignment issue then we don't need it anyway.

-- 
George Staikos
KDE Developer				http://www.kde.org/
Staikos Computing Services Inc.		http://www.staikos.net/




More information about the kde-core-devel mailing list