Ticket #5231: partition_patch.diff

File partition_patch.diff, 1.7 KB (added by sil2100, 14 years ago)

Patch for this ticket + removal of unnecessary debugging output

  • InstalledPackageInfo.cpp

     
    213213    // Try to remove all entries that are present in the list
    214214    for (i = 0; i < count; i++) {
    215215        iter = static_cast<BString *>(fInstalledItems.ItemAt(count - i - 1));
    216         fprintf(stderr, "Removing: %s (%ld/%ld)\n", iter->String(), i, count);
    217216        ret = entry.SetTo(iter->String());
    218217        if (ret == B_BUSY) {
    219218            // The entry's directory is locked - wait a few cycles for it to
     
    235234            return fStatus;
    236235        }
    237236
    238         fprintf(stderr, "...we continue\n");
    239 
    240237        if (entry.Exists() && entry.Remove() != B_OK) {
    241             fprintf(stderr, "\n%s\n", strerror(ret));
    242238            fStatus = B_ERROR;
    243239            return fStatus;
    244240        }
  • PackageView.cpp

     
    603603        }
    604604        else if (prof->path_type == P_USER_PATH) {
    605605            BString name;
     606            bool defaultPathSet = false;
    606607            char sizeString[32], volumeName[B_FILE_NAME_LENGTH];
    607608            BVolumeRoster roster;
    608609            BDirectory mountPoint;
    609610
    610611            while (roster.GetNextVolume(&volume) != B_BAD_VALUE) {
    611612                if (volume.IsReadOnly() ||
     613                        !volume.IsPersistent() ||
    612614                        volume.GetRootDirectory(&mountPoint) != B_OK)
    613615                    continue;
    614616
     
    625627                item = new BMenuItem(name.String(), temp);
    626628                item->SetTarget(this);
    627629                fDestination->AddItem(item);
     630
     631                // The first volume becomes the default element
     632                if (!defaultPathSet) {
     633                    item->SetMarked(true);
     634                    fCurrentPath.SetTo(path.Path());
     635                    defaultPathSet = true;
     636                }
    628637            }
    629638
    630639            fDestField->SetEnabled(true);