[haiku-commits] haiku: hrev48969 - src/apps/text_search

  • From: waddlesplash@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 1 Apr 2015 19:36:31 +0200 (CEST)

hrev48969 adds 7 changesets to branch 'master'
old head: 94c4bba0add0c8176cfa6fb2e171366348a2a436
new head: 1e9f5f5be4c8419c2085f51c78c9ac02ef13377b
overview:
http://cgit.haiku-os.org/haiku/log/?qt=range&q=1e9f5f5be4c8+%5E94c4bba0add0

----------------------------------------------------------------------------

c28822e79919: TextSearch: RDEF tweaks.

05840b4c2a30: TextSearch: don't save the 'show contents' option.

Also get rid of the redundant menu option.

696f4254ca7f: TextSearch: trim trailing whitespace.

5f25359909a4: TextSearch: remove legacy Translation.h.

90ce3113565f: TextSearch: normalize copyright headers.

1b1789a711a4: TextSearch: use the layout API.

1e9f5f5be4c8: TextSearch: use BString-based searching instead of Grep-based.

Huge performance improvement. Fixes #9529.

[ Augustin Cavalier <waddlesplash@xxxxxxxxx> ]

----------------------------------------------------------------------------

17 files changed, 159 insertions(+), 615 deletions(-)
src/apps/text_search/ChangesIterator.cpp | 2 +-
src/apps/text_search/FileIterator.h | 19 +--
src/apps/text_search/GrepApp.cpp | 35 ++--
src/apps/text_search/GrepApp.h | 19 +--
src/apps/text_search/GrepListView.cpp | 25 +--
src/apps/text_search/GrepListView.h | 19 +--
src/apps/text_search/GrepWindow.cpp | 205 +++++------------------
src/apps/text_search/GrepWindow.h | 32 +---
src/apps/text_search/Grepper.cpp | 233 +++++++--------------------
src/apps/text_search/Grepper.h | 52 ++----
src/apps/text_search/InitialIterator.cpp | 35 ++--
src/apps/text_search/InitialIterator.h | 23 +--
src/apps/text_search/Model.cpp | 15 --
src/apps/text_search/Model.h | 36 +----
src/apps/text_search/TextSearch.cpp | 2 +-
src/apps/text_search/TextSearch.rdef | 7 +-
src/apps/text_search/Translation.h | 15 --

############################################################################

Commit: c28822e7991903e58241608d3394618c85066b3a
URL: http://cgit.haiku-os.org/haiku/commit/?id=c28822e79919
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 21:18:02 2015 UTC

TextSearch: RDEF tweaks.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/TextSearch.rdef
b/src/apps/text_search/TextSearch.rdef
index 3f23eae..dea522f 100644
--- a/src/apps/text_search/TextSearch.rdef
+++ b/src/apps/text_search/TextSearch.rdef
@@ -1,8 +1,9 @@
-
resource app_signature "application/x-vnd.Haiku.TextSearch";

resource app_name_catalog_entry "x-vnd.Haiku.TextSearch:System
name:TextSearch";

+resource app_flags B_SINGLE_LAUNCH;
+
resource app_version {
major = 5,
middle = 1,
@@ -15,7 +16,7 @@ resource app_version {
long_info = "Text search in Tracker, a GUI wrapper of /bin/grep."
};

-resource app_flags B_SINGLE_LAUNCH;
+resource(100, "BEOS:default_shortcut") "G";

resource file_types message {
"types" = "text",
@@ -44,5 +45,3 @@ resource vector_icon {
$"010B000A05010D1001178400040A08010D000A05010C1001178400040A07010C"
$"000A09010C023C00000000000000003C000048B00048F000"
};
-
-resource(100, "BEOS:default_shortcut") "G";

############################################################################

Commit: 05840b4c2a30d02e26feb69279475ce6ba91ce46
URL: http://cgit.haiku-os.org/haiku/commit/?id=05840b4c2a30
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 21:33:23 2015 UTC

TextSearch: don't save the 'show contents' option.

Also get rid of the redundant menu option.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/GrepWindow.cpp
b/src/apps/text_search/GrepWindow.cpp
index 5700586..2a684f4 100644
--- a/src/apps/text_search/GrepWindow.cpp
+++ b/src/apps/text_search/GrepWindow.cpp
@@ -108,7 +108,6 @@ GrepWindow::GrepWindow(BMessage* message)
fEscapeText(NULL),
fTextOnly(NULL),
fInvokePe(NULL),
- fShowLinesMenuitem(NULL),
fHistoryMenu(NULL),
fEncodingMenu(NULL),
fUTF8(NULL),
@@ -296,10 +295,6 @@ void GrepWindow::MessageReceived(BMessage* message)
_OnSelectInTracker();
break;

- case MSG_MENU_SHOW_LINES:
- _OnMenuShowLines();
- break;
-
case MSG_CHECKBOX_SHOW_LINES:
_OnCheckboxShowLines();
break;
@@ -482,10 +477,6 @@ GrepWindow::_CreateMenus()
fInvokePe = new BMenuItem(
B_TRANSLATE("Open files in Pe"), new BMessage(MSG_INVOKE_PE));

- fShowLinesMenuitem = new BMenuItem(
- B_TRANSLATE("Show lines"), new BMessage(MSG_MENU_SHOW_LINES),
'L');
- fShowLinesMenuitem->SetMarked(true);
-
fUTF8 = new BMenuItem("UTF8", new BMessage('utf8'));
fShiftJIS = new BMenuItem("ShiftJIS", new BMessage(B_SJIS_CONVERSION));
fEUC = new BMenuItem("EUC", new BMessage(B_EUC_CONVERSION));
@@ -514,8 +505,6 @@ GrepWindow::_CreateMenus()
fPreferencesMenu->AddItem(fEscapeText);
fPreferencesMenu->AddItem(fTextOnly);
fPreferencesMenu->AddItem(fInvokePe);
- fPreferencesMenu->AddSeparatorItem();
- fPreferencesMenu->AddItem(fShowLinesMenuitem);

fEncodingMenu->AddItem(fUTF8);
fEncodingMenu->AddItem(fShiftJIS);
@@ -682,11 +671,6 @@ GrepWindow::_LoadPrefs()
fTextOnly->SetMarked(fModel->fTextOnly);
fInvokePe->SetMarked(fModel->fInvokePe);

- fShowLinesCheckbox->SetValue(
- fModel->fShowContents ? B_CONTROL_ON : B_CONTROL_OFF);
- fShowLinesMenuitem->SetMarked(
- fModel->fShowContents ? true : false);
-
switch (fModel->fEncoding) {
case 0:
fUTF8->SetMarked(true);
@@ -1075,7 +1059,7 @@ GrepWindow::_OnReportResult(BMessage* message)
if (item == NULL) {
item = new ResultItem(ref);
fSearchResults->AddItem(item);
- item->SetExpanded(fModel->fShowContents);
+ item->SetExpanded(fShowLinesCheckbox->Value() == 1);
}

const char* buf;
@@ -1178,10 +1162,6 @@ GrepWindow::_OnInvokePe()
void
GrepWindow::_OnCheckboxShowLines()
{
- // toggle checkbox and menuitem
- fModel->fShowContents = !fModel->fShowContents;
- fShowLinesMenuitem->SetMarked(!fShowLinesMenuitem->IsMarked());
-
// Selection in BOutlineListView in multiple selection mode
// gets weird when collapsing. I've tried all sorts of things.
// It seems impossible to make it behave just right.
@@ -1212,7 +1192,7 @@ GrepWindow::_OnCheckboxShowLines()
for (int32 x = 0; x < numItems; ++x) {
BListItem* listItem = fSearchResults->FullListItemAt(x);
if (listItem->OutlineLevel() == 0) {
- if (fModel->fShowContents) {
+ if (fShowLinesCheckbox->Value() == 1) {
if (!fSearchResults->IsExpanded(x))
fSearchResults->Expand(listItem);
} else {
@@ -1229,15 +1209,6 @@ GrepWindow::_OnCheckboxShowLines()


void
-GrepWindow::_OnMenuShowLines()
-{
- // toggle companion checkbox
- fShowLinesCheckbox->SetValue(!fShowLinesCheckbox->Value());
- _OnCheckboxShowLines();
-}
-
-
-void
GrepWindow::_OnInvokeItem()
{
for (int32 selectionIndex = 0; ; selectionIndex++) {
diff --git a/src/apps/text_search/GrepWindow.h
b/src/apps/text_search/GrepWindow.h
index 702bc20..afcad60 100644
--- a/src/apps/text_search/GrepWindow.h
+++ b/src/apps/text_search/GrepWindow.h
@@ -76,7 +76,6 @@ private:
void _OnTextOnly();
void _OnInvokePe();
void _OnCheckboxShowLines();
- void _OnMenuShowLines();
void _OnInvokeItem();
void _OnSearchText();
void
_OnHistoryItem(BMessage* message);
@@ -124,7 +123,6 @@ private:
BMenuItem* fEscapeText;
BMenuItem* fTextOnly;
BMenuItem* fInvokePe;
- BMenuItem* fShowLinesMenuitem;
BMenu* fHistoryMenu;
BMenu* fEncodingMenu;
BMenuItem* fUTF8;
diff --git a/src/apps/text_search/Model.cpp b/src/apps/text_search/Model.cpp
index eb847a9..c76d65a 100644
--- a/src/apps/text_search/Model.cpp
+++ b/src/apps/text_search/Model.cpp
@@ -38,7 +38,6 @@ Model::Model()
fEscapeText(true),
fTextOnly(true),
fInvokePe(false),
- fShowContents(false),

fFrame(100, 100, 500, 400),

@@ -101,10 +100,6 @@ Model::LoadPrefs()
if (file.ReadAttr("InvokePe", B_INT32_TYPE, 0, &value, sizeof(int32)) >
0)
fInvokePe = (value != 0);

- if (file.ReadAttr("ShowContents", B_INT32_TYPE, 0, &value,
- sizeof(int32)) > 0)
- fShowContents = (value != 0);
-
char buffer [B_PATH_NAME_LENGTH+1];
int32 length = file.ReadAttr("FilePanelPath", B_STRING_TYPE, 0, &buffer,
sizeof(buffer));
@@ -161,9 +156,6 @@ Model::SavePrefs()
value = fInvokePe ? 1 : 0;
file.WriteAttr("InvokePe", B_INT32_TYPE, 0, &value, sizeof(int32));

- value = fShowContents ? 1 : 0;
- file.WriteAttr("ShowContents", B_INT32_TYPE, 0, &value, sizeof(int32));
-
file.WriteAttr("WindowFrame", B_RECT_TYPE, 0, &fFrame, sizeof(BRect));

file.WriteAttr("FilePanelPath", B_STRING_TYPE, 0,
fFilePanelPath.String(),
diff --git a/src/apps/text_search/Model.h b/src/apps/text_search/Model.h
index 81956d8..9b8fe2b 100644
--- a/src/apps/text_search/Model.h
+++ b/src/apps/text_search/Model.h
@@ -43,7 +43,6 @@ enum {
MSG_ESCAPE_TEXT,
MSG_TEXT_ONLY,
MSG_INVOKE_PE,
- MSG_MENU_SHOW_LINES,
MSG_CHECKBOX_SHOW_LINES,
MSG_SEARCH_TEXT,
MSG_INVOKE_ITEM,
@@ -114,9 +113,6 @@ public:
// Whether we open the item in Pe and jump to the
correct line.
bool fInvokePe;

- // Whether to show the contents of matching files.
- bool fShowContents;
-
// The dimensions of the window.
BRect fFrame;


############################################################################

Commit: 696f4254ca7f5a847d2f8f6fdbdd39ec11581ca3
URL: http://cgit.haiku-os.org/haiku/commit/?id=696f4254ca7f
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 21:42:02 2015 UTC

TextSearch: trim trailing whitespace.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/ChangesIterator.cpp
b/src/apps/text_search/ChangesIterator.cpp
index 33bc32c..6a34ffe 100644
--- a/src/apps/text_search/ChangesIterator.cpp
+++ b/src/apps/text_search/ChangesIterator.cpp
@@ -24,7 +24,7 @@ using std::nothrow;
#endif


-ChangesIterator::ChangesIterator(const Model* model)
+ChangesIterator::ChangesIterator(const Model* model)
: FileIterator(),
fPathMap(),
fIteratorIndex(0),
diff --git a/src/apps/text_search/FileIterator.h
b/src/apps/text_search/FileIterator.h
index c6cfa44..1c4830c 100644
--- a/src/apps/text_search/FileIterator.h
+++ b/src/apps/text_search/FileIterator.h
@@ -1,23 +1,23 @@
/*
* Copyright (c) 2008 Stephan Aßmus <superstippi@xxxxxx>
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef FILE_ITERATOR_H
diff --git a/src/apps/text_search/GrepApp.cpp b/src/apps/text_search/GrepApp.cpp
index da55f68..f1801b2 100644
--- a/src/apps/text_search/GrepApp.cpp
+++ b/src/apps/text_search/GrepApp.cpp
@@ -1,25 +1,25 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
-
+
#include "GrepApp.h"

#include <stdio.h>
@@ -46,19 +46,19 @@ GrepApp::~GrepApp()
}


-void
+void
GrepApp::ArgvReceived(int32 argc, char** argv)
{
fGotArgvOnStartup = true;

BMessage message(B_REFS_RECEIVED);
int32 refCount = 0;
-
+
for (int32 i = 1; i < argc; i++) {
BEntry entry(argv[i]);
entry_ref ref;
entry.GetRef(&ref);
-
+
if (entry.Exists()) {
message.AddRef("refs", &ref);
refCount += 1;
@@ -73,7 +73,7 @@ GrepApp::ArgvReceived(int32 argc, char** argv)

void
GrepApp::RefsReceived(BMessage* message)
-{
+{
if (IsLaunching())
fGotRefsOnStartup = true;

@@ -114,12 +114,12 @@ GrepApp::MessageReceived(BMessage* message)

void
GrepApp::_TryQuit()
-{
+{
if (CountWindows() == 0)
PostMessage(B_QUIT_REQUESTED);
-
+
if (CountWindows() == 1 && fQuitter == NULL) {
- fQuitter = new BMessageRunner(be_app_messenger,
+ fQuitter = new BMessageRunner(be_app_messenger,
new BMessage(MSG_TRY_QUIT), 200000, -1);
}
}
diff --git a/src/apps/text_search/GrepApp.h b/src/apps/text_search/GrepApp.h
index 86483b8..689e561 100644
--- a/src/apps/text_search/GrepApp.h
+++ b/src/apps/text_search/GrepApp.h
@@ -1,22 +1,22 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#include <Application.h>
diff --git a/src/apps/text_search/GrepListView.cpp
b/src/apps/text_search/GrepListView.cpp
index 787e476..52e884a 100644
--- a/src/apps/text_search/GrepListView.cpp
+++ b/src/apps/text_search/GrepListView.cpp
@@ -1,22 +1,22 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

@@ -30,12 +30,12 @@ ResultItem::ResultItem(const entry_ref& ref)
{
BEntry entry(&ref);
BPath path(&entry);
- SetText(path.Path());
+ SetText(path.Path());
}


GrepListView::GrepListView()
- : BOutlineListView(BRect(0, 0, 40, 80), "SearchResults",
+ : BOutlineListView(BRect(0, 0, 40, 80), "SearchResults",
B_MULTIPLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES,
B_WILL_DRAW | B_NAVIGABLE)
{
diff --git a/src/apps/text_search/GrepListView.h
b/src/apps/text_search/GrepListView.h
index f0355a0..c9ff26c 100644
--- a/src/apps/text_search/GrepListView.h
+++ b/src/apps/text_search/GrepListView.h
@@ -1,22 +1,22 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef GREP_LIST_VIEW_H
diff --git a/src/apps/text_search/GrepWindow.cpp
b/src/apps/text_search/GrepWindow.cpp
index 2a684f4..ae2c9c6 100644
--- a/src/apps/text_search/GrepWindow.cpp
+++ b/src/apps/text_search/GrepWindow.cpp
@@ -397,7 +397,7 @@ GrepWindow::_SetWindowTitle()
if (entry.GetPath(&path) == B_OK) {
if (fOldPattern.Length()) {
title = B_TRANSLATE("%appname% : %path% :
%searchtext%");
- title.ReplaceAll("%searchtext%",
fOldPattern.String());
+ title.ReplaceAll("%searchtext%",
fOldPattern.String());
} else
title = B_TRANSLATE("%appname% : %path%");

@@ -787,7 +787,7 @@ GrepWindow::_OnStartCancel()
fButton->MoveTo(
fMenuBar->Frame().Width() - fButton->Frame().Width() -
8,
8 + fSearchText->Frame().Height() + 8);
-
+
fSearch->SetEnabled(false);

// We need to remember the search pattern, because during
@@ -844,7 +844,7 @@ GrepWindow::_OnSearchFinished()
fButton->MoveTo(
fMenuBar->Frame().Width() - fButton->Frame().Width() - 8,
8 + fSearchText->Frame().Height() + 8);
-
+
fButton->SetEnabled(true);
fSearch->SetEnabled(true);

@@ -1028,7 +1028,7 @@ GrepWindow::_OnReportFileName(BMessage* message)
fSearchText->TruncateString(&name, B_TRUNCATE_MIDDLE,
fSearchBoxWidth - 10);

- fSearchText->SetText(name);
+ fSearchText->SetText(name);
}
}

@@ -1440,7 +1440,7 @@ GrepWindow::_OnSelectInTracker()
BString str1;
str1 << B_TRANSLATE("%APP_NAME couldn't open one or more
folders.");
str1.ReplaceFirst("%APP_NAME",APP_NAME);
- BAlert* alert = new BAlert(NULL, str1.String(),
B_TRANSLATE("OK"),
+ BAlert* alert = new BAlert(NULL, str1.String(),
B_TRANSLATE("OK"),
NULL, NULL, B_WIDTH_AS_USUAL, B_STOP_ALERT);
alert->SetFlags(alert->Flags() | B_CLOSE_ON_ESCAPE);
alert->Go(NULL);
diff --git a/src/apps/text_search/GrepWindow.h
b/src/apps/text_search/GrepWindow.h
index afcad60..cb292a7 100644
--- a/src/apps/text_search/GrepWindow.h
+++ b/src/apps/text_search/GrepWindow.h
@@ -1,22 +1,22 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef GREP_WINDOW_H
@@ -38,14 +38,14 @@ class GrepWindow : public BWindow {
public:

GrepWindow(BMessage* message);
virtual ~GrepWindow();
-
+
virtual void FrameResized(float width, float
height);
virtual void FrameMoved(BPoint origin);
virtual void MenusBeginning();
virtual void MenusEnded();
virtual void MessageReceived(BMessage*
message);
virtual void Quit();
-
+
private:
void
_InitRefsReceived(entry_ref* directory,

BMessage* message);
@@ -54,7 +54,7 @@ private:
void _CreateViews();
void _LayoutViews();
void
_TileIfMultipleWindows();
-
+
void _LoadPrefs();
void _SavePrefs();

@@ -101,7 +101,7 @@ private:
private:
BTextControl* fSearchText;
GrepListView* fSearchResults;
-
+
BMenuBar* fMenuBar;
BMenu* fFileMenu;
BMenuItem* fNew;
diff --git a/src/apps/text_search/Grepper.h b/src/apps/text_search/Grepper.h
index 23d0474..d57a3a1 100644
--- a/src/apps/text_search/Grepper.h
+++ b/src/apps/text_search/Grepper.h
@@ -1,22 +1,22 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef GREPPER_H
@@ -38,18 +38,18 @@ public:
bool IsValid() const;

void Start();
- void Cancel();
-
+ void Cancel();
+
private:
// Spawns the real grepper thread.
static int32 _SpawnThread(void* cookie);

// The thread function that does the actual grepping.
- int32 _GrepperThread();
-
+ int32 _GrepperThread();
+
// Remembers, and possibly escapes, the search pattern.
void _SetPattern(const char*
source);
-
+
// Prepends all quotes, dollars and backslashes with at backslash
// to prevent the shell from misinterpreting them.
bool
_EscapeSpecialChars(char* buffer,
@@ -57,16 +57,16 @@ private:
private:
// The (escaped) search pattern.
char* fPattern;
-
+
// The settings from the model.
BMessenger fTarget;
bool fEscapeText : 1;
bool fCaseSensitive : 1;
uint32 fEncoding;
-
+
// The supplier of files to grep
FileIterator* fIterator;
-
+
// Our thread's ID.
thread_id fThreadId;

diff --git a/src/apps/text_search/InitialIterator.cpp
b/src/apps/text_search/InitialIterator.cpp
index 68db11b..d0db425 100644
--- a/src/apps/text_search/InitialIterator.cpp
+++ b/src/apps/text_search/InitialIterator.cpp
@@ -1,23 +1,23 @@
/*
* Copyright (c) 2008 Stephan Aßmus <superstippi@xxxxxx>
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/

@@ -40,7 +40,7 @@ using std::nothrow;
// For the moment I don't know the life cycle of the InitialIterator object.


-InitialIterator::InitialIterator(const Model* model)
+InitialIterator::InitialIterator(const Model* model)
: FileIterator(),
fDirectories(10),
fCurrentDir(new (nothrow) BDirectory(&model->fDirectory)),
@@ -90,7 +90,7 @@ InitialIterator::GetNextName(char* buffer)
return false;

// If the entry is a subdir, then add it to the
- // list of directories and continue the loop.
+ // list of directories and continue the loop.
// If the entry is a file and we can grep it
// (i.e. it is a text file), then we're done
// here. Otherwise, continue with the next entry.
@@ -119,12 +119,12 @@ InitialIterator::NotifyNegatives() const
bool
InitialIterator::GetTopEntry(BEntry& entry)
{
- // If the user selected one or more files, we must look
- // at the "refs" inside the message that was passed into
- // our add-on's process_refs(). If the user didn't select
- // any files, we will simply read all the entries from the
+ // If the user selected one or more files, we must look
+ // at the "refs" inside the message that was passed into
+ // our add-on's process_refs(). If the user didn't select
+ // any files, we will simply read all the entries from the
// current working directory.
-
+
entry_ref fileRef;

if (fSelectedFiles.FindRef("refs", fCurrentRef, &fileRef) == B_OK) {
@@ -184,7 +184,7 @@ InitialIterator::_GetSubEntry(BEntry& entry)
if (fCurrentDir->GetNextEntry(&entry, fRecurseLinks) == B_OK)
return true;

- // If we get here, there are no more entries in
+ // If we get here, there are no more entries in
// this subdir, so return to the parent directory.

fDirectories.RemoveItem(fCurrentDir);
diff --git a/src/apps/text_search/InitialIterator.h
b/src/apps/text_search/InitialIterator.h
index e43cdb2..9b2ae1f 100644
--- a/src/apps/text_search/InitialIterator.h
+++ b/src/apps/text_search/InitialIterator.h
@@ -1,23 +1,23 @@
/*
* Copyright (c) 2008 Stephan Aßmus <superstippi@xxxxxx>
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef INITIAL_ITERATOR_H
@@ -69,10 +69,10 @@ private:
private:
// Contains pointers to BDirectory objects.
BList fDirectories;
-
+
// The directory we are currently looking at.
BDirectory* fCurrentDir;
-
+
// The ref number we are currently looking at.
int32 fCurrentRef;

diff --git a/src/apps/text_search/Model.h b/src/apps/text_search/Model.h
index 9b8fe2b..c2f2249 100644
--- a/src/apps/text_search/Model.h
+++ b/src/apps/text_search/Model.h
@@ -1,22 +1,22 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
+ *
+ * The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
*/
#ifndef MODEL_H
@@ -60,7 +60,7 @@ enum {
MSG_REFS_RECEIVED,
MSG_TRY_QUIT,
MSG_QUIT_NOW,
-
+
MSG_TRIM_SELECTION,
MSG_COPY_TEXT,
MSG_SELECT_IN_TRACKER,
@@ -78,7 +78,7 @@ enum state_t {
class Model {
public:
Model();
-
+
status_t LoadPrefs();
status_t SavePrefs();

@@ -124,13 +124,13 @@ public:

// Grep string encoding ?
uint32 fEncoding;
-
+
private:
bool _LoadHistory(BList&
items) const;
status_t _SaveHistory(const
BList& items) const;
void _FreeHistory(const
BList& items) const;
status_t _OpenFile(BFile* file,
const char* name,
- uint32
openMode = B_READ_ONLY,
+ uint32
openMode = B_READ_ONLY,

directory_which which

= B_USER_SETTINGS_DIRECTORY,

BVolume* volume = NULL) const;
diff --git a/src/apps/text_search/TextSearch.cpp
b/src/apps/text_search/TextSearch.cpp
index 5ff0938..46780ba 100644
--- a/src/apps/text_search/TextSearch.cpp
+++ b/src/apps/text_search/TextSearch.cpp
@@ -11,7 +11,7 @@


int
-main()
+main()
{
GrepApp app;
app.Run();

############################################################################

Commit: 5f25359909a4a66549484672a1d2ed13c1ec8188
URL: http://cgit.haiku-os.org/haiku/commit/?id=5f25359909a4
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 21:44:49 2015 UTC

TextSearch: remove legacy Translation.h.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/GrepWindow.cpp
b/src/apps/text_search/GrepWindow.cpp
index ae2c9c6..432b324 100644
--- a/src/apps/text_search/GrepWindow.cpp
+++ b/src/apps/text_search/GrepWindow.cpp
@@ -44,7 +44,6 @@
#include "GlobalDefs.h"
#include "Grepper.h"
#include "InitialIterator.h"
-#include "Translation.h"

#undef B_TRANSLATION_CONTEXT
#define B_TRANSLATION_CONTEXT "GrepWindow"
diff --git a/src/apps/text_search/Translation.h
b/src/apps/text_search/Translation.h
deleted file mode 100644
index 0cd350f..0000000
--- a/src/apps/text_search/Translation.h
+++ /dev/null
@@ -1,15 +0,0 @@
-/*
- * Public domain, baby!
- *
- * Localization for Zeta users
- *
- */
-
-#ifndef TRANSLATION_H
-#define TRANSLATION_H
-
-#ifndef _T
-# define _T(x) x
-#endif
-
-#endif // TRANSLATION_H

############################################################################

Commit: 90ce3113565f4be9dfbf7cf4e17d00e62d43810b
URL: http://cgit.haiku-os.org/haiku/commit/?id=90ce3113565f
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 21:52:05 2015 UTC

TextSearch: normalize copyright headers.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/FileIterator.h
b/src/apps/text_search/FileIterator.h
index 1c4830c..4d1cca5 100644
--- a/src/apps/text_search/FileIterator.h
+++ b/src/apps/text_search/FileIterator.h
@@ -1,24 +1,7 @@
/*
* Copyright (c) 2008 Stephan Aßmus <superstippi@xxxxxx>
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef FILE_ITERATOR_H
#define FILE_ITERATOR_H
diff --git a/src/apps/text_search/GrepApp.cpp b/src/apps/text_search/GrepApp.cpp
index f1801b2..51048c3 100644
--- a/src/apps/text_search/GrepApp.cpp
+++ b/src/apps/text_search/GrepApp.cpp
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/

#include "GrepApp.h"
diff --git a/src/apps/text_search/GrepApp.h b/src/apps/text_search/GrepApp.h
index 689e561..07cb309 100644
--- a/src/apps/text_search/GrepApp.h
+++ b/src/apps/text_search/GrepApp.h
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#include <Application.h>
#include <MessageRunner.h>
diff --git a/src/apps/text_search/GrepListView.cpp
b/src/apps/text_search/GrepListView.cpp
index 52e884a..aaa20e5 100644
--- a/src/apps/text_search/GrepListView.cpp
+++ b/src/apps/text_search/GrepListView.cpp
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/

#include "GrepListView.h"
diff --git a/src/apps/text_search/GrepListView.h
b/src/apps/text_search/GrepListView.h
index c9ff26c..602084b 100644
--- a/src/apps/text_search/GrepListView.h
+++ b/src/apps/text_search/GrepListView.h
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef GREP_LIST_VIEW_H
#define GREP_LIST_VIEW_H
diff --git a/src/apps/text_search/GrepWindow.cpp
b/src/apps/text_search/GrepWindow.cpp
index 432b324..8452c7d 100644
--- a/src/apps/text_search/GrepWindow.cpp
+++ b/src/apps/text_search/GrepWindow.cpp
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#include "GrepWindow.h"

diff --git a/src/apps/text_search/GrepWindow.h
b/src/apps/text_search/GrepWindow.h
index cb292a7..e65f9a6 100644
--- a/src/apps/text_search/GrepWindow.h
+++ b/src/apps/text_search/GrepWindow.h
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef GREP_WINDOW_H
#define GREP_WINDOW_H
diff --git a/src/apps/text_search/Grepper.cpp b/src/apps/text_search/Grepper.cpp
index 00b6657..1a40dec 100644
--- a/src/apps/text_search/Grepper.cpp
+++ b/src/apps/text_search/Grepper.cpp
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/


diff --git a/src/apps/text_search/Grepper.h b/src/apps/text_search/Grepper.h
index d57a3a1..221bff6 100644
--- a/src/apps/text_search/Grepper.h
+++ b/src/apps/text_search/Grepper.h
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef GREPPER_H
#define GREPPER_H
diff --git a/src/apps/text_search/InitialIterator.cpp
b/src/apps/text_search/InitialIterator.cpp
index d0db425..f23eabd 100644
--- a/src/apps/text_search/InitialIterator.cpp
+++ b/src/apps/text_search/InitialIterator.cpp
@@ -1,24 +1,7 @@
/*
* Copyright (c) 2008 Stephan Aßmus <superstippi@xxxxxx>
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/

#include "InitialIterator.h"
diff --git a/src/apps/text_search/InitialIterator.h
b/src/apps/text_search/InitialIterator.h
index 9b2ae1f..ce67f5d 100644
--- a/src/apps/text_search/InitialIterator.h
+++ b/src/apps/text_search/InitialIterator.h
@@ -1,24 +1,7 @@
/*
* Copyright (c) 2008 Stephan Aßmus <superstippi@xxxxxx>
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef INITIAL_ITERATOR_H
#define INITIAL_ITERATOR_H
diff --git a/src/apps/text_search/Model.h b/src/apps/text_search/Model.h
index c2f2249..7c465e7 100644
--- a/src/apps/text_search/Model.h
+++ b/src/apps/text_search/Model.h
@@ -1,23 +1,6 @@
/*
* Copyright (c) 1998-2007 Matthijs Hollemans
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
- * DEALINGS IN THE SOFTWARE.
+ * All rights reserved. Distributed under the terms of the MIT License.
*/
#ifndef MODEL_H
#define MODEL_H

############################################################################

Commit: 1b1789a711a4e9e7dfaa801cea99514e88764e0c
URL: http://cgit.haiku-os.org/haiku/commit/?id=1b1789a711a4
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 22:28:49 2015 UTC

TextSearch: use the layout API.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/GrepListView.cpp
b/src/apps/text_search/GrepListView.cpp
index aaa20e5..a414a84 100644
--- a/src/apps/text_search/GrepListView.cpp
+++ b/src/apps/text_search/GrepListView.cpp
@@ -18,8 +18,8 @@ ResultItem::ResultItem(const entry_ref& ref)


GrepListView::GrepListView()
- : BOutlineListView(BRect(0, 0, 40, 80), "SearchResults",
- B_MULTIPLE_SELECTION_LIST, B_FOLLOW_ALL_SIDES,
+ : BOutlineListView("SearchResults",
+ B_MULTIPLE_SELECTION_LIST,
B_WILL_DRAW | B_NAVIGABLE)
{
}
diff --git a/src/apps/text_search/GrepWindow.cpp
b/src/apps/text_search/GrepWindow.cpp
index 8452c7d..5e2864e 100644
--- a/src/apps/text_search/GrepWindow.cpp
+++ b/src/apps/text_search/GrepWindow.cpp
@@ -16,10 +16,12 @@
#include <AppFileInfo.h>
#include <Alert.h>
#include <Clipboard.h>
+#include <LayoutBuilder.h>
#include <MessageRunner.h>
#include <Path.h>
#include <PathMonitor.h>
#include <Roster.h>
+#include <SpaceLayoutItem.h>
#include <String.h>
#include <UTF8.h>

@@ -66,7 +68,8 @@ static const bigtime_t kChangesPulseInterval = 150000;


GrepWindow::GrepWindow(BMessage* message)
- : BWindow(BRect(0, 0, 1, 1), NULL, B_DOCUMENT_WINDOW, 0),
+ : BWindow(BRect(0, 0, 525, 430), NULL, B_DOCUMENT_WINDOW,
+ B_AUTO_UPDATE_SIZE_LIMITS),
fSearchText(NULL),
fSearchResults(NULL),
fMenuBar(NULL),
@@ -139,7 +142,6 @@ GrepWindow::~GrepWindow()

void GrepWindow::FrameResized(float width, float height)
{
- fSearchBoxWidth = fSearchText->Bounds().Width();
BWindow::FrameResized(width, height);
fModel->fFrame = Frame();
_SavePrefs();
@@ -398,7 +400,7 @@ GrepWindow::_SetWindowTitle()
void
GrepWindow::_CreateMenus()
{
- fMenuBar = new BMenuBar(BRect(0, 0, 1, 1), "menubar");
+ fMenuBar = new BMenuBar("menubar");

fFileMenu = new BMenu(B_TRANSLATE("File"));
fActionMenu = new BMenu(B_TRANSLATE("Actions"));
@@ -504,9 +506,6 @@ GrepWindow::_CreateMenus()
fMenuBar->AddItem(fHistoryMenu);
fMenuBar->AddItem(fEncodingMenu);

- AddChild(fMenuBar);
- SetKeyMenuBar(fMenuBar);
-
fSearch->SetEnabled(false);
}

@@ -519,96 +518,55 @@ GrepWindow::_CreateViews()
// does this and we don't want to send the same message twice.

fSearchText = new BTextControl(
- BRect(0, 0, 0, 1), "SearchText", NULL, NULL, NULL,
- B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
+ "SearchText", NULL, NULL, NULL,
B_WILL_DRAW | B_FULL_UPDATE_ON_RESIZE | B_NAVIGABLE);

fSearchText->TextView()->SetMaxBytes(1000);
- fSearchText->ResizeToPreferred();
- // because it doesn't have a label
-
fSearchText->SetModificationMessage(new BMessage(MSG_SEARCH_TEXT));

fButton = new BButton(
- BRect(0, 1, 80, 1), "Button", B_TRANSLATE("Search"),
- new BMessage(MSG_START_CANCEL), B_FOLLOW_RIGHT);
-
+ "Button", B_TRANSLATE("Search"),
+ new BMessage(MSG_START_CANCEL));
fButton->MakeDefault(true);
- fButton->ResizeToPreferred();
fButton->SetEnabled(false);

fShowLinesCheckbox = new BCheckBox(
- BRect(0, 0, 1, 1), "ShowLines", B_TRANSLATE("Show lines"),
- new BMessage(MSG_CHECKBOX_SHOW_LINES), B_FOLLOW_LEFT);
-
+ "ShowLines", B_TRANSLATE("Show lines"),
+ new BMessage(MSG_CHECKBOX_SHOW_LINES));
fShowLinesCheckbox->SetValue(B_CONTROL_ON);
- fShowLinesCheckbox->ResizeToPreferred();

fSearchResults = new GrepListView();
-
fSearchResults->SetInvocationMessage(new BMessage(MSG_INVOKE_ITEM));
- fSearchResults->ResizeToPreferred();
}


void
GrepWindow::_LayoutViews()
{
- float menubarWidth, menubarHeight = 20;
- fMenuBar->GetPreferredSize(&menubarWidth, &menubarHeight);
-
- BBox* background = new BBox(
- BRect(0, menubarHeight + 1, 2, menubarHeight + 2),
B_EMPTY_STRING,
- B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP,
- B_WILL_DRAW | B_FRAME_EVENTS | B_NAVIGABLE_JUMP,
- B_PLAIN_BORDER);
-
BScrollView* scroller = new BScrollView(
- "ScrollSearchResults", fSearchResults, B_FOLLOW_ALL_SIDES,
- B_FULL_UPDATE_ON_RESIZE, true, true, B_NO_BORDER);
-
- scroller->ResizeToPreferred();
-
- float width = 8 + fShowLinesCheckbox->Frame().Width()
- + 8 + fButton->Frame().Width() + 8;
+ "ScrollSearchResults", fSearchResults,
+ B_FULL_UPDATE_ON_RESIZE, true, true);
+
+ BLayoutBuilder::Group<>(this, B_VERTICAL, B_USE_HALF_ITEM_SPACING)
+ .SetInsets(0, 0, -1, -1)
+ .Add(fMenuBar)
+ .AddGrid(B_USE_HALF_ITEM_SPACING)
+ .SetInsets(B_USE_ITEM_INSETS, B_USE_HALF_ITEM_INSETS,
+ B_USE_ITEM_INSETS, 0)
+ .Add(fSearchText, 0, 0, 3)
+ .Add(fShowLinesCheckbox, 0, 1)
+ .Add(BSpaceLayoutItem::CreateGlue(), 1, 1)
+ .Add(fButton, 2, 1)
+ .End()
+ .AddGroup(B_VERTICAL, 0)
+ .SetInsets(-1, 0, -1, -1)
+ .Add(scroller)
+ .End()
+ .End();

- float height = 8 + fSearchText->Frame().Height() + 8
- + fButton->Frame().Height() + 8 + scroller->Frame().Height();
-
- float backgroundHeight = 8 + fSearchText->Frame().Height()
- + 8 + fButton->Frame().Height() + 8;
-
- ResizeTo(width, height);
-
- AddChild(background);
- background->ResizeTo(width, backgroundHeight);
- background->AddChild(fSearchText);
- background->AddChild(fShowLinesCheckbox);
- background->AddChild(fButton);
-
- fSearchText->MoveTo(8, 8);
- fSearchText->ResizeTo(width - 16, fSearchText->Frame().Height());
fSearchText->MakeFocus(true);

- fShowLinesCheckbox->MoveTo(
- 8, 8 + fSearchText->Frame().Height() + 8
- + (fButton->Frame().Height() -
fShowLinesCheckbox->Frame().Height())/2);
-
- fButton->MoveTo(
- width - fButton->Frame().Width() - 8,
- 8 + fSearchText->Frame().Height() + 8);
-
- AddChild(scroller);
- scroller->MoveTo(0, menubarHeight + 1 + backgroundHeight + 1);
- scroller->ResizeTo(width + 1, height - backgroundHeight - menubarHeight
- 1);
-
- BRect screenRect = BScreen(this).Frame();
-
- MoveTo(
- (screenRect.Width() - width) / 2,
- (screenRect.Height() - height) / 2);
-
- SetSizeLimits(width, 10000, height, 10000);
+ SetKeyMenuBar(fMenuBar);
}


@@ -765,10 +723,6 @@ GrepWindow::_OnStartCancel()

fButton->MakeFocus(true);
fButton->SetLabel(B_TRANSLATE("Cancel"));
- fButton->ResizeToPreferred();
- fButton->MoveTo(
- fMenuBar->Frame().Width() - fButton->Frame().Width() -
8,
- 8 + fSearchText->Frame().Height() + 8);

fSearch->SetEnabled(false);

@@ -822,10 +776,6 @@ GrepWindow::_OnSearchFinished()
fEncodingMenu->SetEnabled(true);

fButton->SetLabel(B_TRANSLATE("Search"));
- fButton->ResizeToPreferred();
- fButton->MoveTo(
- fMenuBar->Frame().Width() - fButton->Frame().Width() - 8,
- 8 + fSearchText->Frame().Height() + 8);

fButton->SetEnabled(true);
fSearch->SetEnabled(true);

############################################################################

Revision: hrev48969
Commit: 1e9f5f5be4c8419c2085f51c78c9ac02ef13377b
URL: http://cgit.haiku-os.org/haiku/commit/?id=1e9f5f5be4c8
Author: Augustin Cavalier <waddlesplash@xxxxxxxxx>
Date: Tue Mar 31 23:56:18 2015 UTC

Ticket: https://dev.haiku-os.org/ticket/9529

TextSearch: use BString-based searching instead of Grep-based.

Huge performance improvement. Fixes #9529.

----------------------------------------------------------------------------

diff --git a/src/apps/text_search/GrepWindow.cpp
b/src/apps/text_search/GrepWindow.cpp
index 5e2864e..ee66020 100644
--- a/src/apps/text_search/GrepWindow.cpp
+++ b/src/apps/text_search/GrepWindow.cpp
@@ -90,7 +90,6 @@ GrepWindow::GrepWindow(BMessage* message)
fRecurseDirs(NULL),
fSkipDotDirs(NULL),
fCaseSensitive(NULL),
- fEscapeText(NULL),
fTextOnly(NULL),
fInvokePe(NULL),
fHistoryMenu(NULL),
@@ -211,10 +210,6 @@ void GrepWindow::MessageReceived(BMessage* message)
_OnCaseSensitive();
break;

- case MSG_ESCAPE_TEXT:
- _OnEscapeText();
- break;
-
case MSG_TEXT_ONLY:
_OnTextOnly();
break;
@@ -259,10 +254,6 @@ void GrepWindow::MessageReceived(BMessage* message)
_OnReportResult(message);
break;

- case MSG_REPORT_ERROR:
- _OnReportError(message);
- break;
-
case MSG_SELECT_ALL:
_OnSelectAll(message);
break;
@@ -452,9 +443,6 @@ GrepWindow::_CreateMenus()
fCaseSensitive = new BMenuItem(
B_TRANSLATE("Case-sensitive"), new
BMessage(MSG_CASE_SENSITIVE));

- fEscapeText = new BMenuItem(
- B_TRANSLATE("Escape search text"), new
BMessage(MSG_ESCAPE_TEXT));
-
fTextOnly = new BMenuItem(
B_TRANSLATE("Text files only"), new BMessage(MSG_TEXT_ONLY));

@@ -486,7 +474,6 @@ GrepWindow::_CreateMenus()
fPreferencesMenu->AddItem(fRecurseDirs);
fPreferencesMenu->AddItem(fSkipDotDirs);
fPreferencesMenu->AddItem(fCaseSensitive);
- fPreferencesMenu->AddItem(fEscapeText);
fPreferencesMenu->AddItem(fTextOnly);
fPreferencesMenu->AddItem(fInvokePe);

@@ -607,7 +594,6 @@ GrepWindow::_LoadPrefs()
fRecurseLinks->SetMarked(fModel->fRecurseLinks);
fSkipDotDirs->SetMarked(fModel->fSkipDotDirs);
fCaseSensitive->SetMarked(fModel->fCaseSensitive);
- fEscapeText->SetMarked(fModel->fEscapeText);
fTextOnly->SetMarked(fModel->fTextOnly);
fInvokePe->SetMarked(fModel->fInvokePe);

@@ -1020,15 +1006,6 @@ GrepWindow::_OnReportResult(BMessage* message)


void
-GrepWindow::_OnReportError(BMessage* message)
-{
- const char* buf;
- if (message->FindString("error", &buf) == B_OK)
- fSearchResults->AddItem(new BStringItem(buf));
-}
-
-
-void
GrepWindow::_OnRecurseLinks()
{
fModel->fRecurseLinks = !fModel->fRecurseLinks;
@@ -1056,15 +1033,6 @@ GrepWindow::_OnSkipDotDirs()


void
-GrepWindow::_OnEscapeText()
-{
- fModel->fEscapeText = !fModel->fEscapeText;
- fEscapeText->SetMarked(fModel->fEscapeText);
- _ModelChanged();
-}
-
-
-void
GrepWindow::_OnCaseSensitive()
{
fModel->fCaseSensitive = !fModel->fCaseSensitive;
diff --git a/src/apps/text_search/GrepWindow.h
b/src/apps/text_search/GrepWindow.h
index e65f9a6..33a31c6 100644
--- a/src/apps/text_search/GrepWindow.h
+++ b/src/apps/text_search/GrepWindow.h
@@ -50,11 +50,9 @@ private:
void _OnNodeMonitorPulse();
void
_OnReportFileName(BMessage* message);
void
_OnReportResult(BMessage* message);
- void
_OnReportError(BMessage* message);
void _OnRecurseLinks();
void _OnRecurseDirs();
void _OnSkipDotDirs();
- void _OnEscapeText();
void _OnCaseSensitive();
void _OnTextOnly();
void _OnInvokePe();
@@ -103,7 +101,6 @@ private:
BMenuItem* fRecurseDirs;
BMenuItem* fSkipDotDirs;
BMenuItem* fCaseSensitive;
- BMenuItem* fEscapeText;
BMenuItem* fTextOnly;
BMenuItem* fInvokePe;
BMenu* fHistoryMenu;
diff --git a/src/apps/text_search/Grepper.cpp b/src/apps/text_search/Grepper.cpp
index 1a40dec..cf9a42f 100644
--- a/src/apps/text_search/Grepper.cpp
+++ b/src/apps/text_search/Grepper.cpp
@@ -17,6 +17,7 @@
#include <Locale.h>
#include <NodeInfo.h>
#include <Path.h>
+#include <String.h>
#include <UTF8.h>

#include "FileIterator.h"
@@ -59,33 +60,10 @@ strdup_to_utf8(uint32 encode, const char* src, int32 length)
}


-char*
-strdup_from_utf8(uint32 encode, const char* src, int32 length)
-{
- int32 srcLen = length;
- int32 dstLen = srcLen;
- char* dst = new (nothrow) char[dstLen + 1];
- if (dst == NULL)
- return NULL;
- int32 cookie = 0;
- convert_from_utf8(encode, src, &srcLen, dst, &dstLen, &cookie);
- // TODO: See above.
- dst[dstLen] = '\0';
- char* dup = strdup(dst);
- delete[] dst;
- if (srcLen != length) {
- fprintf(stderr, "strdup_from_utf8(%" B_PRId32 ", %" B_PRId32
- ") dst allocate smalled(%" B_PRId32 ")\n", encode,
length, dstLen);
- }
- return dup;
-}
-
-
-Grepper::Grepper(const char* pattern, const Model* model,
+Grepper::Grepper(BString pattern, const Model* model,
const BHandler* target, FileIterator* iterator)
- : fPattern(NULL),
+ : fPattern(pattern),
fTarget(target),
- fEscapeText(model->fEscapeText),
fCaseSensitive(model->fCaseSensitive),
fEncoding(model->fEncoding),

@@ -93,19 +71,12 @@ Grepper::Grepper(const char* pattern, const Model* model,
fThreadId(-1),
fMustQuit(false)
{
- if (fEncoding > 0) {
- char* src = strdup_from_utf8(fEncoding, pattern,
strlen(pattern));
- _SetPattern(src);
- free(src);
- } else
- _SetPattern(pattern);
}


Grepper::~Grepper()
{
Cancel();
- free(fPattern);
delete fIterator;
}

@@ -160,17 +131,9 @@ int32
Grepper::_GrepperThread()
{
BMessage message;
-
char fileName[B_PATH_NAME_LENGTH];
- char tempString[B_PATH_NAME_LENGTH];
- char command[B_PATH_NAME_LENGTH + 32];
-
- BPath tempFile;
- sprintf(fileName, "/tmp/SearchText%" B_PRId32, fThreadId);
- tempFile.SetTo(fileName);

while (!fMustQuit && fIterator->GetNextName(fileName)) {
-
message.MakeEmpty();
message.what = MSG_REPORT_FILE_NAME;
message.AddString("filename", fileName);
@@ -191,58 +154,44 @@ Grepper::_GrepperThread()
continue;
}

- if (!_EscapeSpecialChars(fileName, B_PATH_NAME_LENGTH)) {
- sprintf(tempString, B_TRANSLATE("%s: Not enough room to
escape "
- "the filename."), fileName);
-
- message.MakeEmpty();
- message.what = MSG_REPORT_ERROR;
- message.AddString("error", tempString);
- fTarget.SendMessage(&message);
- continue;
+ BString contents;
+
+ BFile file(&ref, B_READ_WRITE);
+ off_t size;
+ file.GetSize(&size);
+ file.Seek(0, SEEK_SET);
+ char* buffer = new char[size];
+ file.Read(buffer, size);
+ if (fEncoding > 0) {
+ char* temp = strdup_to_utf8(fEncoding, buffer, size);
+ contents.SetTo(temp, size);
+ free(temp);
+ } else
+ contents.SetTo(buffer, size);
+ delete[] buffer;
+
+ int32 index = 0, lines = 1; // First line is 1 not 0
+ while (true) {
+ int32 newPos;
+ if (fCaseSensitive)
+ newPos = contents.FindFirst(fPattern, index);
+ else
+ newPos = contents.IFindFirst(fPattern, index);
+ if (newPos == B_ERROR)
+ break;
+
+ lines += _CountLines(contents, index, newPos);
+ BString linenoAndLine;
+ linenoAndLine.SetToFormat("%" B_PRId32 ":%s", lines,
_GetLine(contents, newPos).String());
+ message.AddString("text", linenoAndLine);
+
+ index = newPos + 1;
}

- sprintf(command, "grep -hn %s %s \"%s\" > \"%s\"",
- fCaseSensitive ? "" : "-i", fPattern, fileName,
tempFile.Path());
-
- int res = system(command);
-
- if (res == 0 || res == 1) {
- FILE *results = fopen(tempFile.Path(), "r");
-
- if (results != NULL) {
- while (fgets(tempString, B_PATH_NAME_LENGTH,
results) != 0) {
- if (fEncoding > 0) {
- char* tempdup =
strdup_to_utf8(fEncoding, tempString,
- strlen(tempString));
- message.AddString("text",
tempdup);
- free(tempdup);
- } else
- message.AddString("text",
tempString);
- }
-
- if (message.HasString("text") ||
fIterator->NotifyNegatives())
- fTarget.SendMessage(&message);
-
- fclose(results);
- continue;
- }
- }
-
- sprintf(tempString, B_TRANSLATE("%s: There was a problem
running grep."), fileName);
-
- message.MakeEmpty();
- message.what = MSG_REPORT_ERROR;
- message.AddString("error", tempString);
- fTarget.SendMessage(&message);
+ if (message.HasString("text") || fIterator->NotifyNegatives())
+ fTarget.SendMessage(&message);
}

- // We wait with removing the temporary file until after the
- // entire search has finished, to prevent a lot of flickering
- // if the Tracker window for /tmp/ might be open.
-
- remove(tempFile.Path());
-
message.MakeEmpty();
message.what = MSG_SEARCH_FINISHED;
fTarget.SendMessage(&message);
@@ -251,79 +200,36 @@ Grepper::_GrepperThread()
}


-void
-Grepper::_SetPattern(const char* src)
+int32
+Grepper::_CountLines(BString& str, int32 startPos, int32 endPos)
{
- if (src == NULL)
- return;
-
- if (!fEscapeText) {
- fPattern = strdup(src);
- return;
+ int32 ret = 0;
+ for (int32 i = startPos; i < endPos; i++) {
+ if (str[i] == '\n')
+ ret++;
}
-
- // We will simply guess the size of the memory buffer
- // that we need. This should always be large enough.
- fPattern = (char*)malloc((strlen(src) + 1) * 3 * sizeof(char));
- if (fPattern == NULL)
- return;
-
- const char* srcPtr = src;
- char* dstPtr = fPattern;
-
- // Put double quotes around the pattern, so separate
- // words are considered to be part of a single string.
- *dstPtr++ = '"';
-
- while (*srcPtr != '\0') {
- char c = *srcPtr++;
-
- // Put a backslash in front of characters
- // that should be escaped.
- if ((c == '.') || (c == ',')
- || (c == '[') || (c == ']')
- || (c == '?') || (c == '*')
- || (c == '+') || (c == '-')
- || (c == ':') || (c == '^')
- || (c == '"') || (c == '`')) {
- *dstPtr++ = '\\';
- } else if ((c == '\\') || (c == '$')) {
- // Some characters need to be escaped
- // with *three* backslashes in a row.
- *dstPtr++ = '\\';
- *dstPtr++ = '\\';
- *dstPtr++ = '\\';
- }
-
- // Note: we do not have to escape the
- // { } ( ) < > and | characters.
-
- *dstPtr++ = c;
- }
-
- *dstPtr++ = '"';
- *dstPtr = '\0';
+ return ret;
}


-bool
-Grepper::_EscapeSpecialChars(char* buffer, ssize_t bufferSize)
+BString
+Grepper::_GetLine(BString& str, int32 pos)
{
- char* copy = strdup(buffer);
- char* start = buffer;
- uint32 len = strlen(copy);
- bool result = true;
- for (uint32 count = 0; count < len; ++count) {
- if (copy[count] == '"' || copy[count] == '$')
- *buffer++ = '\\';
- if (buffer - start == bufferSize - 1) {
- result = false;
+ int32 startPos = 0;
+ int32 endPos = str.Length();
+ for (int32 i = pos; i > 0; i--) {
+ if (str[i] == '\n') {
+ startPos = i + 1;
+ break;
+ }
+ }
+ for (int32 i = pos; i < endPos; i++) {
+ if (str[i] == '\n') {
+ endPos = i;
break;
}
- *buffer++ = copy[count];
}
- *buffer = '\0';
- free(copy);
- return result;
-}

+ BString ret;
+ return str.CopyInto(ret, startPos, endPos - startPos);
+}
diff --git a/src/apps/text_search/Grepper.h b/src/apps/text_search/Grepper.h
index 221bff6..ea90da6 100644
--- a/src/apps/text_search/Grepper.h
+++ b/src/apps/text_search/Grepper.h
@@ -6,6 +6,7 @@
#define GREPPER_H

#include <Messenger.h>
+#include <String.h>

class FileIterator;
class Model;
@@ -13,7 +14,7 @@ class Model;
// Executes "grep" in a background thread.
class Grepper {
public:
- Grepper(const
char* pattern, const Model* model,
+ Grepper(BString
pattern, const Model* model,
const
BHandler* target,

FileIterator* iterator);
virtual ~Grepper();
@@ -30,16 +31,14 @@ private:
// The thread function that does the actual grepping.
int32 _GrepperThread();

- // Remembers, and possibly escapes, the search pattern.
- void _SetPattern(const char*
source);
-
- // Prepends all quotes, dollars and backslashes with at backslash
- // to prevent the shell from misinterpreting them.
- bool
_EscapeSpecialChars(char* buffer,
- ssize_t
bufferSize);
+ // Counts the number of linebreaks from startPos to endPos.
+ int32 _CountLines(BString&
str, int32 startPos,
+
int32 endPos);
+ // Gets the complete line that "pos" is on.
+ BString _GetLine(BString& str,
int32 pos);
private:
- // The (escaped) search pattern.
- char* fPattern;
+ // The search pattern.
+ BString fPattern;

// The settings from the model.
BMessenger fTarget;
diff --git a/src/apps/text_search/Model.cpp b/src/apps/text_search/Model.cpp
index c76d65a..4f00112 100644
--- a/src/apps/text_search/Model.cpp
+++ b/src/apps/text_search/Model.cpp
@@ -35,7 +35,6 @@ Model::Model()
fRecurseLinks(false),
fSkipDotDirs(true),
fCaseSensitive(false),
- fEscapeText(true),
fTextOnly(true),
fInvokePe(false),

@@ -91,9 +90,6 @@ Model::LoadPrefs()
sizeof(int32)) > 0)
fCaseSensitive = (value != 0);

- if (file.ReadAttr("EscapeText", B_INT32_TYPE, 0, &value, sizeof(int32))

0)
- fEscapeText = (value != 0);
-
if (file.ReadAttr("TextOnly", B_INT32_TYPE, 0, &value, sizeof(int32)) >
0)
fTextOnly = (value != 0);

@@ -147,9 +143,6 @@ Model::SavePrefs()
value = fCaseSensitive ? 1 : 0;
file.WriteAttr("CaseSensitive", B_INT32_TYPE, 0, &value, sizeof(int32));

- value = fEscapeText ? 1 : 0;
- file.WriteAttr("EscapeText", B_INT32_TYPE, 0, &value, sizeof(int32));
-
value = fTextOnly ? 1 : 0;
file.WriteAttr("TextOnly", B_INT32_TYPE, 0, &value, sizeof(int32));

diff --git a/src/apps/text_search/Model.h b/src/apps/text_search/Model.h
index 7c465e7..96e7dc6 100644
--- a/src/apps/text_search/Model.h
+++ b/src/apps/text_search/Model.h
@@ -23,7 +23,6 @@ enum {
MSG_RECURSE_DIRS,
MSG_SKIP_DOT_DIRS,
MSG_CASE_SENSITIVE,
- MSG_ESCAPE_TEXT,
MSG_TEXT_ONLY,
MSG_INVOKE_PE,
MSG_CHECKBOX_SHOW_LINES,
@@ -35,7 +34,6 @@ enum {

MSG_REPORT_FILE_NAME,
MSG_REPORT_RESULT,
- MSG_REPORT_ERROR,
MSG_SEARCH_FINISHED,

MSG_NEW_WINDOW,
@@ -87,9 +85,6 @@ public:
// Whether the search is case sensitive.
bool fCaseSensitive;

- // Whether the search pattern will be escaped.
- bool fEscapeText;
-
// Whether we look at text files only.
bool fTextOnly;



Other related posts: