Coding style fixes

This commit is contained in:
Humdinger
2014-01-29 13:03:06 +01:00
parent 4c56a102ca
commit 02d8dd1561
+55 -52
View File
@@ -85,48 +85,48 @@ static const bigtime_t kChangesPulseInterval = 150000;
GrepWindow::GrepWindow(BMessage* message) GrepWindow::GrepWindow(BMessage* message)
: BWindow(BRect(0, 0, 1, 1), NULL, B_DOCUMENT_WINDOW, 0), : BWindow(BRect(0, 0, 1, 1), NULL, B_DOCUMENT_WINDOW, 0),
fSearchText(NULL), fSearchText(NULL),
fSearchResults(NULL), fSearchResults(NULL),
fMenuBar(NULL), fMenuBar(NULL),
fFileMenu(NULL), fFileMenu(NULL),
fNew(NULL), fNew(NULL),
fOpen(NULL), fOpen(NULL),
fClose(NULL), fClose(NULL),
fQuit(NULL), fQuit(NULL),
fActionMenu(NULL), fActionMenu(NULL),
fSelectAll(NULL), fSelectAll(NULL),
fSearch(NULL), fSearch(NULL),
fTrimSelection(NULL), fTrimSelection(NULL),
fCopyText(NULL), fCopyText(NULL),
fSelectInTracker(NULL), fSelectInTracker(NULL),
fOpenSelection(NULL), fOpenSelection(NULL),
fPreferencesMenu(NULL), fPreferencesMenu(NULL),
fRecurseLinks(NULL), fRecurseLinks(NULL),
fRecurseDirs(NULL), fRecurseDirs(NULL),
fSkipDotDirs(NULL), fSkipDotDirs(NULL),
fCaseSensitive(NULL), fCaseSensitive(NULL),
fEscapeText(NULL), fEscapeText(NULL),
fTextOnly(NULL), fTextOnly(NULL),
fInvokePe(NULL), fInvokePe(NULL),
fShowLinesMenuitem(NULL), fShowLinesMenuitem(NULL),
fHistoryMenu(NULL), fHistoryMenu(NULL),
fEncodingMenu(NULL), fEncodingMenu(NULL),
fUTF8(NULL), fUTF8(NULL),
fShiftJIS(NULL), fShiftJIS(NULL),
fEUC(NULL), fEUC(NULL),
fJIS(NULL), fJIS(NULL),
fShowLinesCheckbox(NULL), fShowLinesCheckbox(NULL),
fButton(NULL), fButton(NULL),
fGrepper(NULL), fGrepper(NULL),
fOldPattern(""), fOldPattern(""),
fModel(new (nothrow) Model()), fModel(new (nothrow) Model()),
fLastNodeMonitorEvent(system_time()), fLastNodeMonitorEvent(system_time()),
fChangesIterator(NULL), fChangesIterator(NULL),
fChangesPulse(NULL), fChangesPulse(NULL),
fFilePanel(NULL) fFilePanel(NULL)
{ {
if (fModel == NULL) if (fModel == NULL)
return; return;
@@ -189,7 +189,7 @@ void GrepWindow::MenusEnded()
} }
void GrepWindow::MessageReceived(BMessage *message) void GrepWindow::MessageReceived(BMessage* message)
{ {
switch (message->what) { switch (message->what) {
case MSG_NEW_WINDOW: case MSG_NEW_WINDOW:
@@ -421,7 +421,7 @@ GrepWindow::_SetWindowTitle()
void void
GrepWindow::_CreateMenus() GrepWindow::_CreateMenus()
{ {
fMenuBar = new BMenuBar(BRect(0,0,1,1), "menubar"); fMenuBar = new BMenuBar(BRect(0, 0, 1, 1), "menubar");
fFileMenu = new BMenu(B_TRANSLATE("File")); fFileMenu = new BMenu(B_TRANSLATE("File"));
fActionMenu = new BMenu(B_TRANSLATE("Actions")); fActionMenu = new BMenu(B_TRANSLATE("Actions"));
@@ -454,7 +454,8 @@ GrepWindow::_CreateMenus()
B_TRANSLATE("Open selection"), new BMessage(MSG_OPEN_SELECTION), 'O'); B_TRANSLATE("Open selection"), new BMessage(MSG_OPEN_SELECTION), 'O');
fSelectInTracker = new BMenuItem( fSelectInTracker = new BMenuItem(
B_TRANSLATE("Show files in Tracker"), new BMessage(MSG_SELECT_IN_TRACKER), 'K'); B_TRANSLATE("Show files in Tracker"),
new BMessage(MSG_SELECT_IN_TRACKER), 'K');
fCopyText = new BMenuItem( fCopyText = new BMenuItem(
B_TRANSLATE("Copy text to clipboard"), new BMessage(MSG_COPY_TEXT), 'B'); B_TRANSLATE("Copy text to clipboard"), new BMessage(MSG_COPY_TEXT), 'B');
@@ -466,7 +467,8 @@ GrepWindow::_CreateMenus()
B_TRANSLATE("Look in sub-folders"), new BMessage(MSG_RECURSE_DIRS)); B_TRANSLATE("Look in sub-folders"), new BMessage(MSG_RECURSE_DIRS));
fSkipDotDirs = new BMenuItem( fSkipDotDirs = new BMenuItem(
B_TRANSLATE("Skip folders starting with a dot"), new BMessage(MSG_SKIP_DOT_DIRS)); B_TRANSLATE("Skip folders starting with a dot"),
new BMessage(MSG_SKIP_DOT_DIRS));
fCaseSensitive = new BMenuItem( fCaseSensitive = new BMenuItem(
B_TRANSLATE("Case-sensitive"), new BMessage(MSG_CASE_SENSITIVE)); B_TRANSLATE("Case-sensitive"), new BMessage(MSG_CASE_SENSITIVE));
@@ -584,13 +586,13 @@ GrepWindow::_LayoutViews()
float menubarWidth, menubarHeight = 20; float menubarWidth, menubarHeight = 20;
fMenuBar->GetPreferredSize(&menubarWidth, &menubarHeight); fMenuBar->GetPreferredSize(&menubarWidth, &menubarHeight);
BBox *background = new BBox( BBox* background = new BBox(
BRect(0, menubarHeight + 1, 2, menubarHeight + 2), B_EMPTY_STRING, BRect(0, menubarHeight + 1, 2, menubarHeight + 2), B_EMPTY_STRING,
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP, B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP, B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
B_PLAIN_BORDER); B_PLAIN_BORDER);
BScrollView *scroller = new BScrollView( BScrollView* scroller = new BScrollView(
"ScrollSearchResults", fSearchResults, B_FOLLOW_ALL_SIDES, "ScrollSearchResults", fSearchResults, B_FOLLOW_ALL_SIDES,
B_FULL_UPDATE_ON_RESIZE, true, true, B_NO_BORDER); B_FULL_UPDATE_ON_RESIZE, true, true, B_NO_BORDER);
@@ -647,7 +649,7 @@ GrepWindow::_TileIfMultipleWindows()
be_app->Unlock(); be_app->Unlock();
if (windowCount > 1) if (windowCount > 1)
MoveBy(20,20); MoveBy(20, 20);
} }
BScreen screen(this); BScreen screen(this);
@@ -658,7 +660,7 @@ GrepWindow::_TileIfMultipleWindows()
|| windowFrame.top > screenFrame.bottom || windowFrame.top > screenFrame.bottom
|| windowFrame.right < screenFrame.left || windowFrame.right < screenFrame.left
|| windowFrame.bottom < screenFrame.top) || windowFrame.bottom < screenFrame.top)
MoveTo(50,50); MoveTo(50, 50);
} }
@@ -976,7 +978,7 @@ GrepWindow::_OnNodeMonitorEvent(BMessage* message)
#endif #endif
} }
TRACE_NM("path: %s\n", path.String()); TRACE_NM("path: %s\n", path.String());
//message->PrintToStream(); // message->PrintToStream();
break; break;
} }
@@ -1102,7 +1104,7 @@ GrepWindow::_OnReportResult(BMessage* message)
void void
GrepWindow::_OnReportError(BMessage *message) GrepWindow::_OnReportError(BMessage* message)
{ {
const char* buf; const char* buf;
if (message->FindString("error", &buf) == B_OK) if (message->FindString("error", &buf) == B_OK)
@@ -1250,7 +1252,7 @@ GrepWindow::_OnInvokeItem()
// Get the line number. // Get the line number.
// only this level has line numbers // only this level has line numbers
if (level == 1) { if (level == 1) {
BStringItem *str = dynamic_cast<BStringItem*>(item); BStringItem* str = dynamic_cast<BStringItem*>(item);
if (str != NULL) { if (str != NULL) {
lineNum = atol(str->Text()); lineNum = atol(str->Text());
// fortunately, atol knows when to stop the conversion // fortunately, atol knows when to stop the conversion
@@ -1562,7 +1564,7 @@ GrepWindow::_OnOpenPanelCancel()
void void
GrepWindow::_OnSelectAll(BMessage *message) GrepWindow::_OnSelectAll(BMessage* message)
{ {
BMessenger messenger(fSearchResults); BMessenger messenger(fSearchResults);
messenger.SendMessage(B_SELECT_ALL); messenger.SendMessage(B_SELECT_ALL);
@@ -1595,6 +1597,7 @@ GrepWindow::_ModelChanged()
_SavePrefs(); _SavePrefs();
} }
bool bool
GrepWindow::_OpenInPe(const entry_ref &ref, int32 lineNum) GrepWindow::_OpenInPe(const entry_ref &ref, int32 lineNum)
{ {
@@ -1677,7 +1680,7 @@ GrepWindow::_OpenFoldersInTracker(BList* folderList)
bool bool
GrepWindow::_AreAllFoldersOpenInTracker(BList *folderList) GrepWindow::_AreAllFoldersOpenInTracker(BList* folderList)
{ {
// Compare the folders we want open in Tracker to // Compare the folders we want open in Tracker to
// the actual Tracker windows currently open. // the actual Tracker windows currently open.