Bug 581758 - use simple QApplication instead of nsQAppInstance for static sQAppInstance. r=dougt
authorOleg Romashin <romaxa@gmail.com>
Wed, 28 Jul 2010 18:05:08 -0700
changeset 48343 7be6a577f698b2e925cda6a723a29dc41f2c1158
parent 48342 2900644a71c6d4810d079456a472c25d58a8fe8a
child 48344 69c18f83cf5d20e94127468a864e3240d58ec135
push id14685
push userdougt@mozilla.com
push dateThu, 29 Jul 2010 04:04:15 +0000
treeherdermozilla-central@b099bad53068 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdougt
bugs581758
milestone2.0b3pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 581758 - use simple QApplication instead of nsQAppInstance for static sQAppInstance. r=dougt
toolkit/xre/nsQAppInstance.cpp
toolkit/xre/nsQAppInstance.h
--- a/toolkit/xre/nsQAppInstance.cpp
+++ b/toolkit/xre/nsQAppInstance.cpp
@@ -39,31 +39,26 @@
 #include "nsQAppInstance.h"
 #include <QApplication>
 #include "prenv.h"
 
 // declared in nsAppRunner.cpp
 extern int    gArgc;
 extern char **gArgv;
 
-nsQAppInstance *nsQAppInstance::sQAppInstance = NULL;
+QApplication *nsQAppInstance::sQAppInstance = NULL;
 int nsQAppInstance::sQAppRefCount = 0;
 
-nsQAppInstance::nsQAppInstance(int gArgc, char** gArgv)
-  : QApplication(gArgc, gArgv)
-{
-}
-
 void nsQAppInstance::AddRef(void) {
   if (qApp) return;
   if (!sQAppInstance) {
     const char *graphicsSystem = PR_GetEnv("MOZ_QT_GRAPHICSSYSTEM");
     if (graphicsSystem)
       QApplication::setGraphicsSystem(QString(graphicsSystem));
-    sQAppInstance = new nsQAppInstance(gArgc, gArgv);
+    sQAppInstance = new QApplication(gArgc, gArgv);
   }
   sQAppRefCount++;
 }
 
 void nsQAppInstance::Release(void) {
   if (sQAppInstance && !--sQAppRefCount) {
     delete sQAppInstance;
     sQAppInstance = NULL;
--- a/toolkit/xre/nsQAppInstance.h
+++ b/toolkit/xre/nsQAppInstance.h
@@ -36,21 +36,20 @@
  *
  * ***** END LICENSE BLOCK ***** */
 
 #ifndef nsQAppInstance_h
 #define nsQAppInstance_h
 
 #include <QApplication>
 
-class nsQAppInstance : public QApplication
+class nsQAppInstance
 {
 public:
   static void AddRef(void);
   static void Release(void);
 
 private:
-  nsQAppInstance(int gArgc, char** gArgv);
-  static nsQAppInstance *sQAppInstance;
+  static QApplication *sQAppInstance;
   static int sQAppRefCount;
 };
 
 #endif /* nsQAppInstance_h */