Jussi, attached a couple of trivial patches.
Regards, -- Lionel
>From 5a23f61335e05b06487f66d7bcf3986fb9d21012 Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin <lionel.g.landwer...@linux.intel.com> Date: Thu, 10 Feb 2011 15:02:04 +0000 Subject: [PATCH 1/2] fix miner initialization Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@linux.intel.com> --- src/tracker-miner-upnp.vala | 27 +++++++++++++-------------- 1 files changed, 13 insertions(+), 14 deletions(-) diff --git a/src/tracker-miner-upnp.vala b/src/tracker-miner-upnp.vala index 36fdeea..072d85a 100644 --- a/src/tracker-miner-upnp.vala +++ b/src/tracker-miner-upnp.vala @@ -5,12 +5,12 @@ * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. - * + * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. - * + * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA @@ -26,8 +26,8 @@ using GUPnP; namespace Tracker.UPnP { -public class Miner : Tracker.Miner -{ +public class Miner : Tracker.Miner, GLib.Initable { + private static const string MINER_NAME = "UPnP"; private static const string MINER_DESCRIPTION = "Tracker miner for UPnP ContentDirectories"; private static const string MEDIASERVER_DEVICE = "urn:schemas-upnp-org:device:MediaServer:1"; @@ -53,8 +53,10 @@ public class Miner : Tracker.Miner name = MINER_NAME; } - private Miner () + public bool init (GLib.Cancellable? cancellable) throws GLib.Error { + base.init (cancellable); + main_loop = new MainLoop (null, false); manager = new ContextManager (null, 0); mediaservers = new HashTable<string, ContentDirectory?> (str_hash, str_equal); @@ -64,11 +66,8 @@ public class Miner : Tracker.Miner update_status (); update_progress (); - try { - UPnPSparql.set_all_content_directories_unavailable (get_connection()); - } catch (Error error) { - warning ("Failed to set content directories unavailable on startup: %s".printf (error.message)); - } + UPnPSparql.set_all_content_directories_unavailable (get_connection()); + return true; } public override void started () @@ -96,7 +95,7 @@ public class Miner : Tracker.Miner HashTableIter<string,ContentDirectory> iter = HashTableIter<string,ContentDirectory> (mediaservers); ContentDirectory? dir; - while (iter.next (null, out dir)) { + while (iter.next (null, out dir)) { if (dir != null) dir.paused = !running; } @@ -110,7 +109,7 @@ public class Miner : Tracker.Miner string server_string = ""; uint count; - while (iter.next (null, out dir)) { + while (iter.next (null, out dir)) { if (dir == null) return; @@ -152,7 +151,7 @@ public class Miner : Tracker.Miner double total_progress = 0.0; int count = 0; - while (iter.next (null, out dir)) { + while (iter.next (null, out dir)) { if (dir != null){ total_progress += dir.progress; } @@ -229,7 +228,7 @@ public class Miner : Tracker.Miner { Environment.set_application_name ("UPnP tracker miner"); - UPnP.Miner miner = new UPnP.Miner (); + UPnP.Miner miner = Initable.new (typeof (UPnP.Miner), null) as UPnP.Miner; int exit_code = miner.run (); return exit_code; } -- 1.7.2.3
>From 71da7d4c3225e8ac897d2a0e064d9b34fedff42d Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin <lionel.g.landwer...@linux.intel.com> Date: Thu, 10 Feb 2011 15:02:21 +0000 Subject: [PATCH 2/2] use libtool That ease the installation in weird paths (like /opt/) by adding -rpath options at link time. Signed-off-by: Lionel Landwerlin <lionel.g.landwer...@linux.intel.com> --- configure.ac | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-) diff --git a/configure.ac b/configure.ac index 1014443..d21e602 100644 --- a/configure.ac +++ b/configure.ac @@ -16,6 +16,9 @@ AC_PROG_INSTALL AC_PROG_MAKE_SET AC_PROG_SED +LT_PREREQ([2.2.6]) +LT_INIT + # Checks for header files. AC_HEADER_STDC -- 1.7.2.3
_______________________________________________ tracker-list mailing list tracker-list@gnome.org http://mail.gnome.org/mailman/listinfo/tracker-list