[PC-BSD Commits] r20977 - pcbsd/current/src-qt4/pc-installgui

svn at pcbsd.org svn at pcbsd.org
Wed Jan 16 09:14:18 PST 2013


Author: kris
Date: 2013-01-16 17:14:18 +0000 (Wed, 16 Jan 2013)
New Revision: 20977

Modified:
   pcbsd/current/src-qt4/pc-installgui/backend.cpp
   pcbsd/current/src-qt4/pc-installgui/installer.cpp
Log:

Make the installer exit a bit more gracefully if no disk drives can be located



Modified: pcbsd/current/src-qt4/pc-installgui/backend.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/backend.cpp	2013-01-16 16:51:42 UTC (rev 20976)
+++ pcbsd/current/src-qt4/pc-installgui/backend.cpp	2013-01-16 17:14:18 UTC (rev 20977)
@@ -306,6 +306,8 @@
     if (p.waitForFinished()) {
         while (p.canReadLine()) {
             line = p.readLine();
+	    if ( line.isEmpty() ) 
+               continue;
             dev = line.simplified();
             dev.truncate(line.indexOf(":"));
 

Modified: pcbsd/current/src-qt4/pc-installgui/installer.cpp
===================================================================
--- pcbsd/current/src-qt4/pc-installgui/installer.cpp	2013-01-16 16:51:42 UTC (rev 20976)
+++ pcbsd/current/src-qt4/pc-installgui/installer.cpp	2013-01-16 17:14:18 UTC (rev 20977)
@@ -156,6 +156,14 @@
 void Installer::loadDiskInfo()
 {
    sysDisks = Scripts::Backend::hardDrives();
+   if ( sysDisks.empty() ) {
+      QMessageBox::critical(this, tr("PC-BSD Installer"),
+                                tr("Unable to detect any disk drives! The install will now exit."),
+                                QMessageBox::Ok,
+                                QMessageBox::Ok);
+      exit(1);
+   }
+
    //for (int i=0; i < sysDisks.count(); ++i) {
       // Make sure to only add the drives to the comboDiskList
    //   if ( sysDisks.at(i).at(0) == "DRIVE" )



More information about the Commits mailing list