diff options
author | monsta <[email protected]> | 2016-07-12 15:55:20 +0300 |
---|---|---|
committer | monsta <[email protected]> | 2016-07-12 15:55:20 +0300 |
commit | 87d1b9fd67ae60726f6bd7d842804bc4737143ad (patch) | |
tree | 33720131c66b9a83fe8d175d0ea76c13a59709c3 /libcaja-private | |
parent | 739bb5a7a24a6efd2bcd8208c5edd49e3c5ef5cc (diff) | |
download | caja-87d1b9fd67ae60726f6bd7d842804bc4737143ad.tar.bz2 caja-87d1b9fd67ae60726f6bd7d842804bc4737143ad.tar.xz |
libcaja-private: drop unused CajaIdleQueue code
Diffstat (limited to 'libcaja-private')
-rw-r--r-- | libcaja-private/Makefile.am | 2 | ||||
-rw-r--r-- | libcaja-private/caja-directory-private.h | 1 | ||||
-rw-r--r-- | libcaja-private/caja-idle-queue.c | 156 | ||||
-rw-r--r-- | libcaja-private/caja-idle-queue.h | 49 |
4 files changed, 0 insertions, 208 deletions
diff --git a/libcaja-private/Makefile.am b/libcaja-private/Makefile.am index 4e8db5e0..23832404 100644 --- a/libcaja-private/Makefile.am +++ b/libcaja-private/Makefile.am @@ -117,8 +117,6 @@ libcaja_private_la_SOURCES = \ caja-icon-info.c \ caja-icon-info.h \ caja-icon-names.h \ - caja-idle-queue.c \ - caja-idle-queue.h \ caja-keep-last-vertical-box.c \ caja-keep-last-vertical-box.h \ caja-lib-self-check-functions.c \ diff --git a/libcaja-private/caja-directory-private.h b/libcaja-private/caja-directory-private.h index e83bd037..4ea4e1b6 100644 --- a/libcaja-private/caja-directory-private.h +++ b/libcaja-private/caja-directory-private.h @@ -28,7 +28,6 @@ #include <libcaja-private/caja-file-queue.h> #include <libcaja-private/caja-file.h> #include <libcaja-private/caja-monitor.h> -#include <libcaja-private/caja-idle-queue.h> #include <libcaja-extension/caja-info-provider.h> #include <libxml/tree.h> diff --git a/libcaja-private/caja-idle-queue.c b/libcaja-private/caja-idle-queue.c deleted file mode 100644 index 182c6e74..00000000 --- a/libcaja-private/caja-idle-queue.c +++ /dev/null @@ -1,156 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */ - -/* - * libcaja: A library for caja view implementations. - * - * Copyright (C) 2001 Eazel, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Author: Darin Adler <[email protected]> - * - */ - -#include <config.h> -#include "caja-idle-queue.h" - -#include <gtk/gtk.h> - -struct CajaIdleQueue -{ - GList *functions; - guint idle_id; - gboolean in_idle; - gboolean destroy; -}; - -typedef struct -{ - GFunc callback; - gpointer data; - gpointer callback_data; - GFreeFunc free_callback_data; -} QueuedFunction; - -static gboolean -execute_queued_functions (gpointer callback_data) -{ - CajaIdleQueue *queue; - GList *functions, *node; - QueuedFunction *function; - - queue = callback_data; - - /* We could receive more incoming functions while dispatching - * these, so keep going until the queue is empty. - */ - queue->in_idle = TRUE; - while (queue->functions != NULL) - { - functions = g_list_reverse (queue->functions); - queue->functions = NULL; - - for (node = functions; node != NULL; node = node->next) - { - function = node->data; - - if (!queue->destroy) - { - (* function->callback) (function->data, function->callback_data); - } - if (function->free_callback_data != NULL) - { - (* function->free_callback_data) (function->callback_data); - } - - g_free (function); - } - - g_list_free (functions); - } - queue->in_idle = FALSE; - - queue->idle_id = 0; - - if (queue->destroy) - { - caja_idle_queue_destroy (queue); - } - - return FALSE; -} - -CajaIdleQueue * -caja_idle_queue_new (void) -{ - return g_new0 (CajaIdleQueue, 1); -} - -void -caja_idle_queue_add (CajaIdleQueue *queue, - GFunc callback, - gpointer data, - gpointer callback_data, - GFreeFunc free_callback_data) -{ - QueuedFunction *function; - - function = g_new (QueuedFunction, 1); - function->callback = callback; - function->data = data; - function->callback_data = callback_data; - function->free_callback_data = free_callback_data; - - queue->functions = g_list_prepend (queue->functions, function); - - if (queue->idle_id == 0) - { - queue->idle_id = g_idle_add (execute_queued_functions, queue); - } -} - -void -caja_idle_queue_destroy (CajaIdleQueue *queue) -{ - GList *node; - QueuedFunction *function; - - if (queue->in_idle) - { - queue->destroy = TRUE; - return; - } - - for (node = queue->functions; node != NULL; node = node->next) - { - function = node->data; - - if (function->free_callback_data != NULL) - { - (* function->free_callback_data) (function->callback_data); - } - - g_free (function); - } - - g_list_free (queue->functions); - - if (queue->idle_id != 0) - { - g_source_remove (queue->idle_id); - } - - g_free (queue); -} diff --git a/libcaja-private/caja-idle-queue.h b/libcaja-private/caja-idle-queue.h deleted file mode 100644 index e9c5db9c..00000000 --- a/libcaja-private/caja-idle-queue.h +++ /dev/null @@ -1,49 +0,0 @@ -/* -*- Mode: C; tab-width: 8; indent-tabs-mode: 8; c-basic-offset: 8 -*- */ - -/* - * libcaja: A library for caja view implementations. - * - * Copyright (C) 2001 Eazel, Inc. - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Library General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Library General Public License for more details. - * - * You should have received a copy of the GNU Library General Public - * License along with this library; if not, write to the Free - * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - * - * Author: Darin Adler <[email protected]> - * - */ - -#ifndef CAJA_IDLE_QUEUE_H -#define CAJA_IDLE_QUEUE_H - -#include <glib.h> - -#ifdef __cplusplus -extern "C" { -#endif - - typedef struct CajaIdleQueue CajaIdleQueue; - - CajaIdleQueue *caja_idle_queue_new (void); - void caja_idle_queue_add (CajaIdleQueue *queue, - GFunc callback, - gpointer data, - gpointer callback_data, - GFreeFunc free_callback_data); - void caja_idle_queue_destroy (CajaIdleQueue *queue); - -#ifdef __cplusplus -} -#endif - -#endif /* CAJA_IDLE_QUEUE_H */ |