[PATCH] build: Launch configure after autogen.sh
by Bastien Nocera
As is common amongst other autotools-based projects.
---
autogen.sh | 2 ++
1 file changed, 2 insertions(+)
diff --git a/autogen.sh b/autogen.sh
index 5468271..acdb621 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -68,3 +68,5 @@ case "$1" in
automake --add-missing --force --copy || exit 1
;;
esac
+
+./configure "$@"
--
2.1.0
9 years, 3 months
[PATCH] applet: Remove the automatic crash reporting message dialog
by Bastien Nocera
See https://github.com/abrt/gnome-abrt/issues/74#issuecomment-68704587
---
src/applet/applet.c | 63 -----------------------------------------------------
1 file changed, 63 deletions(-)
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 4f5d587..4d2949c 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -91,27 +91,6 @@ static bool is_autoreporting_enabled(void)
return ret;
}
-static bool is_ureport_auth_enabled(void)
-{
- bool success, auth_enabled;
- map_string_t *settings = new_map_string();
- char *ureport_conf_path = concat_path_file(LIBREPORT_PLUGINS_CONF_DIR, "ureport.conf");
-
- success = load_conf_file(ureport_conf_path, settings, /*skipKeysWithoutValue*/false);
- if (success)
- {
- const char *value = get_map_string_item_or_NULL(settings, "SSLClientAuth");
- auth_enabled = (value && value[0] != '\0');
- }
- else
- auth_enabled = true; /* assume it is, do not claim the reporting is anonymous */
-
- free(ureport_conf_path);
- free_map_string(settings);
-
- return auth_enabled;
-}
-
static const char *get_autoreport_event_name(void)
{
load_user_settings("abrt-applet");
@@ -119,45 +98,6 @@ static const char *get_autoreport_event_name(void)
return configured ? configured : g_settings_autoreporting_event;
}
-static void ask_start_autoreporting()
-{
- struct strbuf *question = strbuf_new();
- question = strbuf_append_str(question,
- _("The report which will be sent does not contain any security sensitive data. "
- "Therefore it is not necessary to bother you next time and require any further action by you. \n"));
-
- if (is_ureport_auth_enabled())
- {
- question = strbuf_append_str(question,
- _("Do you want to enable automatically submitted crash reports?"));
- }
- else
- {
- question = strbuf_append_str(question,
- _("Do you want to enable automatically submitted anonymous crash reports?"));
- }
-
- /* The "Yes" response will be saved even if user don't check the
- * "Don't ask me again" box.
- */
- const int ret = run_ask_yes_no_save_result_dialog("AutoreportingEnabled", question->buf,
- /*parent wnd */ NULL);
- strbuf_free(question);
-
- load_user_settings("abrt-applet");
-
- /* Don't forget:
- *
- * The "Yes" response will be saved even if user don't check the
- * "Don't ask me again" box.
- */
- if (ret != 0)
- set_user_setting("AutoreportingEnabled", "yes");
-
- /* must be called immediately, otherwise the data could be lost in case of crash */
- save_user_settings();
-}
-
static bool is_shortened_reporting_enabled()
{
return get_configured_bool_or_default("ShortenedReporting", g_settings_shortenedreporting);
@@ -597,9 +537,6 @@ static void action_report(NotifyNotification *notification, gchar *action, gpoin
}
else
{
- if (pi->foreign == false && strcmp(A_REPORT_AUTOREPORT, action) == 0)
- ask_start_autoreporting();
-
/* if shortened reporting is configured don't start reporting process
* when problem is unknown (just show notification) */
run_event_async(pi, get_autoreport_event_name(),
--
2.1.0
9 years, 3 months
[PATCH] applet: Use GNetworkMonitor instead of NM directly
by Bastien Nocera
GLib 2.44 (and development version 2.43) has support for checking the
connectivity level. This nicely replaces all the custom code that talked
to NetworkManager directly.
---
configure.ac | 2 +-
src/applet/applet.c | 146 ++++++----------------------------------------------
2 files changed, 16 insertions(+), 132 deletions(-)
diff --git a/configure.ac b/configure.ac
index d7e0ea5..436cfcd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -129,7 +129,7 @@ AC_SUBST(py3execdir, $PYTHON3_EXECDIR)
PKG_CHECK_MODULES([XICE], [ice])
PKG_CHECK_MODULES([XSMP], [sm])
PKG_CHECK_MODULES([GTK], [gtk+-3.0])
-PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.21])
+PKG_CHECK_MODULES([GLIB], [glib-2.0 >= 2.43])
PKG_CHECK_MODULES([DBUS], [dbus-1])
PKG_CHECK_MODULES([LIBXML], [libxml-2.0])
PKG_CHECK_MODULES([RPM], [rpm])
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 644da60..e5ac02a 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -38,14 +38,6 @@
#include "libabrt.h"
#include "problem_api.h"
-/* NetworkManager DBus configuration */
-#define NM_DBUS_SERVICE "org.freedesktop.NetworkManager"
-#define NM_DBUS_PATH "/org/freedesktop/NetworkManager"
-#define NM_DBUS_INTERFACE "org.freedesktop.NetworkManager"
-#define NM_STATE_CONNECTED_LOCAL 50
-#define NM_STATE_CONNECTED_SITE 60
-#define NM_STATE_CONNECTED_GLOBAL 70
-
/* libnotify action keys */
#define A_KNOWN_OPEN_GUI "OPEN"
#define A_REPORT_REPORT "REPORT"
@@ -67,7 +59,7 @@ enum
};
-static GDBusConnection *g_system_bus;
+static GNetworkMonitor *netmon;
static GtkStatusIcon *ap_status_icon;
static GtkWidget *ap_menu;
static char **s_dirs;
@@ -176,99 +168,11 @@ static bool is_notification_of_incomplete_problems_enabled(void)
return get_configured_bool_or_default("NotifyIncompleteProblems", 0);
}
-/*
- * Converts a NM state value stored in GVariant to boolean.
- *
- * Returns true if a state means connected.
- *
- * Sinks the args variant.
- */
-static bool nm_state_is_connected(GVariant *args)
-{
- GVariant *value = g_variant_get_child_value(args, 0);
-
- if (g_variant_is_of_type(value, G_VARIANT_TYPE_VARIANT))
- {
- GVariant *tmp = g_variant_get_child_value(value, 0);
- g_variant_unref(value);
- value = tmp;
- }
-
- int state = g_variant_get_uint32 (value);
-
- g_variant_unref(value);
- g_variant_unref(args);
-
- return state == NM_STATE_CONNECTED_GLOBAL
- || state == NM_STATE_CONNECTED_LOCAL
- || state == NM_STATE_CONNECTED_SITE;
-}
-
-/*
- * The function tries to get network state from NetworkManager over DBus
- * call. If NetworkManager DBus service is not available the function returns
- * true which means that network is enabled and up.
- *
- * Function must return true on any error, otherwise user won't be notified
- * about new problems. Because if network is not enabled, new problems are
- * pushed to the deferred queue. The deferred queue is processed immediately
- * after network becomes enabled. In case where NetworkManager is broken or not
- * available, notification about network state doesn't work thus the deferred
- * queue won't be ever processed.
- */
static bool is_networking_enabled(void)
{
- GError *error = NULL;
-
- /* Create a D-Bus proxy to get the object properties from the NM Manager
- * object.
- */
- const int flags = G_DBUS_PROXY_FLAGS_DO_NOT_LOAD_PROPERTIES
- | G_DBUS_PROXY_FLAGS_DO_NOT_CONNECT_SIGNALS;
-
- GDBusProxy *props_proxy = g_dbus_proxy_new_sync(g_system_bus,
- flags,
- NULL /* GDBusInterfaceInfo */,
- NM_DBUS_SERVICE,
- NM_DBUS_PATH,
- DBUS_INTERFACE_PROPERTIES,
- NULL /* GCancellable */,
- &error);
-
- if (!props_proxy)
- {
- /* The NetworkManager DBus service is not available. */
- error_msg (_("Can't connect to NetworkManager over DBus: %s"), error->message);
- g_error_free (error);
-
- /* Consider network state as connected. */
- return true;
- }
-
- /* Get the State property from the NM Manager object */
- GVariant *const value = g_dbus_proxy_call_sync (props_proxy,
- "Get",
- g_variant_new("(ss)", NM_DBUS_INTERFACE, "State"),
- G_DBUS_PROXY_FLAGS_NONE,
- -1 /* timeout: use proxy default */,
- NULL /* GCancellable */,
- &error);
-
- /* Consider network state as connected if any error occurs */
- bool ret = true;
-
- if (!error)
- /* Convert the state value and sink the variable */
- ret = nm_state_is_connected(value);
- else
- {
- error_msg (_("Can't determine network status via NetworkManager: %s"), error->message);
- g_error_free (error);
- }
-
- g_object_unref(props_proxy);
-
- return ret;
+ if (!g_network_monitor_get_network_available(netmon))
+ return FALSE;
+ return g_network_monitor_get_connectivity(netmon) == G_NETWORK_CONNECTIVITY_FULL;
}
static void show_problem_list_notification(GList *problems, int flags);
@@ -282,14 +186,12 @@ static gboolean process_deferred_queue_timeout_fn(GList *queue)
return FALSE;
}
-static void on_nm_state_changed(GDBusConnection *connection, const gchar *sender_name,
- const gchar *object_path, const gchar *interface_name,
- const gchar *signal_name, GVariant *parameters,
- gpointer user_data)
+static void connectivity_changed_cb(GObject *gobject,
+ GParamSpec *pspec,
+ gpointer user_data)
{
- g_variant_ref(parameters);
-
- if (nm_state_is_connected(parameters))
+ if (g_network_monitor_get_network_available(netmon) &&
+ g_network_monitor_get_connectivity(netmon) == G_NETWORK_CONNECTIVITY_FULL)
{
if (g_deferred_timeout)
g_source_remove(g_deferred_timeout);
@@ -1610,27 +1512,12 @@ int main(int argc, char** argv)
glib_init();
- /* Monitor 'StateChanged' signal on 'org.freedesktop.NetworkManager' interface */
- GError *error = NULL;
- g_system_bus = g_bus_get_sync(G_BUS_TYPE_SYSTEM, NULL, &error);
-
- if (g_system_bus == NULL)
- {
- error_msg("Error creating D-Bus proxy: %s\n", error->message);
- g_error_free(error);
- return -1;
- }
-
- const guint signal_ret = g_dbus_connection_signal_subscribe(g_system_bus,
- NM_DBUS_SERVICE,
- NM_DBUS_INTERFACE,
- "StateChanged",
- NM_DBUS_PATH,
- /* arg0 */ NULL,
- G_DBUS_SIGNAL_FLAGS_NONE,
- on_nm_state_changed,
- /* user_data */ NULL,
- /* user_data_free_func */ NULL);
+ /* Monitor NetworkManager state */
+ netmon = g_network_monitor_get_default ();
+ g_signal_connect (G_OBJECT (netmon), "notify::connectivity",
+ G_CALLBACK (connectivity_changed_cb), NULL);
+ g_signal_connect (G_OBJECT (netmon), "notify::network-available",
+ G_CALLBACK (connectivity_changed_cb), NULL);
g_set_prgname("abrt");
gtk_init(&argc, &argv);
@@ -1858,9 +1745,6 @@ next:
* save_user_settings();
*/
- g_dbus_connection_signal_unsubscribe(g_system_bus, signal_ret);
- g_object_unref(g_system_bus);
-
free(g_last_notified_problem_id);
return 0;
--
2.1.0
9 years, 3 months
[PATCH] applet: Remove pointless custom signal handling
by Bastien Nocera
None of the actions we're supposed to be taking after the main loop
should be necessary at that point in time. Let GTK+ handle that as it
should by exiting if the SIGTERM signal is sent.
---
src/applet/applet.c | 48 ------------------------------------------------
1 file changed, 48 deletions(-)
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 1aa8cfe..4f5d587 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -65,7 +65,6 @@ static GtkWidget *ap_menu;
static char **s_dirs;
static GList *g_deferred_crash_queue;
static guint g_deferred_timeout;
-static int g_signal_pipe[2];
static ignored_problems_t *g_ignore_set;
/* Used only for selection of the last notified problem if a user clicks on the systray icon */
static char *g_last_notified_problem_id;
@@ -1295,35 +1294,6 @@ static void die_if_dbus_error(bool error_flag, DBusError* err, const char* msg)
error_msg_and_die("%s", msg);
}
-static void handle_signal(int signo)
-{
- int save_errno = errno;
-
- // Enable for debugging only, malloc/printf are unsafe in signal handlers
- //log_debug("Got signal %d", signo);
-
- uint8_t sig_caught = signo;
- if (write(g_signal_pipe[1], &sig_caught, 1))
- /* we ignore result, if () shuts up stupid compiler */;
-
- errno = save_errno;
-}
-
-static gboolean handle_sigterm_pipe(GIOChannel *gio, GIOCondition condition, gpointer ptr_unused)
-{
- /* It can be only SIGTERM.
- * We are going to quit.
- * Therefore No read from the channel is necessary.
- */
-
- /* Next received SIGTERM will kill the applet. */
- signal(SIGTERM, SIG_DFL);
-
- gtk_main_quit();
-
- return FALSE; /* Pointless (loop is done and signal handler was reset); "please remove this event" */
-}
-
/*
* XSMP client
*/
@@ -1686,32 +1656,14 @@ next:
* the seen list.
*/
- /* Set up signal pipe */
- xpipe(g_signal_pipe);
- close_on_exec_on(g_signal_pipe[0]);
- close_on_exec_on(g_signal_pipe[1]);
- ndelay_on(g_signal_pipe[0]);
- ndelay_on(g_signal_pipe[1]);
- signal(SIGTERM, handle_signal);
- GIOChannel *channel_id_signal = my_io_channel_unix_new(g_signal_pipe[0]);
- g_io_add_watch(channel_id_signal,
- G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP | G_IO_NVAL,
- handle_sigterm_pipe,
- NULL);
-
/* Register a handler quiting from gtk main loop on X Session death.
*/
xsmp_client_connect();
/* Enter main loop
- *
- * Returns on SIGTERM signal, on menu button Quit click or on X Session
- * death.
*/
gtk_main();
- g_io_channel_unref(channel_id_signal);
-
ignored_problems_free(g_ignore_set);
#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 31)
--
2.1.0
9 years, 3 months
[PATCH] applet: Remove pre-glib 2.32 code
by Bastien Nocera
As we bumped the GLib requirements, there's no need to keep code
to support older versions.
---
src/applet/applet.c | 19 -------------------
1 file changed, 19 deletions(-)
diff --git a/src/applet/applet.c b/src/applet/applet.c
index 4d2949c..5778263 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -1409,21 +1409,6 @@ int main(int argc, char** argv)
#endif
abrt_init(argv);
- /* Glib 2.31:
- * Major changes to threading and synchronisation
- * - threading is now always enabled in GLib
- * - support for custom thread implementations (including our own internal
- * - support for errorcheck mutexes) has been removed
- */
-#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 31)
- //can't use log(), because g_verbose is not set yet
- /* Need to be thread safe */
- g_thread_init(NULL);
- gdk_threads_init();
- gdk_threads_enter();
-#endif
-
- glib_init();
/* Monitor NetworkManager state */
netmon = g_network_monitor_get_default ();
@@ -1603,10 +1588,6 @@ next:
ignored_problems_free(g_ignore_set);
-#if (GLIB_MAJOR_VERSION == 2 && GLIB_MINOR_VERSION < 31)
- gdk_threads_leave();
-#endif
-
/* new_dir_exists() is called for each notification and if user clicks on
* the abrt icon. Those calls cover 99.97% of detected crashes
*
--
2.1.0
9 years, 3 months
[PATCH] applet: Use GSettings to check whether to send uReports
by Bastien Nocera
Closes #107
---
configure.ac | 1 +
src/applet/applet.c | 8 +++++++-
2 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/configure.ac b/configure.ac
index 436cfcd..1e32ffe 100644
--- a/configure.ac
+++ b/configure.ac
@@ -141,6 +141,7 @@ PKG_CHECK_MODULES([POLKIT], [polkit-gobject-1])
PKG_CHECK_MODULES([GIO], [gio-2.0])
PKG_CHECK_MODULES([SATYR], [satyr])
PKG_CHECK_MODULES([SYSTEMD_JOURNAL], [libsystemd-journal])
+PKG_CHECK_MODULES([GSETTINGS_DESKTOP_SCHEMAS], [gsettings-desktop-schemas >= 3.15.1])
PKG_PROG_PKG_CONFIG
AC_ARG_WITH([systemdsystemunitdir],
diff --git a/src/applet/applet.c b/src/applet/applet.c
index e5ac02a..1aa8cfe 100644
--- a/src/applet/applet.c
+++ b/src/applet/applet.c
@@ -83,7 +83,13 @@ static bool get_configured_bool_or_default(const char *opt_name, bool def)
static bool is_autoreporting_enabled(void)
{
- return get_configured_bool_or_default("AutoreportingEnabled", g_settings_autoreporting);
+ GSettings *settings;
+ gboolean ret;
+
+ settings = g_settings_new ("org.gnome.desktop.privacy");
+ ret = g_settings_get_boolean (settings, "report-technical-problems");
+ g_object_unref (settings);
+ return ret;
}
static bool is_ureport_auth_enabled(void)
--
2.1.0
9 years, 3 months
[Bug 851210] [abrt] will-crash-0.2-1.fc17: main: Process /usr/bin/will_abort was killed by signal 6 (SIGABRT)
by Red Hat Bugzilla
https://bugzilla.redhat.com/show_bug.cgi?id=851210
--- Comment #24 from Fedora End Of Life <endoflife(a)fedoraproject.org> ---
This message is a notice that Fedora 19 is now at end of life. Fedora
has stopped maintaining and issuing updates for Fedora 19. It is
Fedora's policy to close all bug reports from releases that are no
longer maintained. Approximately 4 (four) weeks from now this bug will
be closed as EOL if it remains open with a Fedora 'version' of '19'.
Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.
Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 19 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.
Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.
--
You are receiving this mail because:
You reported the bug.
9 years, 3 months