* Return a zero width and empty destination string when there's no destination dir. Fixes #7462 +alpha3

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41801 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Alexandre Deckner 2011-05-29 01:05:18 +00:00
parent 63d46f24e2
commit d797e0629c
1 changed files with 9 additions and 4 deletions

View File

@ -681,11 +681,16 @@ BStatusView::Draw(BRect updateRect)
BString
BStatusView::_DestinationString(float* _width)
{
BString buffer(B_TRANSLATE("To: %dir"));
buffer.ReplaceFirst("%dir", fDestDir);
if (fDestDir.Length() > 0) {
BString buffer(B_TRANSLATE("To: %dir"));
buffer.ReplaceFirst("%dir", fDestDir);
*_width = ceilf(StringWidth(buffer.String()));
return buffer;
*_width = ceilf(StringWidth(buffer.String()));
return buffer;
} else {
*_width = 0;
return BString();
}
}