[geany/geany-plugins] 87a640: workbench: removed compile-time checks
LarsDW223
git-noreply at xxxxx
Wed Mar 7 19:49:08 UTC 2018
Branch: refs/heads/master
Author: LarsDW223 <lars_paulsen at web.de>
Committer: LarsDW223 <lars_paulsen at web.de>
Date: Wed, 07 Mar 2018 19:49:08 UTC
Commit: 87a6400a159daaeed755b1765972f49604c1eeb2
https://github.com/geany/geany-plugins/commit/87a6400a159daaeed755b1765972f49604c1eeb2
Log Message:
-----------
workbench: removed compile-time checks
Modified Paths:
--------------
workbench/src/dialogs.c
workbench/src/wb_monitor.c
workbench/src/wb_monitor.h
workbench/src/wb_project.c
workbench/src/workbench.c
Modified: workbench/src/dialogs.c
9 lines changed, 0 insertions(+), 9 deletions(-)
===================================================================
@@ -440,19 +440,10 @@ gboolean dialogs_workbench_settings(WORKBENCH *workbench)
w_enable_live_update = gtk_check_button_new_with_mnemonic(_("_Enable live update"));
ui_table_add_row(GTK_TABLE(table), 1, w_enable_live_update, NULL);
-#ifdef __WB_LIVE_UPDATE
gtk_widget_set_tooltip_text(w_enable_live_update,
_("If the option is activated (default), then the list of files and the sidebar"
" will be updated automatically if a file or directory is created, removed or renamed."
"A manual re-scan is not required if the option is enabled."));
-#else
- gtk_widget_set_sensitive(w_enable_live_update, FALSE);
- gtk_widget_set_tooltip_text(w_enable_live_update,
- _("If the option is activated (default), then the list of files and the sidebar"
- " will be updated automatically if a file or directory is created, removed or renamed."
- "A manual re-scan is not required if the option is enabled.\n\n"
- "This feature has been disabled because it is not available on your system."));
-#endif
enable_live_update_old = workbench_get_enable_live_update(workbench);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(w_enable_live_update), enable_live_update_old);
Modified: workbench/src/wb_monitor.c
2 lines changed, 0 insertions(+), 2 deletions(-)
===================================================================
@@ -31,7 +31,6 @@
#include "wb_monitor.h"
#include "utils.h"
-#ifdef __WB_LIVE_UPDATE
struct S_WB_MONITOR
{
@@ -247,4 +246,3 @@ void wb_monitor_free(WB_MONITOR *monitor)
}
}
}
-#endif
Modified: workbench/src/wb_monitor.h
6 lines changed, 0 insertions(+), 6 deletions(-)
===================================================================
@@ -22,18 +22,12 @@
#include <glib.h>
#include "wb_project.h"
-#if defined(HAVE_GIO)
-#define __WB_LIVE_UPDATE 1
-#endif
-
typedef struct S_WB_MONITOR WB_MONITOR;
-#ifdef __WB_LIVE_UPDATE
WB_MONITOR *wb_monitor_new(void);
void wb_monitor_add_dir(WB_MONITOR *monitor, WB_PROJECT *prj,
WB_PROJECT_DIR *dir, const gchar *dirpath);
gboolean wb_monitor_remove_dir(WB_MONITOR *monitor, const gchar *dirpath);
void wb_monitor_free(WB_MONITOR *monitor);
-#endif
#endif
Modified: workbench/src/wb_project.c
10 lines changed, 0 insertions(+), 10 deletions(-)
===================================================================
@@ -569,7 +569,6 @@ static guint wb_project_dir_rescan_int(WB_PROJECT *prj, WB_PROJECT_DIR *root)
/* Add a new file to the project directory and update the sidebar. */
-#ifdef __WB_LIVE_UPDATE
static void wb_project_dir_add_file_int(WB_PROJECT *prj, WB_PROJECT_DIR *root, const gchar *filepath)
{
gboolean matches;
@@ -634,7 +633,6 @@ static void wb_project_dir_add_file_int(WB_PROJECT *prj, WB_PROJECT_DIR *root, c
g_slist_free(scanned);
}
}
-#endif
/** Add a new file to the project directory and update the sidebar.
@@ -646,19 +644,16 @@ static void wb_project_dir_add_file_int(WB_PROJECT *prj, WB_PROJECT_DIR *root, c
* @param filepath The file to add.
*
**/
-#ifdef __WB_LIVE_UPDATE
void wb_project_dir_add_file(WB_PROJECT *prj, WB_PROJECT_DIR *root, const gchar *filepath)
{
wb_project_dir_add_file_int(prj, root, filepath);
wb_project_add_idle_action(WB_PROJECT_IDLE_ACTION_ID_UPDATE_TAGS,
root, NULL);
}
-#endif
/* Check if the filepath is equal for the length of the directory path in px_temp */
-#ifdef __WB_LIVE_UPDATE
static gboolean wb_project_dir_remove_child (gpointer key, gpointer value, gpointer user_data)
{
WB_PROJECT_TEMP_DATA *px_temp;
@@ -680,7 +675,6 @@ static gboolean wb_project_dir_remove_child (gpointer key, gpointer value, gpoin
}
return FALSE;
}
-#endif
/** Remove a file from the project directory and update the sidebar.
@@ -692,7 +686,6 @@ static gboolean wb_project_dir_remove_child (gpointer key, gpointer value, gpoin
* @param filepath The file to remove.
*
**/
-#ifdef __WB_LIVE_UPDATE
void wb_project_dir_remove_file(WB_PROJECT *prj, WB_PROJECT_DIR *root, const gchar *filepath)
{
gboolean matches, was_dir;
@@ -768,7 +761,6 @@ void wb_project_dir_remove_file(WB_PROJECT *prj, WB_PROJECT_DIR *root, const gch
}
}
}
-#endif
/* Stolen and modified version from Geany. The only difference is that Geany
@@ -932,7 +924,6 @@ void wb_project_rescan(WB_PROJECT *prj)
}
/* Create file monitors for directories. */
-#ifdef __WB_LIVE_UPDATE
if (workbench_get_enable_live_update(wb_globals.opened_wb) == TRUE)
{
WB_MONITOR *monitor;
@@ -962,7 +953,6 @@ void wb_project_rescan(WB_PROJECT *prj)
}
}
}
-#endif
}
Modified: workbench/src/workbench.c
14 lines changed, 0 insertions(+), 14 deletions(-)
===================================================================
@@ -92,9 +92,7 @@ WORKBENCH *workbench_new(void)
new_wb->enable_live_update = TRUE;
new_wb->projects = g_ptr_array_new();
new_wb->bookmarks = g_ptr_array_new();
-#ifdef __WB_LIVE_UPDATE
new_wb->monitor = wb_monitor_new();
-#endif
return new_wb;
}
@@ -125,9 +123,7 @@ void workbench_free(WORKBENCH *wb)
}
}
-#ifdef __WB_LIVE_UPDATE
wb_monitor_free(wb->monitor);
-#endif
g_ptr_array_free (wb->projects, TRUE);
g_free(wb);
}
@@ -920,7 +916,6 @@ static gboolean workbench_references_are_valid(WORKBENCH *wb, WB_PROJECT *prj, W
* @param file The new file to add to project/directory
*
**/
-#ifdef __WB_LIVE_UPDATE
void workbench_process_add_file_event(WORKBENCH *wb, WB_PROJECT *prj, WB_PROJECT_DIR *dir, const gchar *file)
{
if (workbench_references_are_valid(wb, prj, dir) == FALSE)
@@ -933,7 +928,6 @@ void workbench_process_add_file_event(WORKBENCH *wb, WB_PROJECT *prj, WB_PROJECT
wb_project_dir_add_file(prj, dir, file);
}
-#endif
/** Process the remove file event.
@@ -948,7 +942,6 @@ void workbench_process_add_file_event(WORKBENCH *wb, WB_PROJECT *prj, WB_PROJECT
* @param file The file to remove from project/directory
*
**/
-#ifdef __WB_LIVE_UPDATE
void workbench_process_remove_file_event(WORKBENCH *wb, WB_PROJECT *prj, WB_PROJECT_DIR *dir, const gchar *file)
{
if (workbench_references_are_valid(wb, prj, dir) == FALSE)
@@ -961,11 +954,9 @@ void workbench_process_remove_file_event(WORKBENCH *wb, WB_PROJECT *prj, WB_PROJ
wb_project_dir_remove_file(prj, dir, file);
}
-#endif
/* Foreach callback function for creating file monitors. */
-#ifdef __WB_LIVE_UPDATE
static void workbench_enable_live_update_foreach_cb(SIDEBAR_CONTEXT *context,
gpointer userdata)
{
@@ -995,7 +986,6 @@ static void workbench_enable_live_update_foreach_cb(SIDEBAR_CONTEXT *context,
g_free(abs_path);
}
-#endif
/** Enable live update.
@@ -1008,15 +998,13 @@ static void workbench_enable_live_update_foreach_cb(SIDEBAR_CONTEXT *context,
**/
void workbench_enable_live_update(WORKBENCH *wb)
{
-#ifdef __WB_LIVE_UPDATE
if (wb != NULL)
{
sidebar_call_foreach(DATA_ID_DIRECTORY,
workbench_enable_live_update_foreach_cb, wb->monitor);
sidebar_call_foreach(DATA_ID_SUB_DIRECTORY,
workbench_enable_live_update_foreach_cb, wb->monitor);
}
-#endif
}
@@ -1030,10 +1018,8 @@ void workbench_enable_live_update(WORKBENCH *wb)
**/
void workbench_disable_live_update(WORKBENCH *wb)
{
-#ifdef __WB_LIVE_UPDATE
if (wb != NULL)
{
wb_monitor_free(wb->monitor);
}
-#endif
}
--------------
This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).
More information about the Plugins-Commits
mailing list