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

svn at pcbsd.org svn at pcbsd.org
Fri Feb 15 15:56:42 PST 2013


Author: kenmoore
Date: 2013-02-15 23:56:41 +0000 (Fri, 15 Feb 2013)
New Revision: 21561

Modified:
   pcbsd-projects/PCDM/main.cpp
   pcbsd-projects/PCDM/pcdm-gui.cpp
Log:
Turn off all the timers in main, and turn on a bunch in the GUI creation process



Modified: pcbsd-projects/PCDM/main.cpp
===================================================================
--- pcbsd-projects/PCDM/main.cpp	2013-02-15 23:42:16 UTC (rev 21560)
+++ pcbsd-projects/PCDM/main.cpp	2013-02-15 23:56:41 UTC (rev 21561)
@@ -17,11 +17,11 @@
 int main(int argc, char *argv[])
 {
   int returnCode = 0;
-  QTime clock;
-  clock.start();
+  //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";
+  //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; }
@@ -86,11 +86,11 @@
       Backend::log("Could not find: " + appDir + "/i18n/PCDM_" + langCode + ".qm");
       langCode = "";
     }
-    qDebug() << "Translation Finished:" << QString::number(clock.elapsed())+" ms";
+    //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";
+    //qDebug() << "Main GUI Created:" << QString::number(clock.elapsed())+" ms";
     splash.finish(&w); //close the splash when the GUI starts up
     //Set the proper size on the Application
     //if(Theme::isFullScreen() ){
@@ -115,7 +115,7 @@
     QObject::connect( &w,SIGNAL(xHomeFound(QString)), &desktop,SLOT(setXHomeDir(QString)) );
     QObject::connect( &w,SIGNAL(xSessionStart()), &desktop,SLOT(startXSession()) );
     
-    qDebug() << "Showing GUI:" << QString::number(clock.elapsed())+" ms";
+    //qDebug() << "Showing GUI:" << QString::number(clock.elapsed())+" ms";
     w.show();
     returnCode = a.exec();
     Backend::startXSession();

Modified: pcbsd-projects/PCDM/pcdm-gui.cpp
===================================================================
--- pcbsd-projects/PCDM/pcdm-gui.cpp	2013-02-15 23:42:16 UTC (rev 21560)
+++ pcbsd-projects/PCDM/pcdm-gui.cpp	2013-02-15 23:56:41 UTC (rev 21561)
@@ -63,10 +63,12 @@
   //Set the application style sheet
   style.append(" "+ currentTheme->styleSheet() );
   this->setStyleSheet( style.simplified() );
+  qDebug() << "GUI Time: StyleSheet Set:" << QString::number(timer->elapsed()) + " ms";
   //get the default translation directory
   translationDir = QApplication::applicationDirPath() + "/i18n/";
   //Fill the translator
   m_translator = new QTranslator();
+  qDebug() << "GUI Time: Translator Loaded:" << QString::number(timer->elapsed()) + " ms";
   //Create the Toolbar
   toolbar = new QToolBar();
   //Add the Toolbar to the window
@@ -93,7 +95,7 @@
     else{ toolbar->setToolButtonStyle(Qt::ToolButtonIconOnly); } //default to icon only
     
     toolbar->setIconSize( currentTheme->itemIconSize("toolbar") ); //use theme size
-    
+    qDebug() << "GUI Time: Toolbar Created:" << QString::number(timer->elapsed()) + " ms";
   //Populate the Toolbar with items (starts at leftmost/topmost)
     //----Virtual Keyboard
     tmpIcon = currentTheme->itemIcon("vkeyboard");
@@ -101,27 +103,30 @@
     virtkeyboardButton = new QAction( QIcon(tmpIcon),tr("Virtual Keyboard"),this );
     toolbar->addAction(virtkeyboardButton);
     connect( virtkeyboardButton, SIGNAL(triggered()), this, SLOT(slotPushVirtKeyboard()) );
+    qDebug() << "GUI Time: VKeyboard Created:" << QString::number(timer->elapsed()) + " ms";
 
-
     //----Locale Switcher
     tmpIcon = currentTheme->itemIcon("locale");
     if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/language.png"; }
     localeButton = new QAction( QIcon(tmpIcon),tr("Locale"),this );
     toolbar->addAction(localeButton);
     connect( localeButton, SIGNAL(triggered()), this, SLOT(slotChangeLocale()) );
-
+    qDebug() << "GUI Time: Locale Created:" << QString::number(timer->elapsed()) + " ms";
+    
     //----Keyboard Layout Switcher
     tmpIcon = currentTheme->itemIcon("keyboard");
     if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/keyboard.png"; }
     keyboardButton = new QAction( QIcon(tmpIcon),tr("Keyboard Layout"),this );
     toolbar->addAction(keyboardButton);
     connect( keyboardButton, SIGNAL(triggered()), this, SLOT(slotChangeKeyboardLayout()) );
-
+    qDebug() << "GUI Time: Keyboard Created:" << QString::number(timer->elapsed()) + " ms";
+    
     //----Add a spacer
     QWidget* spacer = new QWidget();
     spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);
     toolbar->addWidget(spacer);
-
+    qDebug() << "GUI Time: Tool Spacer Created:" << QString::number(timer->elapsed()) + " ms";
+    
     //----System Shutdown/Restart
     tmpIcon = currentTheme->itemIcon("system");
     if(!QFile::exists(tmpIcon) || tmpIcon.isEmpty() ){ tmpIcon=":/images/system.png"; }
@@ -131,7 +136,8 @@
     systemMenu = new QMenu();
     toolbar->addWidget(systemButton);
     systemButton->setPopupMode( QToolButton::InstantPopup );
-
+    qDebug() << "GUI Time: System Created:" << QString::number(timer->elapsed()) + " ms";
+    
   //Create the grid layout
   QGridLayout* grid = new QGridLayout;
   //Populate the grid with items
@@ -147,7 +153,8 @@
                       currentTheme->itemLocation("header","rowspan"), \
                       currentTheme->itemLocation("header","colspan"), Qt::AlignCenter);
     }
-
+    qDebug() << "GUI Time: Header Created:" << QString::number(timer->elapsed()) + " ms";
+    
     //Username/Password/Login widget
     loginW = new LoginWidget;
     loginW->setUsernames(Backend::getSystemUsers()); //add in the detected users
@@ -173,7 +180,8 @@
     //Connect the signals/slots
     connect(loginW,SIGNAL(loginRequested(QString,QString)),this,SLOT(slotStartLogin(QString,QString)));
     connect(loginW,SIGNAL(escapePressed()),this,SLOT(slotShutdownComputer()));
-
+    qDebug() << "GUI Time: LoginW Created:" << QString::number(timer->elapsed()) + " ms";
+    
     //----Desktop Environment Switcher
     //Create the switcher
     deSwitcher = new FancySwitcher(this, !currentTheme->itemIsVertical("desktop") );
@@ -199,7 +207,8 @@
     grid->addWidget( deSwitcher, currentTheme->itemLocation("desktop","row"), \
                       currentTheme->itemLocation("desktop","col"), \
                       currentTheme->itemLocation("desktop","rowspan"), \
-                      currentTheme->itemLocation("desktop","colspan"), Qt::AlignCenter); 
+                      currentTheme->itemLocation("desktop","colspan"), Qt::AlignCenter);
+    qDebug() << "GUI Time: DEswitch Created:" << QString::number(timer->elapsed()) + " ms";
 
     //----WINDOW SPACERS
     QStringList spacers = currentTheme->getSpacers();
@@ -214,6 +223,7 @@
         grid->setColumnStretch(col,1);
       }
     }
+    qDebug() << "GUI Time: Spacers Created:" << QString::number(timer->elapsed()) + " ms";
 
   //Connect the grid to the Window
     QWidget* widget = new QWidget;
@@ -221,9 +231,11 @@
     this->setCentralWidget(widget);
     
   //Now translate the UI and set all the text
+  qDebug() << "GUI Time: Widget all Set:" << QString::number(timer->elapsed()) + " ms";
   retranslateUi();
+  qDebug() << "GUI Time: Translation Finished:" << QString::number(timer->elapsed()) + " ms";
   //Now make sure that the login widget has focus
-  loginW->setFocus();  
+  //loginW->setFocus();  
 
 }
 



More information about the Commits mailing list