projects
/
feedhandler
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Feedhandler 2.2 with FeedingIt support
[feedhandler]
/
feedhandler.vala
diff --git
a/feedhandler.vala
b/feedhandler.vala
index
06dd9fa
..
162009f
100644
(file)
--- a/
feedhandler.vala
+++ b/
feedhandler.vala
@@
-8,10
+8,14
@@
using GLib;
using Osso;
using Pango;
using Osso;
using Pango;
+public static const string FEEDINGIT_SERVICE =
+ "/usr/share/dbus-1/services/feedingit.service";
+
public enum Reader {
RSS = 1,
GOOGLE,
GPODDER,
public enum Reader {
RSS = 1,
GOOGLE,
GPODDER,
+ FEEDINGIT,
}
public class DesktopFile : GLib.KeyFile {
}
public class DesktopFile : GLib.KeyFile {
@@
-104,6
+108,9
@@
public class FeedHandler : GLib.Object {
if (FileUtils.test("/usr/bin/gpodder", FileTest.EXISTS)) {
dlg.add_button("gPodder", Reader.GPODDER);
}
if (FileUtils.test("/usr/bin/gpodder", FileTest.EXISTS)) {
dlg.add_button("gPodder", Reader.GPODDER);
}
+ if (FileUtils.test(FEEDINGIT_SERVICE, FileTest.EXISTS)) {
+ dlg.add_button("FeedingIt", Reader.FEEDINGIT);
+ }
dlg.add_button("Cancel", Gtk.ResponseType.CLOSE);
dlg.title = "Select application for handling this feed";
var label = new Gtk.Label(url);
dlg.add_button("Cancel", Gtk.ResponseType.CLOSE);
dlg.title = "Select application for handling this feed";
var label = new Gtk.Label(url);
@@
-131,6
+138,9
@@
public class FeedHandler : GLib.Object {
stderr.printf("Can't launch: %s\n", e.message);
}
break;
stderr.printf("Can't launch: %s\n", e.message);
}
break;
+ case Reader.FEEDINGIT:
+ add_to_feedingit(url);
+ break;
}
message("URL received: %s", url);
}
message("URL received: %s", url);
@@
-152,6
+162,15
@@
public class FeedHandler : GLib.Object {
obj.mime_open(url);
}
obj.mime_open(url);
}
+ private void add_to_feedingit(string url)
+ {
+ dynamic DBus.Object obj = conn.get_object(
+ "org.maemo.feedingit",
+ "/org/maemo/feedingit",
+ "org.maemo.feedingit");
+ obj.AddFeed(url);
+ }
+
private void open_browser(string url)
{
context.rpc_run_with_defaults("osso_browser",
private void open_browser(string url)
{
context.rpc_run_with_defaults("osso_browser",