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

List:       kde-commits
Subject:    KDE/kdebase/workspace/kcontrol/access
From:       Andreas Kling <kling () impul ! se>
Date:       2006-09-20 20:38:32
Message-ID: 1158784712.740777.6814.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 586879 by kling:

Don't try to QApplication::exit() from a QApplication subclass constructor.
Fixes an issue with `kaccess' not exiting even though setup fails.


 M  +4 -22     kaccess.cpp  
 M  +1 -0      kaccess.h  
 M  +26 -0     main.cpp  


--- trunk/KDE/kdebase/workspace/kcontrol/access/kaccess.cpp #586878:586879
@@ -97,28 +97,6 @@
   : KUniqueApplication(allowStyles, GUIenabled),
   overlay(0), wm(0, KWinModule::INFO_DESKTOP),_player(Phonon::AccessibilityCategory)
 {
-  // verify the Xlib has matching XKB extension
-  int major = XkbMajorVersion;
-  int minor = XkbMinorVersion;
-  if (!XkbLibraryVersion(&major, &minor))
-    {
-      kError() << "Xlib XKB extension does not match" << endl;
-      exit(-1);
-    }
-  kDebug() << "Xlib XKB extension major=" << major << " minor=" << minor << endl;
-
-  // verify the X server has matching XKB extension
-  // if yes, the XKB extension is initialized
-  int opcode_rtrn;
-  int error_rtrn;
-  if (!XkbQueryExtension(QX11Info::display(), &opcode_rtrn, &xkb_opcode, &error_rtrn,
-			 &major, &minor))
-    {
-      kError() << "X server has not matching XKB extension" << endl;
-      exit(-1);
-    }
-  kDebug() << "X server XKB extension major=" << major << " minor=" << minor << endl;
-
   _activeWindow = wm.activeWindow();
   connect(&wm, SIGNAL(activeWindowChanged(WId)), this, SLOT(activeWindowChanged(WId)));
 
@@ -917,3 +895,7 @@
 
    requestedFeatures = features;
 }
+
+void KAccessApp::setXkbOpcode(int opcode) {
+   xkb_opcode = opcode;
+}
--- trunk/KDE/kdebase/workspace/kcontrol/access/kaccess.h #586878:586879
@@ -36,6 +36,7 @@
 
   int newInstance();
 
+  void setXkbOpcode(int opcode);
 
 protected:
 
--- trunk/KDE/kdebase/workspace/kcontrol/access/main.cpp #586878:586879
@@ -16,7 +16,33 @@
   if (!KAccessApp::start())
     return 0;
 
+  // verify the Xlib has matching XKB extension
+  int major = XkbMajorVersion;
+  int minor = XkbMinorVersion;
+  if (!XkbLibraryVersion(&major, &minor))
+    {
+      kError() << "Xlib XKB extension does not match" << endl;
+      return 1;
+    }
+  kDebug() << "Xlib XKB extension major=" << major << " minor=" << minor << endl;
+
+  // we need an application object for QX11Info
   KAccessApp app;
+
+  // verify the X server has matching XKB extension
+  // if yes, the XKB extension is initialized
+  int opcode_rtrn;
+  int error_rtrn;
+  int xkb_opcode;
+  if (!XkbQueryExtension(QX11Info::display(), &opcode_rtrn, &xkb_opcode, &error_rtrn,
+			 &major, &minor))
+    {
+      kError() << "X server has not matching XKB extension" << endl;
+      return 1;
+    }
+  kDebug() << "X server XKB extension major=" << major << " minor=" << minor << endl;
+
+  app.setXkbOpcode(xkb_opcode);
   app.disableSessionManagement();
   return app.exec();
 }
[prev in list] [next in list] [prev in thread] [next in thread] 

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