Commit 720fa65e authored by john's avatar john

Reconsrtuct some redudant function

parent 9039b57d
......@@ -421,7 +421,7 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
public signal void view_source();
/** Fired when a internal link is activated */
public signal void internal_link_activated(string link, uint y);
public signal void internal_link_activated(uint y);
/** Fired when the user selects text in a message. */
internal signal void body_selection_changed(bool has_selection);
......@@ -764,9 +764,9 @@ public class ConversationEmail : Gtk.Box, Geary.BaseInterface {
private void connect_message_view_signals(ConversationMessage view) {
view.flag_remote_images.connect(on_flag_remote_images);
view.remember_remote_images.connect(on_remember_remote_images);
view.internal_link_activated.connect((link, y) => {
internal_link_activated(link, y);
});
view.internal_link_activated.connect((y) => {
internal_link_activated(y);
});
view.web_view.internal_resource_loaded.connect(on_resource_loaded);
view.web_view.content_loaded.connect(on_content_loaded);
view.web_view.selection_changed.connect((has_selection) => {
......
......@@ -364,8 +364,7 @@ public class ConversationListBox : Gtk.ListBox, Geary.BaseInterface {
}
private void connect_email_signals(ConversationEmail email) {
email.internal_link_activated.connect((link, y) => {
stdout.printf("Reached ConversationEmail\n");
email.internal_link_activated.connect((y) => {
internal_link_activated(this, y);
});
}
......
......@@ -263,7 +263,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
public signal void link_activated(string link);
/** Fired when the user clicks a internal link in the email. */
public signal void internal_link_activated(string link, uint y);
public signal void internal_link_activated(uint y);
/** Fired when the user requests remote images be loaded. */
public signal void flag_remote_images();
......@@ -1171,8 +1171,7 @@ public class ConversationMessage : Gtk.Grid, Geary.BaseInterface {
long end = link.length;
this.web_view.get_anchor_target_y.begin(link.substring(start, end - start), (obj, res) => {
uint y = this.web_view.get_anchor_target_y.end(res);
stdout.printf("The y is %u\n", y);
internal_link_activated(link, y);
internal_link_activated(y);
});
} else {
link_activated(link);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment