Notices


Reply
Thread Tools
nicolai's Avatar
Posts: 1,637 | Thanked: 4,424 times | Joined on Apr 2009 @ Germany
#11
Originally Posted by saxen View Post
does it search "case sensitive"!?
Yes, for the moment the search is case sensitive only.

nicolai
 
Posts: 9 | Thanked: 3 times | Joined on Mar 2010
#12
Supports English only?
 
Posts: 159 | Thanked: 88 times | Joined on Feb 2010
#13
This looks very interesting I'll check it out when the case-sensitive thing is fixed
__________________
USB, Charging Problems, Nokia not helping? Read my story:
1, 2, 3, 4, 5, 6, 7
The finale and a summary
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#14
Hi,

Originally Posted by nicolai View Post
I wished I could open the conversation app for the conversation
search result, but I couldn't find a way to do so.
Code:
--- scout-0.0.1.orig/src/scout-window.cpp
+++ scout-0.0.1/src/scout-window.cpp
@@ -4,6 +4,10 @@
 #include <libosso.h>
 #include "scout-window.h"
 #include <rtcom-eventlogger/event.h>
+#include <rtcom-eventlogger-plugins/chat.h>
+#include <telepathy-glib/interfaces.h>
+#include <telepathy-glib/dbus.h>
+#include <rtcom-telepathy-glib/extensions.h>
 #include <string.h>
 #include <libintl.h>
 #include <locale.h>
@@ -899,37 +903,82 @@
 			       const gchar* user_id,
 			       int event_id)
 {
-  GtkWidget* window;
-  window = hildon_stackable_window_new();
   RTComElQuery *query = rtcom_el_query_new (self->priv->rt_el);
   rtcom_el_query_prepare (query, "id", event_id, RTCOM_EL_OP_EQUAL, NULL);
   RTComElIter* iter = rtcom_el_get_events(self->priv->rt_el, query);
   
   g_object_unref(query);
-  GtkWidget* text_view = hildon_text_view_new();
-  gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text_view), GTK_WRAP_CHAR);
-  gtk_text_view_set_editable(GTK_TEXT_VIEW(text_view), FALSE);
   gboolean it = rtcom_el_iter_first(iter);
-  if(it)
-  {
-    gchar* text = NULL;
-    rtcom_el_iter_get_values(iter, "free-text", &text, NULL);
+  if (!it)
+    return;
+
+  gchar* remote_uid = NULL;
+  gchar* channel = NULL;
+  gint flags = 0;
+  gchar* local_uid = NULL;
+  rtcom_el_iter_get_values(iter, "remote-uid", &remote_uid, "channel", &channel, "flags", &flags, "local-uid", &local_uid, NULL);
 
-    hildon_text_view_set_placeholder (HILDON_TEXT_VIEW (text_view),
-				      text);
-    GtkTextBuffer* buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(text_view));
-    gtk_text_buffer_insert_at_cursor(buffer,
-				     text,
-				     strlen(text));
+  if (!((remote_uid || channel) && local_uid))
+    return;
+
+  McAccount *account = osso_abook_account_manager_lookup_by_name (NULL, local_uid);
+  if (!account)
+    goto finally;
+
+  if ((flags & RTCOM_EL_FLAG_CHAT_GROUP) && (flags & RTCOM_EL_FLAG_CHAT_OPAQUE))
+  {
+    if (!channel)
+        goto finally;
+
+    GHashTable *properties = tp_asv_new(TP_IFACE_CHANNEL ".ChannelType", G_TYPE_STRING,
+                         TP_IFACE_CHANNEL_TYPE_TEXT,
+                         TP_IFACE_CHANNEL ".TargetHandleType", G_TYPE_UINT,
+                         TP_HANDLE_TYPE_NONE,
+                         RTCOM_TP_IFACE_CHANNEL_INTERFACE_PERSISTENT ".PersistentID",
+                         G_TYPE_STRING, channel,
+                         NULL);
+
+    mc_account_channelrequest_ht (account,
+                                  properties,
+                                  time (NULL),
+                                  NULL,
+                                  MC_ACCOUNT_CR_FLAG_USE_EXISTING,
+                                  NULL, NULL, NULL, NULL);
+
+    g_hash_table_unref (properties);
   }
   else
   {
-    hildon_text_view_set_placeholder (HILDON_TEXT_VIEW (text_view),
-				      "no text");
+    McAccountChannelrequestData request;
+
+    MC_ACCOUNT_CRD_INIT (&request);
+    MC_ACCOUNT_CRD_SET (&request, channel_type, TP_IFACE_QUARK_CHANNEL_TYPE_TEXT);
+
+    if ((flags & RTCOM_EL_FLAG_CHAT_ROOM) && channel)
+    {
+      MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_ROOM);
+      MC_ACCOUNT_CRD_SET (&request, target_id, channel);
+    }
+    else if (remote_uid)
+    {
+      MC_ACCOUNT_CRD_SET (&request, target_handle_type, TP_HANDLE_TYPE_CONTACT);
+      MC_ACCOUNT_CRD_SET (&request, target_id, remote_uid);
+    }
+    else
+      goto finally;
+
+      mc_account_channelrequest (account,
+                                 &request,
+                                 time (NULL),
+                                 NULL,
+                                 MC_ACCOUNT_CR_FLAG_USE_EXISTING,
+                                 NULL, NULL, NULL, NULL);
   }
-  gtk_container_add(GTK_CONTAINER(window), text_view);
-  gtk_window_set_title(GTK_WINDOW(window), user_id);
-  gtk_widget_show_all(window);
+
+finally:
+    g_free (remote_uid);
+    g_free (channel);
+    g_free (local_uid);
 }
 
 static void
Note: I do not take credit for this method; code was taken from the Conversations Inbox Desktop Widget.

Last edited by qwerty12; 2010-07-12 at 16:09. Reason: Not the thread... my signature's enough
 

The Following 8 Users Say Thank You to qwerty12 For This Useful Post:
Dr.MZ's Avatar
Posts: 111 | Thanked: 74 times | Joined on Feb 2010 @ Germany
#15
Would it be possible to search for additional files to include? Thus it takes no longer the App Search Tool.
 
Posts: 4,556 | Thanked: 1,624 times | Joined on Dec 2007
#16
Have you considered including applications?
__________________
Originally Posted by ysss View Post
They're maemo and MeeGo...

"Meamo!" sounds like what Zorro would say to catherine zeta jones... after she slaps him for looking at her dirtily...
 
Posts: 287 | Thanked: 165 times | Joined on Oct 2009 @ The Netherlands
#17
Originally Posted by nicolai View Post
because I know there is a some demand for such an app.
Understatement of the year?

I really wanted this! Thanks for creating it.
__________________
My personal website and my new home on damplein
 
Posts: 228 | Thanked: 145 times | Joined on Dec 2009
#18
I'm so excited about a search app!

So, does it index all these things, or does it grep on the fly? Can you give some specifics about how it works?

Any plans to search email?
 
skalogre's Avatar
Posts: 327 | Thanked: 249 times | Joined on Sep 2009 @ Λεμεσιανός, ρε!
#19
Between this and the other applications you have thrown together, Nicolai, you should be canonised! Thank you again
 
Posts: 53 | Thanked: 18 times | Joined on Dec 2007
#20
This is very promising, Nicolai. Thank you for your work!

Simon.
 
Reply


 
Forum Jump


All times are GMT. The time now is 17:57.