Author: axeld Date: 2009-11-05 13:37:43 +0100 (Thu, 05 Nov 2009) New Revision: 33894 Changeset: http://dev.haiku-os.org/changeset/33894/haiku Modified: haiku/trunk/src/kits/tracker/InfoWindow.cpp haiku/trunk/src/kits/tracker/Utilities.cpp Log: * The InfoWindow's name text view is now using DisallowFilenameKeys() as well. * DisallowFilenameKeys() no longer forbids the ':', as there is no reason to do so. * Automatic whitespace cleanup. Modified: haiku/trunk/src/kits/tracker/InfoWindow.cpp =================================================================== --- haiku/trunk/src/kits/tracker/InfoWindow.cpp 2009-11-05 11:40:33 UTC (rev 33893) +++ haiku/trunk/src/kits/tracker/InfoWindow.cpp 2009-11-05 12:37:43 UTC (rev 33894) @@ -1853,16 +1853,19 @@ fTitleEditView = new BTextView(textFrame, "text_editor", textRect, &font, 0, B_FOLLOW_ALL, B_WILL_DRAW); fTitleEditView->SetText(fModel->Name()); + DisallowFilenameKeys(fTitleEditView); + // Reset the width of the text rect textRect = fTitleEditView->TextRect(); textRect.right = fTitleEditView->LineWidth() + 20; fTitleEditView->SetTextRect(textRect); fTitleEditView->SetWordWrap(false); // Add filter for catching B_RETURN and B_ESCAPE key's - fTitleEditView->AddFilter(new BMessageFilter(B_KEY_DOWN, AttributeView::TextViewFilter)); + fTitleEditView->AddFilter( + new BMessageFilter(B_KEY_DOWN, AttributeView::TextViewFilter)); - BScrollView *scrollView = new BScrollView("BorderView", - fTitleEditView, 0, 0, false, false, B_PLAIN_BORDER); + BScrollView *scrollView = new BScrollView("BorderView", fTitleEditView, + 0, 0, false, false, B_PLAIN_BORDER); AddChild(scrollView); fTitleEditView->SelectAll(); fTitleEditView->MakeFocus(); Modified: haiku/trunk/src/kits/tracker/Utilities.cpp =================================================================== --- haiku/trunk/src/kits/tracker/Utilities.cpp 2009-11-05 11:40:33 UTC (rev 33893) +++ haiku/trunk/src/kits/tracker/Utilities.cpp 2009-11-05 12:37:43 UTC (rev 33894) @@ -91,7 +91,7 @@ { char ch; uint32 result = seed; - + while((ch = *string++) != 0) { result = (result << 7) ^ (result >> 24); result ^= ch; @@ -129,7 +129,7 @@ int32 testVersion; if (stream->Read(&testKey, sizeof(uint32)) <= 0 - || stream->Read(&testVersion, sizeof(int32)) <=0) + || stream->Read(&testVersion, sizeof(int32)) <=0) return false; return testKey == key && testVersion == version; @@ -139,7 +139,6 @@ void DisallowFilenameKeys(BTextView *textView) { - textView->DisallowChar(':'); textView->DisallowChar('/'); } @@ -473,7 +472,7 @@ * "from" is always transparent, "to" opaque. */ -void +void FadeRGBA32Horizontal(uint32 *bits, int32 width, int32 height, int32 from, int32 to) { // check parameters @@ -507,7 +506,7 @@ * "from" is always transparent, "to" opaque. */ -void +void FadeRGBA32Vertical(uint32 *bits, int32 width, int32 height, int32 from, int32 to) { // check parameters @@ -723,7 +722,7 @@ loc.x = bounds.left + (2 - eInfo.left); break; } - + case B_ALIGN_CENTER: { float width = StringWidth(Text()); @@ -731,7 +730,7 @@ loc.x = center - (width/2); break; } - + case B_ALIGN_RIGHT: { float width = StringWidth(Text()); @@ -906,7 +905,7 @@ parent->DrawString(truncatedLabel.String()); parent->MovePenTo(loc); - parent->SetHighColor(ShiftMenuBackgroundColor(B_DISABLED_LABEL_TINT)); + parent->SetHighColor(ShiftMenuBackgroundColor(B_DISABLED_LABEL_TINT)); parent->DrawString(truncatedLabel.String()); parent->PopState(); @@ -1390,7 +1389,7 @@ // avoids using the BAppFileInfo API when retrieving the // app signature -- the call is expensive because by default // the resource fork is scanned to read the attribute - + #ifdef B_APP_FILE_INFO_IS_FAST BAppFileInfo appFileInfo(file); return appFileInfo.GetSignature(result); @@ -1436,7 +1435,7 @@ // } // } // -// // try again with R5 icons +// // try again with R5 icons // attrName = size == B_LARGE_ICON ? kAttrLargeIcon : kAttrMiniIcon; // type = size == B_LARGE_ICON ? LARGE_ICON_TYPE : MINI_ICON_TYPE; // @@ -1533,7 +1532,7 @@ } -status_t +status_t PositionPassingMenuItem::Invoke(BMessage *message) { if (!Menu()) @@ -1612,7 +1611,7 @@ score = 0; break; } - + bool wordStart = k == 0 || isspace(text[k - 1]); if (wordStart) score++; @@ -1623,7 +1622,7 @@ if (match[j - 1] == text[k - 1]) score += 0.7; } - + score += 1.f / (k + 1); k++; }