Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
GNOME
Epiphany
Commits
78e8d7f0
Commit
78e8d7f0
authored
Dec 09, 2013
by
Carlos Garcia Campos
Committed by
Carlos Garcia Campos
Dec 11, 2013
Browse files
Move the search provider to its own binary
https://bugzilla.gnome.org/show_bug.cgi?id=711409
parent
83affc44
Changes
8
Hide whitespace changes
Inline
Side-by-side
data/Makefile.am
View file @
78e8d7f0
...
@@ -40,7 +40,7 @@ service_DATA = $(service_in_files:.service.in=.service)
...
@@ -40,7 +40,7 @@ service_DATA = $(service_in_files:.service.in=.service)
# Rule to make the service file with bindir expanded
# Rule to make the service file with bindir expanded
$(service_DATA)
:
$(service_in_files) Makefile
$(service_DATA)
:
$(service_in_files) Makefile
@
sed
-e
"s|
\@
bin
dir
\@
|
$(
bin
dir)
|"
$<
>
$@
@
sed
-e
"s|
\@
libexec
dir
\@
|
$(
libexec
dir)
|"
$<
>
$@
# Default bookmarks
# Default bookmarks
# We don't put translations in the resulting rdf since the code can get
# We don't put translations in the resulting rdf since the code can get
...
...
data/epiphany-search-provider.ini
View file @
78e8d7f0
[Shell Search Provider]
[Shell Search Provider]
DesktopId
=
epiphany.desktop
DesktopId
=
epiphany.desktop
BusName
=
org.gnome.Epiphany
BusName
=
org.gnome.Epiphany
SearchProvider
ObjectPath
=
/org/gnome/Epiphany
ObjectPath
=
/org/gnome/Epiphany
SearchProvider
Version
=
2
Version
=
2
data/org.gnome.Epiphany.service.in
View file @
78e8d7f0
[D-BUS Service]
[D-BUS Service]
Name=org.gnome.Epiphany
Name=org.gnome.Epiphany
SearchProvider
Exec=@
bin
dir@/epiphany
--headless-mo
de
Exec=@
libexec
dir@/epiphany
-search-provi
de
r
src/Makefile.am
View file @
78e8d7f0
...
@@ -44,7 +44,6 @@ INST_H_FILES = \
...
@@ -44,7 +44,6 @@ INST_H_FILES = \
$(NULL)
$(NULL)
libephymain_la_SOURCES
=
\
libephymain_la_SOURCES
=
\
$(dbus_shell_search_provider_built_sources)
\
ephy-action-helper.c
\
ephy-action-helper.c
\
ephy-completion-model.c
\
ephy-completion-model.c
\
ephy-completion-model.h
\
ephy-completion-model.h
\
...
@@ -60,7 +59,6 @@ libephymain_la_SOURCES = \
...
@@ -60,7 +59,6 @@ libephymain_la_SOURCES = \
ephy-navigation-history-action.c
\
ephy-navigation-history-action.c
\
ephy-notebook.c
\
ephy-notebook.c
\
ephy-page-menu-action.c
\
ephy-page-menu-action.c
\
ephy-search-provider.c
\
ephy-session.c
\
ephy-session.c
\
ephy-shell.c
\
ephy-shell.c
\
ephy-toolbar.c
\
ephy-toolbar.c
\
...
@@ -165,6 +163,34 @@ epiphany_LDADD = \
...
@@ -165,6 +163,34 @@ epiphany_LDADD = \
$(CODE_COVERAGE_LDFLAGS)
\
$(CODE_COVERAGE_LDFLAGS)
\
$(LIBINTL)
$(LIBINTL)
libexec_PROGRAMS
=
epiphany-search-provider
epiphany_search_provider_SOURCES
=
\
$(dbus_shell_search_provider_built_sources)
\
ephy-search-provider.c
\
ephy-search-provider-main.c
epiphany_search_provider_CPPFLAGS
=
\
-I
$(top_builddir)
/lib
\
-I
$(top_srcdir)
/lib
\
-I
$(top_srcdir)
/lib/history
\
-I
$(top_srcdir)
/src/bookmarks
\
-DDATADIR
=
\"
"
$(datadir)
"
\"
\
-DGNOMELOCALEDIR
=
\"
$(datadir)
/locale
\"
\
$(INCINTL)
\
$(AM_CPPFLAGS)
epiphany_search_provider_CFLAGS
=
$(epiphany_CFLAGS)
epiphany_search_provider_LDADD
=
\
libephymain.la
\
$(top_builddir)
/src/bookmarks/libephybookmarks.la
\
$(top_builddir)
/lib/history/libephyhistory.la
\
$(top_builddir)
/lib/libephymisc.la
\
$(DEPENDENCIES_LIBS)
\
$(CODE_COVERAGE_LDFLAGS)
\
$(LIBINTL)
TYPES_SOURCE
=
\
TYPES_SOURCE
=
\
ephy-type-builtins.c
\
ephy-type-builtins.c
\
ephy-type-builtins.h
ephy-type-builtins.h
...
...
src/ephy-search-provider-main.c
0 → 100644
View file @
78e8d7f0
/*
* Copyright (c) 2013 Igalia S.L.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by the
* Free Software Foundation; either version 2 of the License, or (at your
* option) any later version.
*
* This program 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 General Public License
* for more details.
*
* You should have received a copy of the GNU General Public License along
* with the Control Center; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*
*/
#include
"config.h"
#include
"ephy-search-provider.h"
#include
"ephy-file-helpers.h"
gint
main
(
gint
argc
,
gchar
**
argv
)
{
EphySearchProvider
*
search_provider
;
int
status
;
GError
*
error
=
NULL
;
if
(
!
ephy_file_helpers_init
(
NULL
,
0
,
&
error
))
{
g_printerr
(
"%s
\n
"
,
error
->
message
);
g_error_free
(
error
);
return
1
;
}
search_provider
=
ephy_search_provider_new
();
status
=
g_application_run
(
G_APPLICATION
(
search_provider
),
argc
,
argv
);
g_object_unref
(
search_provider
);
ephy_file_helpers_shutdown
();
return
status
;
}
src/ephy-search-provider.c
View file @
78e8d7f0
...
@@ -21,39 +21,36 @@
...
@@ -21,39 +21,36 @@
#include
"ephy-search-provider.h"
#include
"ephy-search-provider.h"
#include
"ephy-bookmarks.h"
#include
"ephy-completion-model.h"
#include
"ephy-completion-model.h"
#include
"ephy-file-helpers.h"
#include
"ephy-file-helpers.h"
#include
"ephy-history-service.h"
#include
"ephy-prefs.h"
#include
"ephy-prefs.h"
#include
"ephy-profile-utils.h"
#include
"ephy-profile-utils.h"
#include
"ephy-shell.h"
#include
<string.h>
#include
<string.h>
#include
<glib/gi18n.h>
#include
<glib/gi18n.h>
#include
<gio/gio.h>
#include
<gio/gio.h>
#include
<gio/gdesktopappinfo.h>
#include
<gio/gdesktopappinfo.h>
#include
<gtk/gtk.h>
#include
<gdk-pixbuf/gdk-pixbuf.h>
#include
<libsoup/soup.h>
#include
<libsoup/soup.h>
struct
_EphySearchProvider
struct
_EphySearchProvider
{
{
G
Object
parent
;
G
Application
parent
;
EphyShellSearchProvider2
*
skeleton
;
EphyShellSearchProvider2
*
skeleton
;
GCancellable
*
cancellable
;
GCancellable
*
cancellable
;
GSettings
*
settings
;
GSettings
*
settings
;
EphyHistoryService
*
history_service
;
EphyBookmarks
*
bookmarks
;
EphyCompletionModel
*
model
;
EphyCompletionModel
*
model
;
};
};
struct
_EphySearchProviderClass
struct
_EphySearchProviderClass
{
{
G
Object
Class
parent_class
;
G
Application
Class
parent_class
;
};
};
G_DEFINE_TYPE
(
EphySearchProvider
,
ephy_search_provider
,
G_TYPE_
OBJECT
);
G_DEFINE_TYPE
(
EphySearchProvider
,
ephy_search_provider
,
G_TYPE_
APPLICATION
)
static
void
static
void
on_model_updated
(
EphyHistoryService
*
service
,
on_model_updated
(
EphyHistoryService
*
service
,
...
@@ -139,7 +136,7 @@ complete_request (GObject *object,
...
@@ -139,7 +136,7 @@ complete_request (GObject *object,
g_dbus_method_invocation_take_error
(
user_data
,
error
);
g_dbus_method_invocation_take_error
(
user_data
,
error
);
}
}
g_application_release
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_release
(
G_APPLICATION
(
self
));
}
}
static
gboolean
static
gboolean
...
@@ -148,7 +145,7 @@ handle_get_initial_result_set (EphyShellSearchProvider2 *skeleton,
...
@@ -148,7 +145,7 @@ handle_get_initial_result_set (EphyShellSearchProvider2 *skeleton,
char
**
terms
,
char
**
terms
,
EphySearchProvider
*
self
)
EphySearchProvider
*
self
)
{
{
g_application_hold
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_hold
(
G_APPLICATION
(
self
));
g_cancellable_reset
(
self
->
cancellable
);
g_cancellable_reset
(
self
->
cancellable
);
gather_results_async
(
self
,
terms
,
self
->
cancellable
,
gather_results_async
(
self
,
terms
,
self
->
cancellable
,
...
@@ -164,7 +161,7 @@ handle_get_subsearch_result_set (EphyShellSearchProvider2 *skeleton,
...
@@ -164,7 +161,7 @@ handle_get_subsearch_result_set (EphyShellSearchProvider2 *skeleton,
char
**
terms
,
char
**
terms
,
EphySearchProvider
*
self
)
EphySearchProvider
*
self
)
{
{
g_application_hold
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_hold
(
G_APPLICATION
(
self
));
g_cancellable_reset
(
self
->
cancellable
);
g_cancellable_reset
(
self
->
cancellable
);
gather_results_async
(
self
,
terms
,
self
->
cancellable
,
gather_results_async
(
self
,
terms
,
self
->
cancellable
,
...
@@ -187,7 +184,7 @@ handle_get_result_metas (EphyShellSearchProvider2 *skeleton,
...
@@ -187,7 +184,7 @@ handle_get_result_metas (EphyShellSearchProvider2 *skeleton,
char
*
name
,
*
url
;
char
*
name
,
*
url
;
gboolean
is_bookmark
;
gboolean
is_bookmark
;
g_application_hold
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_hold
(
G_APPLICATION
(
self
));
g_cancellable_cancel
(
self
->
cancellable
);
g_cancellable_cancel
(
self
->
cancellable
);
g_variant_builder_init
(
&
builder
,
G_VARIANT_TYPE
(
"aa{sv}"
));
g_variant_builder_init
(
&
builder
,
G_VARIANT_TYPE
(
"aa{sv}"
));
...
@@ -258,7 +255,7 @@ handle_get_result_metas (EphyShellSearchProvider2 *skeleton,
...
@@ -258,7 +255,7 @@ handle_get_result_metas (EphyShellSearchProvider2 *skeleton,
invocation
,
invocation
,
g_variant_builder_end
(
&
builder
));
g_variant_builder_end
(
&
builder
));
g_application_release
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_release
(
G_APPLICATION
(
self
));
return
TRUE
;
return
TRUE
;
}
}
...
@@ -267,12 +264,12 @@ static void
...
@@ -267,12 +264,12 @@ static void
launch_uri
(
const
char
*
uri
,
launch_uri
(
const
char
*
uri
,
guint
timestamp
)
guint
timestamp
)
{
{
c
onst
char
*
uris
[
2
]
;
c
har
*
str
;
uris
[
0
]
=
uri
;
/* TODO: Handle the timestamp */
uris
[
1
]
=
NULL
;
str
=
g_strdup_printf
(
"epiphany %s"
,
uri
)
;
g_spawn_command_line_async
(
str
,
NULL
);
ephy_shell_open_uris
(
ephy_shell_get_default
(),
uris
,
0
,
timestamp
);
g_free
(
str
);
}
}
static
void
static
void
...
@@ -311,7 +308,7 @@ handle_activate_result (EphyShellSearchProvider2 *skeleton,
...
@@ -311,7 +308,7 @@ handle_activate_result (EphyShellSearchProvider2 *skeleton,
guint
timestamp
,
guint
timestamp
,
EphySearchProvider
*
self
)
EphySearchProvider
*
self
)
{
{
g_application_hold
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_hold
(
G_APPLICATION
(
self
));
g_cancellable_cancel
(
self
->
cancellable
);
g_cancellable_cancel
(
self
->
cancellable
);
if
(
strcmp
(
identifier
,
"special:search"
)
==
0
)
if
(
strcmp
(
identifier
,
"special:search"
)
==
0
)
...
@@ -320,7 +317,7 @@ handle_activate_result (EphyShellSearchProvider2 *skeleton,
...
@@ -320,7 +317,7 @@ handle_activate_result (EphyShellSearchProvider2 *skeleton,
launch_uri
(
identifier
,
timestamp
);
launch_uri
(
identifier
,
timestamp
);
ephy_shell_search_provider2_complete_activate_result
(
skeleton
,
invocation
);
ephy_shell_search_provider2_complete_activate_result
(
skeleton
,
invocation
);
g_application_release
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_release
(
G_APPLICATION
(
self
));
return
TRUE
;
return
TRUE
;
}
}
...
@@ -332,13 +329,13 @@ handle_launch_search (EphyShellSearchProvider2 *skeleton,
...
@@ -332,13 +329,13 @@ handle_launch_search (EphyShellSearchProvider2 *skeleton,
guint
timestamp
,
guint
timestamp
,
EphySearchProvider
*
self
)
EphySearchProvider
*
self
)
{
{
g_application_hold
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_hold
(
G_APPLICATION
(
self
));
g_cancellable_cancel
(
self
->
cancellable
);
g_cancellable_cancel
(
self
->
cancellable
);
launch_search
(
self
,
terms
,
timestamp
);
launch_search
(
self
,
terms
,
timestamp
);
ephy_shell_search_provider2_complete_launch_search
(
skeleton
,
invocation
);
ephy_shell_search_provider2_complete_launch_search
(
skeleton
,
invocation
);
g_application_release
(
G_APPLICATION
(
ephy_shell_get_default
()
));
g_application_release
(
G_APPLICATION
(
self
));
return
TRUE
;
return
TRUE
;
}
}
...
@@ -346,6 +343,10 @@ handle_launch_search (EphyShellSearchProvider2 *skeleton,
...
@@ -346,6 +343,10 @@ handle_launch_search (EphyShellSearchProvider2 *skeleton,
static
void
static
void
ephy_search_provider_init
(
EphySearchProvider
*
self
)
ephy_search_provider_init
(
EphySearchProvider
*
self
)
{
{
char
*
filename
;
g_application_set_flags
(
G_APPLICATION
(
self
),
G_APPLICATION_IS_SERVICE
);
self
->
skeleton
=
ephy_shell_search_provider2_skeleton_new
();
self
->
skeleton
=
ephy_shell_search_provider2_skeleton_new
();
g_signal_connect
(
self
->
skeleton
,
"handle-get-initial-result-set"
,
g_signal_connect
(
self
->
skeleton
,
"handle-get-initial-result-set"
,
...
@@ -361,35 +362,54 @@ ephy_search_provider_init (EphySearchProvider *self)
...
@@ -361,35 +362,54 @@ ephy_search_provider_init (EphySearchProvider *self)
self
->
settings
=
g_settings_new
(
EPHY_PREFS_SCHEMA
);
self
->
settings
=
g_settings_new
(
EPHY_PREFS_SCHEMA
);
self
->
model
=
ephy_completion_model_new
(
EPHY_HISTORY_SERVICE
(
ephy_embed_shell_get_global_history_service
(
ephy_embed_shell_get_default
())),
filename
=
g_build_filename
(
ephy_dot_dir
(),
EPHY_HISTORY_FILE
,
NULL
);
ephy_shell_get_bookmarks
(
ephy_shell_get_default
()));
self
->
history_service
=
ephy_history_service_new
(
filename
,
TRUE
);
self
->
bookmarks
=
ephy_bookmarks_new
();
self
->
model
=
ephy_completion_model_new
(
self
->
history_service
,
self
->
bookmarks
);
g_free
(
filename
);
self
->
cancellable
=
g_cancellable_new
();
self
->
cancellable
=
g_cancellable_new
();
}
}
gboolean
static
gboolean
ephy_search_provider_dbus_register
(
EphySearchProvider
*
self
,
ephy_search_provider_dbus_register
(
GApplication
*
application
,
GDBusConnection
*
connection
,
GDBusConnection
*
connection
,
const
gchar
*
object_path
,
const
gchar
*
object_path
,
GError
**
error
)
GError
**
error
)
{
{
EphySearchProvider
*
self
;
GDBusInterfaceSkeleton
*
skeleton
;
GDBusInterfaceSkeleton
*
skeleton
;
if
(
!
G_APPLICATION_CLASS
(
ephy_search_provider_parent_class
)
->
dbus_register
(
application
,
connection
,
object_path
,
error
))
return
FALSE
;
self
=
EPHY_SEARCH_PROVIDER
(
application
);
skeleton
=
G_DBUS_INTERFACE_SKELETON
(
self
->
skeleton
);
skeleton
=
G_DBUS_INTERFACE_SKELETON
(
self
->
skeleton
);
return
g_dbus_interface_skeleton_export
(
skeleton
,
connection
,
object_path
,
error
);
return
g_dbus_interface_skeleton_export
(
skeleton
,
connection
,
object_path
,
error
);
}
}
void
static
void
ephy_search_provider_dbus_unregister
(
EphySearchProvider
*
self
,
ephy_search_provider_dbus_unregister
(
GApplication
*
application
,
GDBusConnection
*
connection
,
GDBusConnection
*
connection
,
const
gchar
*
object_path
)
const
gchar
*
object_path
)
{
{
EphySearchProvider
*
self
;
GDBusInterfaceSkeleton
*
skeleton
;
GDBusInterfaceSkeleton
*
skeleton
;
self
=
EPHY_SEARCH_PROVIDER
(
application
);
skeleton
=
G_DBUS_INTERFACE_SKELETON
(
self
->
skeleton
);
skeleton
=
G_DBUS_INTERFACE_SKELETON
(
self
->
skeleton
);
if
(
g_dbus_interface_skeleton_has_connection
(
skeleton
,
connection
))
if
(
g_dbus_interface_skeleton_has_connection
(
skeleton
,
connection
))
g_dbus_interface_skeleton_unexport_from_connection
(
skeleton
,
connection
);
g_dbus_interface_skeleton_unexport_from_connection
(
skeleton
,
connection
);
g_clear_object
(
&
self
->
skeleton
);
G_APPLICATION_CLASS
(
ephy_search_provider_parent_class
)
->
dbus_unregister
(
application
,
connection
,
object_path
);
}
}
static
void
static
void
...
@@ -399,10 +419,11 @@ ephy_search_provider_dispose (GObject *object)
...
@@ -399,10 +419,11 @@ ephy_search_provider_dispose (GObject *object)
self
=
EPHY_SEARCH_PROVIDER
(
object
);
self
=
EPHY_SEARCH_PROVIDER
(
object
);
g_clear_object
(
&
self
->
skeleton
);
g_clear_object
(
&
self
->
settings
);
g_clear_object
(
&
self
->
settings
);
g_clear_object
(
&
self
->
cancellable
);
g_clear_object
(
&
self
->
cancellable
);
g_clear_object
(
&
self
->
model
);
g_clear_object
(
&
self
->
model
);
g_clear_object
(
&
self
->
history_service
);
g_clear_object
(
&
self
->
bookmarks
);
G_OBJECT_CLASS
(
ephy_search_provider_parent_class
)
->
dispose
(
object
);
G_OBJECT_CLASS
(
ephy_search_provider_parent_class
)
->
dispose
(
object
);
}
}
...
@@ -411,13 +432,19 @@ static void
...
@@ -411,13 +432,19 @@ static void
ephy_search_provider_class_init
(
EphySearchProviderClass
*
klass
)
ephy_search_provider_class_init
(
EphySearchProviderClass
*
klass
)
{
{
GObjectClass
*
object_class
=
G_OBJECT_CLASS
(
klass
);
GObjectClass
*
object_class
=
G_OBJECT_CLASS
(
klass
);
GApplicationClass
*
application_class
=
G_APPLICATION_CLASS
(
klass
);
object_class
->
dispose
=
ephy_search_provider_dispose
;
object_class
->
dispose
=
ephy_search_provider_dispose
;
application_class
->
dbus_register
=
ephy_search_provider_dbus_register
;
application_class
->
dbus_unregister
=
ephy_search_provider_dbus_unregister
;
}
}
EphySearchProvider
*
EphySearchProvider
*
ephy_search_provider_new
(
void
)
ephy_search_provider_new
(
void
)
{
{
return
g_object_new
(
EPHY_TYPE_SEARCH_PROVIDER
,
NULL
);
return
g_object_new
(
EPHY_TYPE_SEARCH_PROVIDER
,
"application-id"
,
"org.gnome.EpiphanySearchProvider"
,
NULL
);
}
}
src/ephy-search-provider.h
View file @
78e8d7f0
...
@@ -42,14 +42,6 @@ GType ephy_search_provider_get_type (void) G_GNUC_CONST;
...
@@ -42,14 +42,6 @@ GType ephy_search_provider_get_type (void) G_GNUC_CONST;
EphySearchProvider
*
ephy_search_provider_new
(
void
);
EphySearchProvider
*
ephy_search_provider_new
(
void
);
gboolean
ephy_search_provider_dbus_register
(
EphySearchProvider
*
provider
,
GDBusConnection
*
connection
,
const
char
*
object_path
,
GError
**
error
);
void
ephy_search_provider_dbus_unregister
(
EphySearchProvider
*
provider
,
GDBusConnection
*
connection
,
const
char
*
object_path
);
G_END_DECLS
G_END_DECLS
#endif
/* _EPHY_SEARCH_PROVIDER_H */
#endif
/* _EPHY_SEARCH_PROVIDER_H */
src/ephy-shell.c
View file @
78e8d7f0
...
@@ -35,7 +35,6 @@
...
@@ -35,7 +35,6 @@
#include
"ephy-lockdown.h"
#include
"ephy-lockdown.h"
#include
"ephy-prefs.h"
#include
"ephy-prefs.h"
#include
"ephy-private.h"
#include
"ephy-private.h"
#include
"ephy-search-provider.h"
#include
"ephy-session.h"
#include
"ephy-session.h"
#include
"ephy-settings.h"
#include
"ephy-settings.h"
#include
"ephy-type-builtins.h"
#include
"ephy-type-builtins.h"
...
@@ -54,7 +53,6 @@
...
@@ -54,7 +53,6 @@
#define EPHY_SHELL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SHELL, EphyShellPrivate))
#define EPHY_SHELL_GET_PRIVATE(object)(G_TYPE_INSTANCE_GET_PRIVATE ((object), EPHY_TYPE_SHELL, EphyShellPrivate))
struct
_EphyShellPrivate
{
struct
_EphyShellPrivate
{
EphySearchProvider
*
search_provider
;
EphySession
*
session
;
EphySession
*
session
;
GList
*
windows
;
GList
*
windows
;
GObject
*
lockdown
;
GObject
*
lockdown
;
...
@@ -518,42 +516,6 @@ ephy_shell_constructed (GObject *object)
...
@@ -518,42 +516,6 @@ ephy_shell_constructed (GObject *object)
G_OBJECT_CLASS
(
ephy_shell_parent_class
)
->
constructed
(
object
);
G_OBJECT_CLASS
(
ephy_shell_parent_class
)
->
constructed
(
object
);
}
}
static
gboolean
ephy_shell_dbus_register
(
GApplication
*
application
,
GDBusConnection
*
connection
,
const
gchar
*
object_path
,
GError
**
error
)
{
EphyShell
*
self
;
if
(
!
G_APPLICATION_CLASS
(
ephy_shell_parent_class
)
->
dbus_register
(
application
,
connection
,
object_path
,
error
))
return
FALSE
;
self
=
EPHY_SHELL
(
application
);
return
ephy_search_provider_dbus_register
(
self
->
priv
->
search_provider
,
connection
,
object_path
,
error
);
}
static
void
ephy_shell_dbus_unregister
(
GApplication
*
application
,
GDBusConnection
*
connection
,
const
gchar
*
object_path
)
{
EphyShell
*
self
;
self
=
EPHY_SHELL
(
application
);
if
(
self
->
priv
->
search_provider
)
ephy_search_provider_dbus_unregister
(
self
->
priv
->
search_provider
,
connection
,
object_path
);
G_APPLICATION_CLASS
(
ephy_shell_parent_class
)
->
dbus_unregister
(
application
,
connection
,
object_path
);
}
static
void
static
void
ephy_shell_class_init
(
EphyShellClass
*
klass
)
ephy_shell_class_init
(
EphyShellClass
*
klass
)
{
{
...
@@ -568,8 +530,6 @@ ephy_shell_class_init (EphyShellClass *klass)
...
@@ -568,8 +530,6 @@ ephy_shell_class_init (EphyShellClass *klass)
application_class
->
activate
=
ephy_shell_activate
;
application_class
->
activate
=
ephy_shell_activate
;
application_class
->
before_emit
=
ephy_shell_before_emit
;
application_class
->
before_emit
=
ephy_shell_before_emit
;
application_class
->
add_platform_data
=
ephy_shell_add_platform_data
;
application_class
->
add_platform_data
=
ephy_shell_add_platform_data
;
application_class
->
dbus_register
=
ephy_shell_dbus_register
;
application_class
->
dbus_unregister
=
ephy_shell_dbus_unregister
;
g_type_class_add_private
(
object_class
,
sizeof
(
EphyShellPrivate
));
g_type_class_add_private
(
object_class
,
sizeof
(
EphyShellPrivate
));
}
}
...
@@ -644,10 +604,6 @@ ephy_shell_init (EphyShell *shell)
...
@@ -644,10 +604,6 @@ ephy_shell_init (EphyShell *shell)
webkit_web_context_set_favicon_database_directory
(
web_context
,
favicon_db_path
);
webkit_web_context_set_favicon_database_directory
(
web_context
,
favicon_db_path
);
g_free
(
favicon_db_path
);
g_free
(
favicon_db_path
);
shell
->
priv
->
search_provider
=
ephy_search_provider_new
();
g_application_set_inactivity_timeout
(
G_APPLICATION
(
shell
),
60
*
1000
);
}
}
static
void
static
void
...
@@ -657,7 +613,6 @@ ephy_shell_dispose (GObject *object)
...
@@ -657,7 +613,6 @@ ephy_shell_dispose (GObject *object)
LOG
(
"EphyShell disposing"
);
LOG
(
"EphyShell disposing"
);
g_clear_object
(
&
priv
->
search_provider
);