[tracker/extractor-remove-word-counting-review] Files renamed as using GIOChannel instead of GInputStream
- From: Aleksander Morgado <aleksm src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/extractor-remove-word-counting-review] Files renamed as using GIOChannel instead of GInputStream
- Date: Tue, 11 May 2010 13:12:01 +0000 (UTC)
commit da6d6e445c012db3759d5c85bf888352bf30f8db
Author: Aleksander Morgado <aleksander lanedo com>
Date: Tue May 11 14:25:31 2010 +0200
Files renamed as using GIOChannel instead of GInputStream
src/tracker-extract/Makefile.am | 4 ++--
src/tracker-extract/tracker-extract-oasis.c | 2 +-
src/tracker-extract/tracker-extract-text.c | 2 +-
.../{tracker-istream.c => tracker-iochannel.c} | 7 +++----
.../{tracker-istream.h => tracker-iochannel.h} | 6 +++---
5 files changed, 10 insertions(+), 11 deletions(-)
---
diff --git a/src/tracker-extract/Makefile.am b/src/tracker-extract/Makefile.am
index bd25656..0c74e08 100644
--- a/src/tracker-extract/Makefile.am
+++ b/src/tracker-extract/Makefile.am
@@ -304,8 +304,8 @@ tracker_extract_SOURCES = \
tracker-dbus.h \
tracker-extract.c \
tracker-extract.h \
- tracker-istream.c \
- tracker-istream.h \
+ tracker-iochannel.c \
+ tracker-iochannel.h \
tracker-main.c \
tracker-main.h \
tracker-albumart-generic.h
diff --git a/src/tracker-extract/tracker-extract-oasis.c b/src/tracker-extract/tracker-extract-oasis.c
index c8ead97..90feed7 100644
--- a/src/tracker-extract/tracker-extract-oasis.c
+++ b/src/tracker-extract/tracker-extract-oasis.c
@@ -24,7 +24,7 @@
#include "tracker-main.h"
#include "tracker-gsf.h"
-#include "tracker-istream.h"
+#include "tracker-iochannel.h"
#include <unistd.h>
diff --git a/src/tracker-extract/tracker-extract-text.c b/src/tracker-extract/tracker-extract-text.c
index 12c3ec8..f9303e3 100644
--- a/src/tracker-extract/tracker-extract-text.c
+++ b/src/tracker-extract/tracker-extract-text.c
@@ -27,7 +27,7 @@
#include <libtracker-extract/tracker-extract.h>
#include "tracker-main.h"
-#include "tracker-istream.h"
+#include "tracker-iochannel.h"
#define TRY_LOCALE_TO_UTF8_CONVERSION 0
diff --git a/src/tracker-extract/tracker-istream.c b/src/tracker-extract/tracker-iochannel.c
similarity index 98%
rename from src/tracker-extract/tracker-istream.c
rename to src/tracker-extract/tracker-iochannel.c
index 135a2af..dac0abd 100644
--- a/src/tracker-extract/tracker-istream.c
+++ b/src/tracker-extract/tracker-iochannel.c
@@ -24,7 +24,7 @@
#include <libtracker-extract/tracker-extract.h>
-#include "tracker-istream.h"
+#include "tracker-iochannel.h"
/* Size of the buffer to use when reading from the GIOChannel, in bytes */
#define BUFFER_SIZE 65535
@@ -34,7 +34,6 @@
#define MAX_RETRIES 5
-
static GString *
get_string_in_locale (GString *s)
{
@@ -84,7 +83,7 @@ tracker_iochannel_read_text (GIOChannel *channel,
gboolean close_channel)
{
GString *s = NULL;
- gsize n_bytes_remaining;
+ gsize n_bytes_remaining = max_bytes;
guint n_retries = MAX_RETRIES;
g_return_val_if_fail (channel, NULL);
@@ -103,7 +102,6 @@ tracker_iochannel_read_text (GIOChannel *channel,
* e) Stream has a single line of BUFFER_SIZE bytes with no EOL
* f) Max reading retries arrived
*/
- n_bytes_remaining = max_bytes;
while (n_bytes_remaining > 0 &&
n_retries > 0) {
gchar buf[BUFFER_SIZE];
@@ -211,6 +209,7 @@ tracker_iochannel_read_text (GIOChannel *channel,
/* Properly close channel if requested to do so */
if (close_channel) {
GError *error = NULL;
+
g_io_channel_shutdown (channel, TRUE, &error);
if (error) {
g_message ("Couldn't properly shutdown channel: '%s'",
diff --git a/src/tracker-extract/tracker-istream.h b/src/tracker-extract/tracker-iochannel.h
similarity index 91%
rename from src/tracker-extract/tracker-istream.h
rename to src/tracker-extract/tracker-iochannel.h
index 0bf8fee..3985e22 100644
--- a/src/tracker-extract/tracker-istream.h
+++ b/src/tracker-extract/tracker-iochannel.h
@@ -17,8 +17,8 @@
* Boston, MA 02110-1301, USA.
*/
-#ifndef __TRACKER_ISTREAM_H__
-#define __TRACKER_ISTREAM_H__
+#ifndef __TRACKER_IOCHANNEL_H__
+#define __TRACKER_IOCHANNEL_H__
#include <glib.h>
#include <gio/gio.h>
@@ -32,5 +32,5 @@ gchar *tracker_iochannel_read_text (GIOChannel *channel,
G_END_DECLS
-#endif /* __TRACKER_ISTREAM_H__ */
+#endif /* __TRACKER_IOCHANNEL_H__ */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]