summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPablo Barciela <[email protected]>2019-03-09 15:26:57 +0100
committerlukefromdc <[email protected]>2019-04-10 21:53:31 +0000
commit203399fc4969ea512c96592ec6a22218015f4fbd (patch)
tree8917d69c9c64996daef288a47214d9d6f5e5d511
parente50549cf502f988ff214a2714a8cdd6fb6892244 (diff)
downloadcaja-203399fc4969ea512c96592ec6a22218015f4fbd.tar.bz2
caja-203399fc4969ea512c96592ec6a22218015f4fbd.tar.xz
drop functions defined but not used
-rw-r--r--eel/eel-canvas-rect-ellipse.c39
-rw-r--r--libcaja-private/caja-program-choosing.c9
-rw-r--r--src/caja-application.c224
-rw-r--r--src/caja-information-panel.c156
-rw-r--r--src/caja-main.c14
-rw-r--r--src/caja-navigation-window-menus.c10
-rw-r--r--src/caja-notebook.c19
-rw-r--r--src/caja-window.c40
8 files changed, 0 insertions, 511 deletions
diff --git a/eel/eel-canvas-rect-ellipse.c b/eel/eel-canvas-rect-ellipse.c
index 95d7c454..7538244f 100644
--- a/eel/eel-canvas-rect-ellipse.c
+++ b/eel/eel-canvas-rect-ellipse.c
@@ -201,45 +201,6 @@ eel_canvas_re_init (EelCanvasRE *re)
re->width = 0.0;
}
-static void get_bounds (EelCanvasRE *re, double *px1, double *py1, double *px2, double *py2)
-{
- EelCanvasItem *item;
- double x1, y1, x2, y2;
- int cx1, cy1, cx2, cy2;
- double hwidth;
-
-#ifdef VERBOSE
- g_print ("re get_bounds\n");
-#endif
- item = EEL_CANVAS_ITEM (re);
-
- if (re->width_pixels)
- hwidth = (re->width / item->canvas->pixels_per_unit) / 2.0;
- else
- hwidth = re->width / 2.0;
-
- x1 = re->x1;
- y1 = re->y1;
- x2 = re->x2;
- y2 = re->y2;
-
- eel_canvas_item_i2w (item, &x1, &y1);
- eel_canvas_item_i2w (item, &x2, &y2);
- eel_canvas_w2c (item->canvas, x1 - hwidth, y1 - hwidth, &cx1, &cy1);
- eel_canvas_w2c (item->canvas, x2 + hwidth, y2 + hwidth, &cx2, &cy2);
- *px1 = cx1;
- *py1 = cy1;
- *px2 = cx2;
- *py2 = cy2;
-
- /* Some safety fudging */
-
- *px1 -= 2;
- *py1 -= 2;
- *px2 += 2;
- *py2 += 2;
-}
-
static void
eel_canvas_re_set_fill (EelCanvasRE *re, gboolean fill_set)
{
diff --git a/libcaja-private/caja-program-choosing.c b/libcaja-private/caja-program-choosing.c
index 5efdb7ec..13a0fbad 100644
--- a/libcaja-private/caja-program-choosing.c
+++ b/libcaja-private/caja-program-choosing.c
@@ -168,15 +168,6 @@ caja_launch_application (GAppInfo *application,
g_list_free_full (uris, g_free);
}
-/*
- * Set the DISPLAY variable, to be use by g_spawn_async.
- */
-static void
-set_environment (gpointer display)
-{
- g_setenv("DISPLAY", display, TRUE);
-}
-
static void
dummy_child_watch (GPid pid,
gint status,
diff --git a/src/caja-application.c b/src/caja-application.c
index 85285304..62873184 100644
--- a/src/caja-application.c
+++ b/src/caja-application.c
@@ -619,183 +619,6 @@ automount_all_volumes_idle_cb (gpointer data)
}
static void
-check_volume_queue (CajaApplication *application)
-{
- GList *l, *next;
- GVolume *volume;
-
- l = application->volume_queue;
-
- if (application->screensaver_active)
- {
- return;
- }
-
- while (l != NULL) {
- volume = l->data;
- next = l->next;
-
- caja_file_operations_mount_volume (NULL, volume, TRUE);
- application->volume_queue =
- g_list_remove (application->volume_queue, volume);
-
- g_object_unref (volume);
- l = next;
- }
-
- application->volume_queue = NULL;
-}
-
-#define SCREENSAVER_NAME "org.mate.ScreenSaver"
-#define SCREENSAVER_PATH "/org/mate/ScreenSaver"
-#define SCREENSAVER_INTERFACE "org.mate.ScreenSaver"
-
-static void
-screensaver_signal_callback (GDBusProxy *proxy,
- const gchar *sender_name,
- const gchar *signal_name,
- GVariant *parameters,
- gpointer user_data)
-{
- CajaApplication *application = user_data;
-
- if (g_strcmp0 (signal_name, "ActiveChanged") == 0)
- {
- g_variant_get (parameters, "(b)", &application->screensaver_active);
- g_debug ("Screensaver active changed to %d", application->screensaver_active);
-
- check_volume_queue (application);
- }
-}
-
-static void
-screensaver_get_active_ready_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
-{
- CajaApplication *application = user_data;
- GDBusProxy *proxy = application->ss_proxy;
- GVariant *result;
- GError *error = NULL;
-
- result = g_dbus_proxy_call_finish (proxy,
- res,
- &error);
-
- if (error != NULL) {
- g_warning ("Can't call GetActive() on the ScreenSaver object: %s",
- error->message);
- g_error_free (error);
-
- return;
- }
-
- g_variant_get (result, "(b)", &application->screensaver_active);
- g_variant_unref (result);
-
- g_debug ("Screensaver GetActive() returned %d", application->screensaver_active);
-}
-
-static void
-screensaver_proxy_ready_cb (GObject *source,
- GAsyncResult *res,
- gpointer user_data)
-{
- CajaApplication *application = user_data;
- GError *error = NULL;
- GDBusProxy *ss_proxy;
-
- ss_proxy = g_dbus_proxy_new_finish (res, &error);
-
- if (error != NULL)
- {
- g_warning ("Can't get proxy for the ScreenSaver object: %s",
- error->message);
- g_error_free (error);
-
- return;
- }
-
- g_debug ("ScreenSaver proxy ready");
-
- application->ss_proxy = ss_proxy;
-
- g_signal_connect (ss_proxy, "g-signal",
- G_CALLBACK (screensaver_signal_callback), application);
-
- g_dbus_proxy_call (ss_proxy,
- "GetActive",
- NULL,
- G_DBUS_CALL_FLAGS_NO_AUTO_START,
- -1,
- NULL,
- screensaver_get_active_ready_cb,
- application);
-}
-
-static void
-screensaver_appeared_callback (GDBusConnection *connection,
- const gchar *name,
- const gchar *name_owner,
- gpointer user_data)
-{
- CajaApplication *application = user_data;
-
- g_debug ("ScreenSaver name appeared");
-
- application->screensaver_active = FALSE;
-
- g_dbus_proxy_new (connection,
- G_DBUS_PROXY_FLAGS_DO_NOT_AUTO_START,
- NULL,
- name,
- SCREENSAVER_PATH,
- SCREENSAVER_INTERFACE,
- NULL,
- screensaver_proxy_ready_cb,
- application);
-}
-
-static void
-screensaver_vanished_callback (GDBusConnection *connection,
- const gchar *name,
- gpointer user_data)
-{
- CajaApplication *application = user_data;
-
- g_debug ("ScreenSaver name vanished");
-
- application->screensaver_active = FALSE;
- if (application->ss_proxy != NULL)
- {
- g_object_unref (application->ss_proxy);
- application->ss_proxy = NULL;
- }
-
- /* in this case force a clear of the volume queue, without
- * mounting them.
- */
- if (application->volume_queue != NULL)
- {
- g_list_free_full (application->volume_queue, g_object_unref);
- application->volume_queue = NULL;
- }
-}
-
-static void
-do_initialize_screensaver (CajaApplication *application)
-{
- application->ss_watch_id =
- g_bus_watch_name (G_BUS_TYPE_SESSION,
- SCREENSAVER_NAME,
- G_BUS_NAME_WATCHER_FLAGS_NONE,
- screensaver_appeared_callback,
- screensaver_vanished_callback,
- application,
- NULL);
-}
-
-static void
selection_get_cb (GtkWidget *widget,
GtkSelectionData *selection_data,
guint info,
@@ -1548,53 +1371,6 @@ mount_removed_callback (GVolumeMonitor *monitor,
}
static char *
-icon_to_string (GIcon *icon)
-{
- const char * const *names;
- GFile *file;
-
- if (icon == NULL)
- {
- return NULL;
- }
- else if (G_IS_THEMED_ICON (icon))
- {
- names = g_themed_icon_get_names (G_THEMED_ICON (icon));
- return g_strjoinv (":", (char **)names);
- }
- else if (G_IS_FILE_ICON (icon))
- {
- file = g_file_icon_get_file (G_FILE_ICON (icon));
- return g_file_get_path (file);
- }
- return NULL;
-}
-
-static GIcon *
-icon_from_string (const char *string)
-{
- GFile *file;
- GIcon *icon;
- gchar **names;
-
- if (g_path_is_absolute (string))
- {
- file = g_file_new_for_path (string);
- icon = g_file_icon_new (file);
- g_object_unref (file);
- return icon;
- }
- else
- {
- names = g_strsplit (string, ":", 0);
- icon = g_themed_icon_new_from_names (names, -1);
- g_strfreev (names);
- return icon;
- }
- return NULL;
-}
-
-static char *
caja_application_get_session_data (CajaApplication *self)
{
xmlDocPtr doc;
diff --git a/src/caja-information-panel.c b/src/caja-information-panel.c
index e1d0fe73..2beae1c9 100644
--- a/src/caja-information-panel.c
+++ b/src/caja-information-panel.c
@@ -698,162 +698,6 @@ caja_information_panel_press_event (GtkWidget *widget, GdkEventButton *event)
return TRUE;
}
-static gboolean
-value_different (const char *a, const char *b)
-{
- if (!a && !b)
- return FALSE;
-
- if (!a || !b)
- return TRUE;
-
- return strcmp (a, b);
-}
-
-/* Handle the background changed signal by writing out the settings to metadata.
- */
-static void
-background_settings_changed_callback (EelBackground *background, GdkDragAction action, CajaInformationPanel *information_panel)
-{
- char *image;
- char *color;
-
- g_assert (EEL_IS_BACKGROUND (background));
- g_assert (CAJA_IS_INFORMATION_PANEL (information_panel));
-
- if (information_panel->details->file == NULL)
- {
- return;
- }
-
- /* Block so we don't respond to our own metadata changes.
- */
- g_signal_handlers_block_by_func (information_panel->details->file,
- G_CALLBACK (background_metadata_changed_callback),
- information_panel);
-
- color = eel_background_get_color (background);
- image = eel_background_get_image_uri (background);
-
- if (action != (GdkDragAction) CAJA_DND_ACTION_SET_AS_BACKGROUND)
- {
- caja_file_set_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR,
- NULL,
- NULL);
-
- caja_file_set_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE,
- NULL,
- NULL);
-
- g_signal_handlers_block_by_func (caja_preferences,
- G_CALLBACK(caja_information_panel_theme_changed),
- information_panel);
- g_settings_set_string (caja_preferences,
- CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_COLOR, color ? color : "");
- g_settings_set_string (caja_preferences,
- CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_URI, image ? image : "");
- g_settings_set_boolean (caja_preferences,
- CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, TRUE);
- g_signal_handlers_unblock_by_func (caja_preferences,
- G_CALLBACK(caja_information_panel_theme_changed),
- information_panel);
- }
- else
- {
- caja_file_set_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR,
- NULL,
- color);
-
- caja_file_set_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE,
- NULL,
- image);
- }
-
- if (value_different (information_panel->details->current_background_color, color))
- {
- g_free (information_panel->details->current_background_color);
- information_panel->details->current_background_color = g_strdup (color);
- }
-
- if (value_different (information_panel->details->current_background_image, image))
- {
- g_free (information_panel->details->current_background_image);
- information_panel->details->current_background_image = g_strdup (image);
- }
-
- g_free (color);
- g_free (image);
-
- g_signal_handlers_unblock_by_func (information_panel->details->file,
- G_CALLBACK (background_metadata_changed_callback),
- information_panel);
-}
-
-/* handle the background reset signal by writing out NULL to metadata and setting the backgrounds
- fields to their default values */
-static void
-background_reset_callback (EelBackground *background, CajaInformationPanel *information_panel)
-{
- char *color;
- char *image;
- g_assert (EEL_IS_BACKGROUND (background));
- g_assert (CAJA_IS_INFORMATION_PANEL (information_panel));
-
- if (information_panel->details->file == NULL)
- {
- return;
- }
-
- /* Block so we don't respond to our own metadata changes.
- */
- g_signal_handlers_block_by_func (information_panel->details->file,
- G_CALLBACK (background_metadata_changed_callback),
- information_panel);
-
- color = caja_file_get_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR,
- NULL);
-
- image = caja_file_get_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE,
- NULL);
- if (color || image)
- {
- caja_file_set_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_COLOR,
- NULL,
- NULL);
-
- caja_file_set_metadata (information_panel->details->file,
- CAJA_METADATA_KEY_SIDEBAR_BACKGROUND_IMAGE,
- NULL,
- NULL);
- }
- else
- {
- g_signal_handlers_block_by_func (caja_preferences,
- G_CALLBACK(caja_information_panel_theme_changed),
- information_panel);
- g_settings_set_boolean (caja_preferences,
- CAJA_PREFERENCES_SIDE_PANE_BACKGROUND_SET, FALSE);
- g_signal_handlers_unblock_by_func (caja_preferences,
- G_CALLBACK(caja_information_panel_theme_changed),
- information_panel);
- }
-
- g_signal_handlers_unblock_by_func (information_panel->details->file,
- G_CALLBACK (background_metadata_changed_callback),
- information_panel);
-
- /* Force a read from the metadata to set the defaults
- */
- background_metadata_changed_callback (information_panel);
-}
-
static GtkWindow *
caja_information_panel_get_window (CajaInformationPanel *information_panel)
{
diff --git a/src/caja-main.c b/src/caja-main.c
index 10914246..8d6c24dd 100644
--- a/src/caja-main.c
+++ b/src/caja-main.c
@@ -219,20 +219,6 @@ setup_debug_log (void)
setup_debug_log_glog ();
}
-static gboolean
-running_in_mate (void)
-{
- return (g_strcmp0 (g_getenv ("XDG_CURRENT_DESKTOP"), "MATE") == 0)
- || (g_strcmp0 (g_getenv ("XDG_SESSION_DESKTOP"), "mate") == 0)
- || (g_strcmp0 (g_getenv ("DESKTOP_SESSION"), "mate") == 0);
-}
-
-static gboolean
-running_as_root (void)
-{
- return geteuid () == 0;
-}
-
int
main (int argc, char *argv[])
{
diff --git a/src/caja-navigation-window-menus.c b/src/caja-navigation-window-menus.c
index 0769119c..e9d822c0 100644
--- a/src/caja-navigation-window-menus.c
+++ b/src/caja-navigation-window-menus.c
@@ -436,16 +436,6 @@ connect_proxy_cb (GtkActionGroup *action_group,
gtk_label_set_max_width_chars (label, MENU_ITEM_MAX_WIDTH_CHARS);
}
-static const char* icon_entries[] =
-{
- "/MenuBar/Other Menus/Go/Home",
- "/MenuBar/Other Menus/Go/Computer",
- "/MenuBar/Other Menus/Go/Go to Templates",
- "/MenuBar/Other Menus/Go/Go to Trash",
- "/MenuBar/Other Menus/Go/Go to Network",
- "/MenuBar/Other Menus/Go/Go to Location"
-};
-
/**
* refresh_go_menu:
*
diff --git a/src/caja-notebook.c b/src/caja-notebook.c
index 8bdaab8e..ac6727f4 100644
--- a/src/caja-notebook.c
+++ b/src/caja-notebook.c
@@ -51,12 +51,6 @@ static int caja_notebook_insert_page (GtkNotebook *notebook,
static void caja_notebook_remove (GtkContainer *container,
GtkWidget *tab_widget);
-static const GtkTargetEntry url_drag_types[] =
-{
- { CAJA_ICON_DND_MATE_ICON_LIST_TYPE, 0, CAJA_ICON_DND_MATE_ICON_LIST },
- { CAJA_ICON_DND_URI_LIST_TYPE, 0, CAJA_ICON_DND_URI_LIST },
-};
-
enum
{
TAB_CLOSE_REQUEST,
@@ -183,19 +177,6 @@ caja_notebook_init (CajaNotebook *notebook)
g_signal_connect (notebook, "button-press-event",
(GCallback)button_press_cb, NULL);
-
- /* Set up drag-and-drop target */
- /* TODO this would be used for opening a new tab.
- * It will only work properly as soon as GtkNotebook
- * supports to find out whether a particular point
- * is on a tab button or not.
- */
-#if 0
- gtk_drag_dest_set (GTK_WIDGET (notebook), 0,
- url_drag_types, G_N_ELEMENTS (url_drag_types),
- GDK_ACTION_LINK);
- gtk_drag_dest_set_track_motion (GTK_WIDGET (notebook), TRUE);
-#endif
}
void
diff --git a/src/caja-window.c b/src/caja-window.c
index 5f29cbbe..c95870f9 100644
--- a/src/caja-window.c
+++ b/src/caja-window.c
@@ -984,46 +984,6 @@ caja_window_slot_close (CajaWindowSlot *slot)
}
static void
-caja_window_size_request (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- GdkScreen *screen;
- guint max_width;
- guint max_height;
-
- g_assert (CAJA_IS_WINDOW (widget));
- g_assert (requisition != NULL);
-
- screen = gtk_window_get_screen (GTK_WINDOW (widget));
-
- /* Limit the requisition to be within 90% of the available screen
- * real state.
- *
- * This way the user will have a fighting chance of getting
- * control of their window back if for whatever reason one of the
- * window's descendants decide they want to be 4000 pixels wide.
- *
- * Note that the user can still make the window really huge by hand.
- *
- * Bugs in components or other widgets that cause such huge geometries
- * to be requested, should still be fixed. This code is here only to
- * prevent the extremely frustrating consequence of such bugs.
- */
- max_width = get_max_forced_width (screen);
- max_height = get_max_forced_height (screen);
-
- if (requisition->width > (int) max_width)
- {
- requisition->width = max_width;
- }
-
- if (requisition->height > (int) max_height)
- {
- requisition->height = max_height;
- }
-}
-
-static void
caja_window_realize (GtkWidget *widget)
{
GTK_WIDGET_CLASS (caja_window_parent_class)->realize (widget);