From 2322c3ad083d73bbce4af7514db2567263e63a23 Mon Sep 17 00:00:00 2001 From: eidheim Date: Fri, 19 Aug 2016 10:32:53 +0200 Subject: [PATCH] Fixes #266, now checks for glibmm 2.45 before using FILE_MONITOR_WATCH_MOVES when monitoring directories --- src/directories.cc | 6 +----- src/git.cc | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/directories.cc b/src/directories.cc index 34af3a9..cad6bea 100644 --- a/src/directories.cc +++ b/src/directories.cc @@ -540,14 +540,10 @@ void Directories::add_or_update_path(const boost::filesystem::path &dir_path, co if(path_it==directories.end()) { auto g_file=Glib::wrap(g_file_new_for_path(dir_path.string().c_str())); //TODO: report missing constructor in giomm -#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__DragonFly__) - auto monitor=g_file->monitor_directory(Gio::FileMonitorFlags::FILE_MONITOR_SEND_MOVED); -#else -#if GLIBMM_MAJOR_VERSION>2 || (GLIBMM_MAJOR_VERSION==2 && GLIBMM_MINOR_VERSION>=44) +#if GLIBMM_MAJOR_VERSION>2 || (GLIBMM_MAJOR_VERSION==2 && GLIBMM_MINOR_VERSION>=45) auto monitor=g_file->monitor_directory(Gio::FileMonitorFlags::FILE_MONITOR_WATCH_MOVES); #else auto monitor=g_file->monitor_directory(Gio::FileMonitorFlags::FILE_MONITOR_SEND_MOVED); -#endif #endif auto path_and_row=std::make_shared >(dir_path, row); auto connection=std::make_shared(); diff --git a/src/git.cc b/src/git.cc index 018e82e..88dfab4 100644 --- a/src/git.cc +++ b/src/git.cc @@ -102,14 +102,10 @@ Git::Repository::Repository(const boost::filesystem::path &path) { auto git_path_str=boost::filesystem::canonical(get_path()).string(); auto git_directory=Glib::wrap(g_file_new_for_path(git_path_str.c_str())); //TODO: report missing constructor in giomm -#if defined(__OpenBSD__) || defined(__NetBSD__) || defined(__FreeBSD__) || defined(__Darwin__) || defined(__DragonFly__) - monitor=git_directory->monitor_directory(Gio::FileMonitorFlags::FILE_MONITOR_SEND_MOVED); -#else -#if GLIBMM_MAJOR_VERSION>2 || (GLIBMM_MAJOR_VERSION==2 && GLIBMM_MINOR_VERSION>=44) +#if GLIBMM_MAJOR_VERSION>2 || (GLIBMM_MAJOR_VERSION==2 && GLIBMM_MINOR_VERSION>=45) monitor=git_directory->monitor_directory(Gio::FileMonitorFlags::FILE_MONITOR_WATCH_MOVES); #else monitor=git_directory->monitor_directory(Gio::FileMonitorFlags::FILE_MONITOR_SEND_MOVED); -#endif #endif monitor_changed_connection=monitor->signal_changed().connect([this](const Glib::RefPtr &file,