mirror of
https://git.pwmt.org/pwmt/zathura.git
synced 2024-11-10 21:33:45 +01:00
Add debug output
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
This commit is contained in:
parent
b93ebeb327
commit
b85e8c389f
@ -3,6 +3,7 @@
|
||||
#include "file-monitor-glib.h"
|
||||
#include "macros.h"
|
||||
|
||||
#include <girara/utils.h>
|
||||
#include <gio/gio.h>
|
||||
|
||||
struct zathura_glibfilemonitor_s
|
||||
@ -16,15 +17,20 @@ G_DEFINE_TYPE(ZathuraGLibFileMonitor, zathura_glibfilemonitor,
|
||||
ZATHURA_TYPE_FILEMONITOR)
|
||||
|
||||
static void
|
||||
file_changed(GFileMonitor* UNUSED(monitor), GFile* UNUSED(file),
|
||||
file_changed(GFileMonitor* UNUSED(monitor), GFile* file,
|
||||
GFile* UNUSED(other_file), GFileMonitorEvent event,
|
||||
ZathuraGLibFileMonitor* file_monitor)
|
||||
{
|
||||
switch (event) {
|
||||
case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
|
||||
case G_FILE_MONITOR_EVENT_CREATED:
|
||||
case G_FILE_MONITOR_EVENT_CREATED: {
|
||||
char* uri = g_file_get_uri(file);
|
||||
girara_debug("received file-monitor event for %s", uri);
|
||||
g_free(uri);
|
||||
|
||||
g_signal_emit_by_name(file_monitor, "reload-file");
|
||||
break;
|
||||
}
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
#include "file-monitor-signal.h"
|
||||
|
||||
#include <girara/utils.h>
|
||||
#ifdef G_OS_UNIX
|
||||
#include <glib-unix.h>
|
||||
#endif
|
||||
@ -24,6 +25,7 @@ signal_handler(gpointer data)
|
||||
|
||||
ZathuraSignalFileMonitor* signalfilemonitor = data;
|
||||
|
||||
girara_debug("SIGHUP received");
|
||||
g_signal_emit_by_name(signalfilemonitor, "reload-file");
|
||||
|
||||
return TRUE;
|
||||
|
@ -127,11 +127,13 @@ zathura_filemonitor_new(const char* file_path,
|
||||
GObject* ret = NULL;
|
||||
switch (filemonitor_type) {
|
||||
case ZATHURA_FILEMONITOR_GLIB:
|
||||
girara_debug("using glib file monitor");
|
||||
ret = g_object_new(ZATHURA_TYPE_GLIBFILEMONITOR, "file-path", file_path,
|
||||
NULL);
|
||||
break;
|
||||
#ifdef G_OS_UNIX
|
||||
case ZATHURA_FILEMONITOR_SIGNAL:
|
||||
girara_debug("using SIGHUB file monitor");
|
||||
ret = g_object_new(ZATHURA_TYPE_SIGNALFILEMONITOR, "file-path", file_path,
|
||||
NULL);
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user