[PC-BSD Commits] r2780 - in pcbsd: branches/7.0/SystemUpdater trunk/SystemUpdater

svn at pcbsd.org svn at pcbsd.org
Tue Sep 16 13:13:03 PDT 2008


Author: kris
Date: 2008-09-16 13:13:03 -0700 (Tue, 16 Sep 2008)
New Revision: 2780

Modified:
   pcbsd/branches/7.0/SystemUpdater/SystemUpdater.cpp
   pcbsd/branches/7.0/SystemUpdater/SystemUpdater.h
   pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp
   pcbsd/branches/7.0/SystemUpdater/updaterDialog.cpp
   pcbsd/branches/7.0/SystemUpdater/updaterDialog.h
   pcbsd/trunk/SystemUpdater/SystemUpdater.cpp
   pcbsd/trunk/SystemUpdater/SystemUpdater.h
   pcbsd/trunk/SystemUpdater/UpdaterTray.cpp
   pcbsd/trunk/SystemUpdater/updaterDialog.cpp
   pcbsd/trunk/SystemUpdater/updaterDialog.h
Log:

Fixed several bugs in the SystemUpdater which caused crashes to occur when closing windows, or when doing updates and not having brought up the status dialog



Modified: pcbsd/branches/7.0/SystemUpdater/SystemUpdater.cpp
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/SystemUpdater.cpp	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/branches/7.0/SystemUpdater/SystemUpdater.cpp	2008-09-16 20:13:03 UTC (rev 2780)
@@ -13,8 +13,8 @@
 #include "ui_SystemUpdater.h"
 #include <Q3ListViewItemIterator>
 #include <Q3CheckListItem>
+#include <QtGui>
 
-
 void systemUpdater::programInit()
 {
     // Clear and setup our system update list box
@@ -49,9 +49,10 @@
 }
 
 
-void systemUpdater::closeEvent( QCloseEvent * e )
+void systemUpdater::closeEvent( QCloseEvent *event )
 {
     // Reimplementation to grab window manager close call
+    event->ignore();
     slotClose();
 }
 

Modified: pcbsd/branches/7.0/SystemUpdater/SystemUpdater.h
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/SystemUpdater.h	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/branches/7.0/SystemUpdater/SystemUpdater.h	2008-09-16 20:13:03 UTC (rev 2780)
@@ -24,10 +24,12 @@
     QStringList getListOfCheckedItems( void );
     QStringList getListOfCheckedPBIItems();
 
+protected:
+    void closeEvent( QCloseEvent *event );
+
 public slots:
     void programInit();
     void slotClose();
-    void closeEvent( QCloseEvent * e );
     void slotUserClickedCheckSysUpdates();
     void setTextAvailSysUpdates( QString &text );
     void setTextLastSysUpdateDate( QString &text );

Modified: pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/branches/7.0/SystemUpdater/UpdaterTray.cpp	2008-09-16 20:13:03 UTC (rev 2780)
@@ -1121,7 +1121,10 @@
 
 
            QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok );
-           UpdaterStatusDialog->hide();
+           if ( UpdaterStatusDialog->isShown() )
+           {
+             UpdaterStatusDialog->hide();
+           }
 
 	   programstatus = CHECK_FAILED;
            // Try the update check again
@@ -1193,15 +1196,20 @@
       if ( ! startNewInstall )
       {
         // The updates are finished!
+        // Bring back up the progress window, since it needs to processevents
+        UpdaterStatusDialog->show();
 
         if ( requiresSysReboot == 1) 
         {
            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("Updates successfully installed! Your system will need to reboot to finish."), QMessageBox::Ok);
         } else {
-           QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("Updates successfully installed!"), QMessageBox::Ok );
+           QMessageBox::information( 0, tr("Online Update"), tr("Updates successfully installed!"), QMessageBox::Ok );
         }
 
-           UpdaterStatusDialog->hide();
+           if ( UpdaterStatusDialog->isShown() )
+           {
+             UpdaterStatusDialog->hide();
+           }
            programstatus = CHECK_FAILED;
            // Check for updates again now
 	   slotStartUpdateCheck();
@@ -1912,9 +1920,15 @@
       {
         // The updates are finished!
 
+          // Bring back up the progress window, since it needs to processevents
+          UpdaterStatusDialog->show();
 
+
            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("PBI Upgrades finished!"), QMessageBox::Ok );
-           UpdaterStatusDialog->hide();
+           if ( UpdaterStatusDialog->isShown() )
+           {
+             UpdaterStatusDialog->hide();
+           }
            // Check for updates again now
            programstatus = SYSTEM_UP2DATE;
            pbistatus = PBI_UPDATED;

Modified: pcbsd/branches/7.0/SystemUpdater/updaterDialog.cpp
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/updaterDialog.cpp	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/branches/7.0/SystemUpdater/updaterDialog.cpp	2008-09-16 20:13:03 UTC (rev 2780)
@@ -13,6 +13,7 @@
 #include "ui_updaterDialog.h"
 #include <Q3ListView>
 #include <Q3ListViewItemIterator>
+#include <QtGui>
 
 void updaterStatus::programInit()
 {
@@ -29,8 +30,9 @@
 }
 
 
-void updaterStatus::closeEvent( QCloseEvent * e )
+void updaterStatus::closeEvent( QCloseEvent *event )
 {
+    event->ignore();
     slotPushClose();
 }
 

Modified: pcbsd/branches/7.0/SystemUpdater/updaterDialog.h
===================================================================
--- pcbsd/branches/7.0/SystemUpdater/updaterDialog.h	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/branches/7.0/SystemUpdater/updaterDialog.h	2008-09-16 20:13:03 UTC (rev 2780)
@@ -35,10 +35,11 @@
     void slotJobUpdateProcessedSize(KJob*, qulonglong size);
     void slotJobUpdateSpeed(KJob*, unsigned long speed);
 
+protected:
+    void closeEvent( QCloseEvent *event );
 
 private slots:
     void slotPushClose();
-    void closeEvent( QCloseEvent * e );
 
 private:
     KIO::filesize_t totalSize;

Modified: pcbsd/trunk/SystemUpdater/SystemUpdater.cpp
===================================================================
--- pcbsd/trunk/SystemUpdater/SystemUpdater.cpp	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/trunk/SystemUpdater/SystemUpdater.cpp	2008-09-16 20:13:03 UTC (rev 2780)
@@ -13,8 +13,8 @@
 #include "ui_SystemUpdater.h"
 #include <Q3ListViewItemIterator>
 #include <Q3CheckListItem>
+#include <QtGui>
 
-
 void systemUpdater::programInit()
 {
     // Clear and setup our system update list box
@@ -49,9 +49,10 @@
 }
 
 
-void systemUpdater::closeEvent( QCloseEvent * e )
+void systemUpdater::closeEvent( QCloseEvent *event )
 {
     // Reimplementation to grab window manager close call
+    event->ignore();
     slotClose();
 }
 

Modified: pcbsd/trunk/SystemUpdater/SystemUpdater.h
===================================================================
--- pcbsd/trunk/SystemUpdater/SystemUpdater.h	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/trunk/SystemUpdater/SystemUpdater.h	2008-09-16 20:13:03 UTC (rev 2780)
@@ -24,10 +24,12 @@
     QStringList getListOfCheckedItems( void );
     QStringList getListOfCheckedPBIItems();
 
+protected:
+    void closeEvent( QCloseEvent *event );
+
 public slots:
     void programInit();
     void slotClose();
-    void closeEvent( QCloseEvent * e );
     void slotUserClickedCheckSysUpdates();
     void setTextAvailSysUpdates( QString &text );
     void setTextLastSysUpdateDate( QString &text );

Modified: pcbsd/trunk/SystemUpdater/UpdaterTray.cpp
===================================================================
--- pcbsd/trunk/SystemUpdater/UpdaterTray.cpp	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/trunk/SystemUpdater/UpdaterTray.cpp	2008-09-16 20:13:03 UTC (rev 2780)
@@ -1121,7 +1121,10 @@
 
 
            QMessageBox::critical( this->contextMenu(), tr("Online Update"), tr("An error occured while downloading. Please check your connection or try again later."), QMessageBox::Ok );
-           UpdaterStatusDialog->hide();
+           if ( UpdaterStatusDialog->isShown() )
+           {
+             UpdaterStatusDialog->hide();
+           }
 
 	   programstatus = CHECK_FAILED;
            // Try the update check again
@@ -1193,15 +1196,20 @@
       if ( ! startNewInstall )
       {
         // The updates are finished!
+        // Bring back up the progress window, since it needs to processevents
+        UpdaterStatusDialog->show();
 
         if ( requiresSysReboot == 1) 
         {
            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("Updates successfully installed! Your system will need to reboot to finish."), QMessageBox::Ok);
         } else {
-           QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("Updates successfully installed!"), QMessageBox::Ok );
+           QMessageBox::information( 0, tr("Online Update"), tr("Updates successfully installed!"), QMessageBox::Ok );
         }
 
-           UpdaterStatusDialog->hide();
+           if ( UpdaterStatusDialog->isShown() )
+           {
+             UpdaterStatusDialog->hide();
+           }
            programstatus = CHECK_FAILED;
            // Check for updates again now
 	   slotStartUpdateCheck();
@@ -1912,9 +1920,15 @@
       {
         // The updates are finished!
 
+          // Bring back up the progress window, since it needs to processevents
+          UpdaterStatusDialog->show();
 
+
            QMessageBox::information( this->contextMenu(), tr("Online Update"), tr("PBI Upgrades finished!"), QMessageBox::Ok );
-           UpdaterStatusDialog->hide();
+           if ( UpdaterStatusDialog->isShown() )
+           {
+             UpdaterStatusDialog->hide();
+           }
            // Check for updates again now
            programstatus = SYSTEM_UP2DATE;
            pbistatus = PBI_UPDATED;

Modified: pcbsd/trunk/SystemUpdater/updaterDialog.cpp
===================================================================
--- pcbsd/trunk/SystemUpdater/updaterDialog.cpp	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/trunk/SystemUpdater/updaterDialog.cpp	2008-09-16 20:13:03 UTC (rev 2780)
@@ -13,6 +13,7 @@
 #include "ui_updaterDialog.h"
 #include <Q3ListView>
 #include <Q3ListViewItemIterator>
+#include <QtGui>
 
 void updaterStatus::programInit()
 {
@@ -29,8 +30,9 @@
 }
 
 
-void updaterStatus::closeEvent( QCloseEvent * e )
+void updaterStatus::closeEvent( QCloseEvent *event )
 {
+    event->ignore();
     slotPushClose();
 }
 

Modified: pcbsd/trunk/SystemUpdater/updaterDialog.h
===================================================================
--- pcbsd/trunk/SystemUpdater/updaterDialog.h	2008-09-16 19:00:10 UTC (rev 2779)
+++ pcbsd/trunk/SystemUpdater/updaterDialog.h	2008-09-16 20:13:03 UTC (rev 2780)
@@ -35,10 +35,11 @@
     void slotJobUpdateProcessedSize(KJob*, qulonglong size);
     void slotJobUpdateSpeed(KJob*, unsigned long speed);
 
+protected:
+    void closeEvent( QCloseEvent *event );
 
 private slots:
     void slotPushClose();
-    void closeEvent( QCloseEvent * e );
 
 private:
     KIO::filesize_t totalSize;



More information about the Commits mailing list