[gnome-commander] noop: code cleanup
- From: Piotr Eljasiak <epiotr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander] noop: code cleanup
- Date: Thu, 19 May 2011 20:21:56 +0000 (UTC)
commit 1da798dba350875ce163b2c72263c5e604a80b69
Author: Piotr Eljasiak <epiotr src gnome org>
Date: Thu May 19 22:19:57 2011 +0200
noop: code cleanup
src/dialogs/gnome-cmd-search-dialog.cc | 15 ++++++++-------
1 files changed, 8 insertions(+), 7 deletions(-)
---
diff --git a/src/dialogs/gnome-cmd-search-dialog.cc b/src/dialogs/gnome-cmd-search-dialog.cc
index dc3087a..88f9bba 100755
--- a/src/dialogs/gnome-cmd-search-dialog.cc
+++ b/src/dialogs/gnome-cmd-search-dialog.cc
@@ -177,8 +177,7 @@ inline void search_file_data_free (SearchFileData *searchfile_data)
*/
static gboolean read_search_file (SearchData *data, SearchFileData *searchfile_data, GnomeCmdFile *f)
{
- // if the stop button was pressed, let's abort here
- if (data->stopped)
+ if (data->stopped) // if the stop button was pressed, let's abort here
{
search_file_data_free (searchfile_data);
return FALSE;
@@ -186,8 +185,8 @@ static gboolean read_search_file (SearchData *data, SearchFileData *searchfile_d
if (searchfile_data->len)
{
- if ((searchfile_data->offset + searchfile_data->len) >= f->info->size)
- { // end, all has been read
+ if ((searchfile_data->offset + searchfile_data->len) >= f->info->size) // end, all has been read
+ {
search_file_data_free (searchfile_data);
return FALSE;
}
@@ -199,15 +198,14 @@ static gboolean read_search_file (SearchData *data, SearchFileData *searchfile_d
else
searchfile_data->len = SEARCH_BUFFER_SIZE - 1;
}
- else
- { // first time call of this function
+ else // first time call of this function
+ {
if (f->info->size < (SEARCH_BUFFER_SIZE - 1))
searchfile_data->len = f->info->size;
else
searchfile_data->len = SEARCH_BUFFER_SIZE - 1;
}
- GnomeVFSFileSize ret;
searchfile_data->result = gnome_vfs_seek (searchfile_data->handle, GNOME_VFS_SEEK_START, searchfile_data->offset);
if (searchfile_data->result != GNOME_VFS_OK)
{
@@ -215,6 +213,8 @@ static gboolean read_search_file (SearchData *data, SearchFileData *searchfile_d
search_file_data_free (searchfile_data);
return FALSE;
}
+
+ GnomeVFSFileSize ret;
searchfile_data->result = gnome_vfs_read (searchfile_data->handle, searchfile_data->mem, searchfile_data->len, &ret);
if (searchfile_data->result != GNOME_VFS_OK)
{
@@ -222,6 +222,7 @@ static gboolean read_search_file (SearchData *data, SearchFileData *searchfile_d
search_file_data_free (searchfile_data);
return FALSE;
}
+
searchfile_data->mem[searchfile_data->len] = '\0';
return TRUE;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]