[haiku-commits] r40371 - haiku/trunk/src/apps/installer

  • From: philippe.houdoin@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Mon, 7 Feb 2011 19:37:02 +0100 (CET)

Author: phoudoin
Date: 2011-02-07 19:37:02 +0100 (Mon, 07 Feb 2011)
New Revision: 40371
Changeset: http://dev.haiku-os.org/changeset/40371

Modified:
   haiku/trunk/src/apps/installer/WorkerThread.cpp
Log:
Boot partition is not a valid target either, at least not until
installing on it don't leads to warranted crash...


Modified: haiku/trunk/src/apps/installer/WorkerThread.cpp
===================================================================
--- haiku/trunk/src/apps/installer/WorkerThread.cpp     2011-02-07 13:04:00 UTC 
(rev 40370)
+++ haiku/trunk/src/apps/installer/WorkerThread.cpp     2011-02-07 18:37:02 UTC 
(rev 40371)
@@ -643,14 +643,28 @@
        // TODO: After running DriveSetup and doing another scan, it would
        // be great to pick the partition which just appeared!
 
-       // Only BFS partitions are valid targets, but we want to display the
+       bool isBootPartition = false;
+       if (partition->IsMounted()) {
+               BPath mountPoint;
+               partition->GetMountPoint(&mountPoint);
+               isBootPartition = strcmp(BOOT_PATH, mountPoint.Path()) == 0;
+       }
+
+       // Only non-boot BFS partitions are valid targets, but we want to 
display the
        // other partitions as well, in order not to irritate the user.
-       bool isValidTarget = partition->ContentType() != NULL
+       bool isValidTarget = isBootPartition == false
+               && partition->ContentType() != NULL
                && strcmp(partition->ContentType(), kPartitionTypeBFS) == 0;
 
        char label[255];
        char menuLabel[255];
        make_partition_label(partition, label, menuLabel, !isValidTarget);
+
+       printf("Partion: \"%s\" : isValidTarget = %s isBootPartition = %s\n",
+               menuLabel, isValidTarget ? "true" : "false",
+               isBootPartition ? "true" : "false");
+
+
        PartitionMenuItem* item = new 
PartitionMenuItem(partition->ContentName(),
                label, menuLabel, new BMessage(TARGET_PARTITION), 
partition->ID());
 


Other related posts:

  • » [haiku-commits] r40371 - haiku/trunk/src/apps/installer - philippe . houdoin