[KDE-Darwin] kdebase/kcontrol/background patch

Benjamin Reed ranger at befunk.com
Sat Jan 3 20:17:27 GMT 2004


IceFox wrote:

>  Went through the background kcontrol module and created a patch for the OS X
> project.  One this is that Qt provides a desktop class
> 
> http://doc.trolltech.com/3.3/qdesktopwidget.html
> 
> which can be used to obtain the number of screens and the current desktop so
> are the kwin/x11 calls even needed?
> 
> I have forwarded this to whom I think is the current author get get it
> approved.

Sounds like a question for kde-core-devel.

Despite the link to 3.3, this exists in 3.2 (and maybe earlier) too.  Is 
there a reason to be using Xlib calls for determining the number and 
default screen, rather than QDesktopWidget::primaryScreen() and 
numScreens()?

Index: bgadvanced.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/background/bgadvanced.cpp,v
retrieving revision 1.11
diff -u -3 -p -r1.11 bgadvanced.cpp
--- bgadvanced.cpp	20 Oct 2003 20:29:14 -0000	1.11
+++ bgadvanced.cpp	3 Jan 2004 19:04:17 -0000
@@ -31,6 +31,7 @@
  #include <qslider.h>
  #include <qspinbox.h>
  #include <qwhatsthis.h>
+#include <qapplication.h>

  #include <kconfig.h>
  #include <kcolorbutton.h>
@@ -44,15 +45,22 @@
  #include "bgadvanced.h"
  #include "bgadvanced_ui.h"

+#ifdef Q_WS_X11
  #include <X11/Xlib.h>
+#endif

  /**** BGAdvancedDialog ****/

  static QCString desktopConfigname()
  {
      int desktop=0;
+#ifdef Q_WS_X11
      if (qt_xdisplay())
          desktop = DefaultScreen(qt_xdisplay());
+#else
+    desktop = QApplication::desktop()->primaryScreen();
+#endif
+
      QCString name;
      if (desktop == 0)
          name = "kdesktoprc";

-- 
Benjamin Reed a.k.a. Ranger Rick -- http://ranger.befunk.com/
gpg: 6401 D02A A35F 55E9 D7DD  71C5 52EF A366 D3F6 65FE
* porthos grumbles ... stinking virus writers
<slackd> it's not so much the virus writers out there as it is the
   high-quality virus-reading software people have installed today

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 253 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-core-devel/attachments/20040103/9ca93df4/attachment.sig>


More information about the kde-core-devel mailing list