Patch by sil2100:

* Avoid showing read-only volumes as possible installation targets.
 * Mark the menu item for the first suitable volume that was found.
 * Removed no more needed debug output.

Fixes #5231. Thanks a lot!


git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36596 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Stephan Aßmus
2010-05-03 15:47:53 +00:00
parent c4697c01a9
commit 1edc8258ef
2 changed files with 14 additions and 11 deletions
@@ -213,7 +213,6 @@ InstalledPackageInfo::Uninstall()
// Try to remove all entries that are present in the list
for (i = 0; i < count; i++) {
iter = static_cast<BString *>(fInstalledItems.ItemAt(count - i - 1));
fprintf(stderr, "Removing: %s (%ld/%ld)\n", iter->String(), i, count);
ret = entry.SetTo(iter->String());
if (ret == B_BUSY) {
// The entry's directory is locked - wait a few cycles for it to
@@ -235,10 +234,7 @@ InstalledPackageInfo::Uninstall()
return fStatus;
}
fprintf(stderr, "...we continue\n");
if (entry.Exists() && entry.Remove() != B_OK) {
fprintf(stderr, "\n%s\n", strerror(ret));
fStatus = B_ERROR;
return fStatus;
}
+14 -7
View File
@@ -589,7 +589,7 @@ PackageView::_GroupChanged(int32 index)
}
}
if (item) {
if (item != NULL) {
item->SetMarked(true);
fCurrentPath.SetTo(path.Path());
}
@@ -600,17 +600,18 @@ PackageView::_GroupChanged(int32 index)
fDestination->AddItem(item);
fDestField->SetEnabled(true);
}
else if (prof->path_type == P_USER_PATH) {
} else if (prof->path_type == P_USER_PATH) {
BString name;
bool defaultPathSet = false;
char sizeString[32], volumeName[B_FILE_NAME_LENGTH];
BVolumeRoster roster;
BDirectory mountPoint;
while (roster.GetNextVolume(&volume) != B_BAD_VALUE) {
if (volume.IsReadOnly() ||
volume.GetRootDirectory(&mountPoint) != B_OK)
if (volume.IsReadOnly() || !volume.IsPersistent()
|| volume.GetRootDirectory(&mountPoint) != B_OK) {
continue;
}
if (path.SetTo(&mountPoint, NULL) != B_OK)
continue;
@@ -625,11 +626,17 @@ PackageView::_GroupChanged(int32 index)
item = new BMenuItem(name.String(), temp);
item->SetTarget(this);
fDestination->AddItem(item);
// The first volume becomes the default element
if (!defaultPathSet) {
item->SetMarked(true);
fCurrentPath.SetTo(path.Path());
defaultPathSet = true;
}
}
fDestField->SetEnabled(true);
}
else
} else
fDestField->SetEnabled(false);
}