aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/backend/pas/pas-backend-file.c3
-rw-r--r--addressbook/gui/component/addressbook.c4
-rw-r--r--camel/ChangeLog8
-rw-r--r--camel/camel-folder-search.c2
-rw-r--r--camel/providers/imap/camel-imap-store.c8
-rw-r--r--camel/string-utils.c21
-rw-r--r--camel/string-utils.h2
-rw-r--r--e-util/ChangeLog4
-rw-r--r--e-util/e-util.c24
-rw-r--r--e-util/e-util.c-861124
-rw-r--r--e-util/e-util.h3
-rw-r--r--e-util/e-util.h-290023
13 files changed, 82 insertions, 31 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index d55cd24354..388a984cc2 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,5 +1,12 @@
2000-07-12 Christopher James Lahey <clahey@helixcode.com>
+ * backend/pas/pas-backend-file.c: Do case insensitive compares.
+
+ * addressbook/gui/component/addressbook.c: Make quick search
+ search both name and company name.
+
+2000-07-12 Christopher James Lahey <clahey@helixcode.com>
+
* contact-editor/e-contact-editor.c: Add icons to the toolbars.
2000-07-12 Christopher James Lahey <clahey@helixcode.com>
diff --git a/addressbook/backend/pas/pas-backend-file.c b/addressbook/backend/pas/pas-backend-file.c
index c9befc7bb1..cc7d8efe0c 100644
--- a/addressbook/backend/pas/pas-backend-file.c
+++ b/addressbook/backend/pas/pas-backend-file.c
@@ -22,6 +22,7 @@
#include "pas-card-cursor.h"
#include <ebook/e-card.h>
#include <e-util/e-sexp.h>
+#include <e-util/e-util.h>
#define PAS_BACKEND_FILE_VERSION_NAME "PAS-DB-VERSION"
#define PAS_BACKEND_FILE_VERSION "0.1"
@@ -311,7 +312,7 @@ func_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, void *data
{
PASBackendFileSearchContext *ctx = data;
- return entry_compare (ctx, f, argc, argv, strstr);
+ return entry_compare (ctx, f, argc, argv, e_strstrcase);
}
static char *
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index e079550d92..7295682bf7 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -426,8 +426,8 @@ search_entry_activated (GtkWidget* widget, gpointer user_data)
if (search_word && strlen (search_word))
search_query = g_strdup_printf (
- "(contains \"full_name\" \"%s\")",
- search_word);
+ "(or (contains \"full_name\" \"%s\") (contains \"org\" \"%s\"))",
+ search_word, search_word);
else
search_query = g_strdup (
"(contains \"full_name\" \"\")");
diff --git a/camel/ChangeLog b/camel/ChangeLog
index dba02a52a5..83f4a923bd 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,3 +1,11 @@
+2000-07-12 Christopher James Lahey <clahey@helixcode.com>
+
+ * camel-folder-search.c, providers/imap/camel-imap-store.c:
+ Changed from strstrcase to e_strstrcase.
+
+ * string-utils.c, string-utils.h: Removed strstrcase (in favor of
+ e_strstrcase in e-util/e-util.c.)
+
2000-07-12 Chris Toshok <toshok@helixcode.com>
* providers/nntp/camel-nntp-folder.c
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 583316d50f..4e77aea94e 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -381,7 +381,7 @@ search_header_contains(struct _ESExp *f, int argc, struct _ESExpResult **argv, C
/* performs an OR of all words */
for (i=1;i<argc && !truth;i++) {
if (argv[i]->type == ESEXP_RES_STRING
- && strstrcase(header, argv[i]->value.string)) {
+ && e_strstrcase(header, argv[i]->value.string)) {
r(printf("%s got a match with %s of %s\n", search->current->uid, header, argv[i]->value.string));
truth = TRUE;
break;
diff --git a/camel/providers/imap/camel-imap-store.c b/camel/providers/imap/camel-imap-store.c
index eeb7bd7d90..d31080d0b2 100644
--- a/camel/providers/imap/camel-imap-store.c
+++ b/camel/providers/imap/camel-imap-store.c
@@ -333,7 +333,7 @@ imap_connect (CamelService *service, CamelException *ex)
"Unknown error");
}
- if (strstrcase (result, "SEARCH"))
+ if (e_strstrcase (result, "SEARCH"))
store->has_search_capability = TRUE;
else
store->has_search_capability = FALSE;
@@ -559,13 +559,13 @@ camel_imap_command (CamelImapStore *store, CamelFolder *folder, char **ret, char
}
if (p) {
- if (strstrcase (p, "READ-WRITE"))
+ if (e_strstrcase (p, "READ-WRITE"))
mode =
}
#endif
}
#if 0
- if ((recent = strstrcase (r, "RECENT"))) {
+ if ((recent = e_strstrcase (r, "RECENT"))) {
char *p;
for (p = recent; p > r && *p != '*'; p--);
@@ -678,7 +678,7 @@ camel_imap_command_extended (CamelImapStore *store, CamelFolder *folder, char **
return s;
}
#if 0
- if ((recent = strstrcase (r, "RECENT"))) {
+ if ((recent = e_strstrcase (r, "RECENT"))) {
char *p;
for (p = recent; p > r && *p != '*'; p--);
diff --git a/camel/string-utils.c b/camel/string-utils.c
index 8c46df7a60..418092fd06 100644
--- a/camel/string-utils.c
+++ b/camel/string-utils.c
@@ -174,24 +174,3 @@ string_prefix (const gchar *s, const gchar *suffix, gboolean *suffix_found)
return result_string;
}
-
-gchar *
-strstrcase (const gchar *haystack, const gchar *needle)
-{
- /* find the needle in the haystack neglecting case */
- gchar *ptr;
- guint len;
-
- g_return_val_if_fail (haystack != NULL, NULL);
- g_return_val_if_fail (needle != NULL, NULL);
-
- len = strlen(needle);
- if (len > strlen(haystack))
- return NULL;
-
- for (ptr = (char *)haystack; *(ptr + len - 1) != '\0'; ptr++)
- if (!g_strncasecmp(ptr, needle, len))
- return ptr;
-
- return NULL;
-}
diff --git a/camel/string-utils.h b/camel/string-utils.h
index fa6297a5e1..6f5b9a577c 100644
--- a/camel/string-utils.h
+++ b/camel/string-utils.h
@@ -56,8 +56,6 @@ void string_trim (gchar *string, const gchar *chars,
gchar *string_prefix (const gchar *s, const gchar *suffix, gboolean *suffix_found);
-gchar *strstrcase (const gchar *haystack, const gchar *needle);
-
#ifdef __cplusplus
}
#endif /* __cplusplus */
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index ba3b0abb95..bf68a708c3 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,7 @@
+2000-07-12 Christopher James Lahey <clahey@helixcode.com>
+
+ * e-util.c, e-util.h: Added e_strstrcase function.
+
2000-07-11 Christopher James Lahey <clahey@helixcode.com>
* e-canvas-vbox.c: Removed some debugging printfs.
diff --git a/e-util/e-util.c b/e-util/e-util.c
index 3dea9282c3..c8c60fe1b3 100644
--- a/e-util/e-util.c
+++ b/e-util/e-util.c
@@ -305,3 +305,27 @@ e_strsplit (const gchar *string,
return str_array;
}
+
+gchar *
+e_strstrcase (const gchar *haystack, const gchar *needle)
+{
+ /* find the needle in the haystack neglecting case */
+ gchar *ptr;
+ guint len;
+
+ g_return_val_if_fail (haystack != NULL, NULL);
+ g_return_val_if_fail (needle != NULL, NULL);
+
+ len = strlen(needle);
+ if (len > strlen(haystack))
+ return NULL;
+
+ if (len == 0)
+ return haystack;
+
+ for (ptr = (char *)haystack; *(ptr + len - 1) != '\0'; ptr++)
+ if (!g_strncasecmp(ptr, needle, len))
+ return ptr;
+
+ return NULL;
+}
diff --git a/e-util/e-util.c-8611 b/e-util/e-util.c-8611
index 3dea9282c3..c8c60fe1b3 100644
--- a/e-util/e-util.c-8611
+++ b/e-util/e-util.c-8611
@@ -305,3 +305,27 @@ e_strsplit (const gchar *string,
return str_array;
}
+
+gchar *
+e_strstrcase (const gchar *haystack, const gchar *needle)
+{
+ /* find the needle in the haystack neglecting case */
+ gchar *ptr;
+ guint len;
+
+ g_return_val_if_fail (haystack != NULL, NULL);
+ g_return_val_if_fail (needle != NULL, NULL);
+
+ len = strlen(needle);
+ if (len > strlen(haystack))
+ return NULL;
+
+ if (len == 0)
+ return haystack;
+
+ for (ptr = (char *)haystack; *(ptr + len - 1) != '\0'; ptr++)
+ if (!g_strncasecmp(ptr, needle, len))
+ return ptr;
+
+ return NULL;
+}
diff --git a/e-util/e-util.h b/e-util/e-util.h
index ab5325806b..25fd839e19 100644
--- a/e-util/e-util.h
+++ b/e-util/e-util.h
@@ -46,6 +46,9 @@ gchar **e_strsplit (const gchar *string,
const gchar *delimiter,
gint max_tokens);
+gchar *e_strstrcase (const gchar *haystack,
+ const gchar *needle);
+
void e_marshal_INT__INT_INT_POINTER (GtkObject * object,
GtkSignalFunc func,
gpointer func_data, GtkArg * args);
diff --git a/e-util/e-util.h-29002 b/e-util/e-util.h-29002
index ab5325806b..25fd839e19 100644
--- a/e-util/e-util.h-29002
+++ b/e-util/e-util.h-29002
@@ -46,6 +46,9 @@ gchar **e_strsplit (const gchar *string,
const gchar *delimiter,
gint max_tokens);
+gchar *e_strstrcase (const gchar *haystack,
+ const gchar *needle);
+
void e_marshal_INT__INT_INT_POINTER (GtkObject * object,
GtkSignalFunc func,
gpointer func_data, GtkArg * args);