[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdelibs/kdeui
From:       Wilco Greven <greven () kde ! org>
Date:       2005-11-08 16:22:00
Message-ID: 1131466920.970019.12496.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 478972 by wgreven:

Get rid of Q3CString. 
Use XInternAtoms instead of two calls to XInternAtom to save a roundtrip.


 M  +11 -5     ksharedpixmap.cpp  


--- trunk/KDE/kdelibs/kdeui/ksharedpixmap.cpp #478971:478972
@@ -19,7 +19,6 @@
 #include <qpixmap.h>
 #include <qwindowdefs.h>
 #include <qwidget.h>
-#include <q3cstring.h>
 
 #ifdef Q_WS_X11
 #include <qx11info_x11.h>
@@ -28,6 +27,7 @@
 #include <ksharedpixmap.h>
 #include <kdebug.h>
 #include <stdlib.h> // for abs
+#include <stdio.h>
 
 #include <X11/Xlib.h>
 
@@ -81,10 +81,16 @@
 
 void KSharedPixmap::init()
 {
-    d->pixmap = XInternAtom(QX11Info::display(), "PIXMAP", false);
-    Q3CString atom;
-    atom.sprintf("target prop for window %lx", static_cast<unsigned long int>(winId()));
-    d->target = XInternAtom(QX11Info::display(), atom.data(), false);
+    char pixmapName[] = "PIXMAP";
+    char targetName[50];
+    snprintf(targetName, 49, "target prop for window %lx", 
+             static_cast<unsigned long>(winId()));
+    char *names[2] = { pixmapName, targetName };
+    
+    Atom atoms[2];
+    XInternAtoms(QX11Info::display(), names, 2, False, atoms);
+    d->pixmap = atoms[0];
+    d->target = atoms[1];
     d->selection = None;
 }
 
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic