[PC-BSD Commits] r21557 - pcbsd-projects/PCDM

svn at pcbsd.org svn at pcbsd.org
Fri Feb 15 15:20:00 PST 2013


Author: kenmoore
Date: 2013-02-15 23:20:00 +0000 (Fri, 15 Feb 2013)
New Revision: 21557

Modified:
   pcbsd-projects/PCDM/main.cpp
Log:
Turn on a debug timer to see where the slowdowns are for PCDM startup times



Modified: pcbsd-projects/PCDM/main.cpp
===================================================================
--- pcbsd-projects/PCDM/main.cpp	2013-02-15 21:42:43 UTC (rev 21556)
+++ pcbsd-projects/PCDM/main.cpp	2013-02-15 23:20:00 UTC (rev 21557)
@@ -4,6 +4,7 @@
 #include <QDesktopWidget>
 #include <QFile>
 #include <QSplashScreen>
+#include <QTime>
 #include <QDebug>
 
 #include "pcdm-gui.h"
@@ -15,9 +16,12 @@
 
 int main(int argc, char *argv[])
 {
-  int returnCode = 0;  
+  int returnCode = 0;
+  QTime clock;
+  clock.start();
   Backend::checkLocalDirs();  // Create and fill "/usr/local/share/PCDM" if needed
   Backend::openLogFile("/usr/local/share/PCDM/PCDM.log");  
+  qDebug() << "Backend Checks Finished:" << QString::number(clock.elapsed())+" ms";
   //Check for the flag to try and auto-login
   bool ALtriggered = FALSE;
   if(QString(argv[1]) == "-AutoLogin"){ ALtriggered=TRUE; }
@@ -27,7 +31,7 @@
   QString confFile = "/usr/local/share/PCDM/pcdm.conf";
   if(!QFile::exists(confFile)){ confFile = ":samples/pcdm.conf"; }
   Config::loadConfigFile(confFile);
-
+  qDebug() << "Config File Loaded:" << QString::number(clock.elapsed())+" ms";
   // Startup the main application
   QApplication a(argc,argv); 
   
@@ -37,7 +41,7 @@
     splash.setPixmap( QPixmap(Config::splashscreen()) ); //load the splashscreen file
   }
   splash.show();
-
+  qDebug() << "SplashScreen Started:" << QString::number(clock.elapsed())+" ms";
   //Initialize the xprocess
   XProcess desktop;
   
@@ -59,9 +63,8 @@
 	splash.close();
 	goodAL=TRUE; //flag this as a good login to skip the GUI
     }
-
   }
-  
+  qDebug() << "AutoLogin Finished:" << QString::number(clock.elapsed())+" ms";
   if(!goodAL){
     // ------START THE PCDM GUI-------
     
@@ -83,11 +86,11 @@
       Backend::log("Could not find: " + appDir + "/i18n/PCDM_" + langCode + ".qm");
       langCode = "";
     }
+    qDebug() << "Translation Finished:" << QString::number(clock.elapsed())+" ms";
 
-
     Backend::log("Starting up PCDM interface");
     PCDMgui w;
-
+    qDebug() << "Main GUI Created:" << QString::number(clock.elapsed())+" ms";
     //Set the proper size on the Application
     //if(Theme::isFullScreen() ){
       w.setWindowFlags(w.windowFlags() ^Qt::WindowSoftkeysVisibleHint);
@@ -114,6 +117,7 @@
     
     w.show();
     splash.finish(&w);
+    qDebug() << "Starting GUI:" << QString::number(clock.elapsed())+" ms";
     returnCode = a.exec();
     Backend::startXSession();
   }  // end of PCDM GUI running



More information about the Commits mailing list