Minor cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@20443 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Axel Dörfler
2007-03-28 08:47:28 +00:00
parent e992122d94
commit 67fb7cd0ed
2 changed files with 32 additions and 32 deletions
+16 -20
View File
@@ -623,11 +623,9 @@ IconCache::GetWellKnownIcon(AutoLock<SimpleIconCache> *,
{
const WellKnowEntryList::WellKnownEntry *wellKnownEntry
= WellKnowEntryList::MatchEntry(model->NodeRef());
if (!wellKnownEntry)
return NULL;
IconCacheEntry *entry = NULL;
BString type("tracker/active_");
@@ -637,7 +635,7 @@ IconCache::GetWellKnownIcon(AutoLock<SimpleIconCache> *,
(*resultingOpenCache)->Lock();
source = kTrackerSupplied;
entry = fSharedCache.FindItem(type.String());
if (entry) {
entry = entry->ResolveIfAlias(&fSharedCache, entry);
@@ -646,7 +644,6 @@ IconCache::GetWellKnownIcon(AutoLock<SimpleIconCache> *,
}
if (!entry || !entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
// match up well known entries in the file system with specialized
// icons stored in Tracker's resources
int32 resid = -1;
@@ -654,76 +651,75 @@ IconCache::GetWellKnownIcon(AutoLock<SimpleIconCache> *,
case B_BOOT_DISK:
resid = kResBootVolumeIcon;
break;
case B_BEOS_DIRECTORY:
resid = kResBeosFolderIcon;
break;
case B_USER_DIRECTORY:
resid = kResHomeDirIcon;
break;
case B_BEOS_FONTS_DIRECTORY:
case B_COMMON_FONTS_DIRECTORY:
case B_USER_FONTS_DIRECTORY:
resid = kResFontDirIcon;
break;
case B_BEOS_APPS_DIRECTORY:
case B_APPS_DIRECTORY:
case B_USER_DESKBAR_APPS_DIRECTORY:
resid = kResAppsDirIcon;
break;
case B_BEOS_PREFERENCES_DIRECTORY:
case B_PREFERENCES_DIRECTORY:
case B_USER_DESKBAR_PREFERENCES_DIRECTORY:
resid = kResPrefsDirIcon;
break;
case B_USER_MAIL_DIRECTORY:
resid = kResMailDirIcon;
break;
case B_USER_QUERIES_DIRECTORY:
resid = kResQueryDirIcon;
break;
case B_COMMON_DEVELOP_DIRECTORY:
case B_USER_DESKBAR_DEVELOP_DIRECTORY:
resid = kResDevelopDirIcon;
break;
case B_USER_CONFIG_DIRECTORY:
resid = kResConfigDirIcon;
break;
case B_USER_PEOPLE_DIRECTORY:
resid = kResPersonDirIcon;
break;
case B_USER_DOWNLOADS_DIRECTORY:
resid = kResDownloadDirIcon;
break;
default:
return NULL;
}
entry = fSharedCache.AddItem(type.String());
BBitmap *bitmap = lazyBitmap->Get();
GetTrackerResources()->GetIconResource(resid, size, bitmap);
entry->SetIcon(lazyBitmap->Adopt(), kNormalIcon, size);
}
if (mode != kNormalIcon
&& entry->HaveIconBitmap(NORMAL_ICON_ONLY, size)) {
entry->ConstructBitmap(mode, size, lazyBitmap);
entry->SetIcon(lazyBitmap->Adopt(), mode, size);
}
ASSERT(entry->HaveIconBitmap(mode, size));
return entry;
}
+16 -12
View File
@@ -6759,12 +6759,12 @@ BPoseView::DragSelectionRect(BPoint startPoint, bool shouldExtend)
// clearing the selection could take a while so poll the mouse again
BPoint newMousePoint;
uint32 button;
uint32 button;
GetMouse(&newMousePoint, &button);
// draw initial empty selection rectangle
BRect lastselectionRect;
fSelectionRect = lastselectionRect = BRect(startPoint, startPoint - BPoint(1, 1));
BRect lastSelectionRect;
fSelectionRect = lastSelectionRect = BRect(startPoint, startPoint - BPoint(1, 1));
if (!fTransparentSelection) {
SetDrawingMode(B_OP_INVERT);
@@ -6813,19 +6813,23 @@ BPoseView::DragSelectionRect(BPoint startPoint, bool shouldExtend)
BRegion updateRegion1;
BRegion updateRegion2;
bool samewidth = fSelectionRect.Width() == lastselectionRect.Width();
bool sameheight = fSelectionRect.Height() == lastselectionRect.Height();
bool sameWidth = fSelectionRect.Width() == lastSelectionRect.Width();
bool sameHeight = fSelectionRect.Height() == lastSelectionRect.Height();
updateRegion1.Include(fSelectionRect);
updateRegion1.Exclude(lastselectionRect.InsetByCopy(samewidth ? 0 : 1, sameheight ? 0 : 1));
updateRegion2.Include(lastselectionRect);
updateRegion2.Exclude(fSelectionRect.InsetByCopy(samewidth ? 0 : 1, sameheight ? 0 : 1));
updateRegion1.Exclude(lastSelectionRect.InsetByCopy(
sameWidth ? 0 : 1, sameHeight ? 0 : 1));
updateRegion2.Include(lastSelectionRect);
updateRegion2.Exclude(fSelectionRect.InsetByCopy(
sameWidth ? 0 : 1, sameHeight ? 0 : 1));
updateRegion1.Include(&updateRegion2);
BRect unionRect = fSelectionRect & lastselectionRect;
updateRegion1.Exclude(unionRect & BRect(-2000, startPoint.y, 2000, startPoint.y));
updateRegion1.Exclude(unionRect & BRect(startPoint.x, -2000, startPoint.x, 2000));
BRect unionRect = fSelectionRect & lastSelectionRect;
updateRegion1.Exclude(unionRect
& BRect(-2000, startPoint.y, 2000, startPoint.y));
updateRegion1.Exclude(unionRect
& BRect(startPoint.x, -2000, startPoint.x, 2000));
lastselectionRect = fSelectionRect;
lastSelectionRect = fSelectionRect;
Invalidate(&updateRegion1);
Window()->UpdateIfNeeded();