Skip to content

Commit

Permalink
cleanup: remove some disabled code
Browse files Browse the repository at this point in the history
  • Loading branch information
nadvornik committed Jun 28, 2009
1 parent 3ad0a54 commit cf4208a
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 250 deletions.
61 changes: 0 additions & 61 deletions src/advanced_exif.c
Original file line number Diff line number Diff line change
Expand Up @@ -165,67 +165,6 @@ void advanced_exif_set_fd(GtkWidget *window, FileData *fd)
advanced_exif_update(ew);
}

#if 0
static void advanced_exif_row_toggled_cb(GtkCellRendererToggle *toggle, const gchar *path, gpointer data)
{
GtkWidget *listview = data;
GtkTreeModel *store;
GtkTreeIter iter;
GtkTreePath *tpath;
gchar *name = NULL;
gboolean active;

store = gtk_tree_view_get_model(GTK_TREE_VIEW(listview));

tpath = gtk_tree_path_new_from_string(path);
gtk_tree_model_get_iter(store, &iter, tpath);
gtk_tree_path_free(tpath);

gtk_tree_model_get(store, &iter, EXIF_ADVCOL_ENABLED, &active,
EXIF_ADVCOL_NAME, &name, -1);
active = (!active);

if (active &&
g_list_length(history_list_get_by_key("exif_extras")) >= EXIF_BAR_CUSTOM_COUNT)
{
active = FALSE;
}

gtk_list_store_set(GTK_LIST_STORE(store), &iter, EXIF_ADVCOL_ENABLED, active, -1);

if (active)
{
history_list_add_to_key("exif_extras", name, EXIF_BAR_CUSTOM_COUNT);
}
else
{
history_list_item_change("exif_extras", name, NULL);
}

g_free(name);
}
#endif

#if 0
static void advanced_exif_add_column_check(GtkWidget *listview, const gchar *title, gint n)
{
GtkTreeViewColumn *column;
GtkCellRenderer *renderer;

column = gtk_tree_view_column_new();
gtk_tree_view_column_set_title(column, title);
gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);

renderer = gtk_cell_renderer_toggle_new();
gtk_tree_view_column_pack_start(column, renderer, TRUE);
gtk_tree_view_column_add_attribute(column, renderer, "active", n);
gtk_tree_view_append_column(GTK_TREE_VIEW(listview), column);

g_signal_connect(G_OBJECT(renderer), "toggled",
G_CALLBACK(advanced_exif_row_toggled_cb), listview);
}
#endif

static GtkTargetEntry advanced_exif_drag_types[] = {
{ "text/plain", 0, TARGET_TEXT_PLAIN }
};
Expand Down
11 changes: 0 additions & 11 deletions src/img-view.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,17 +430,6 @@ static gboolean view_window_key_press_cb(GtkWidget *widget, GdkEventKey *event,
stop_signal = FALSE;
break;
}
#if 0
if (n != -1)
{
if (!editor_window_flag_set(n))
{
view_fullscreen_toggle(vw, TRUE);
}
imd = view_window_active_image(vw);
file_util_start_editor_from_file(n, image_get_fd(imd), imd->widget);
}
#endif
}
else if (event->state & GDK_SHIFT_MASK)
{
Expand Down
57 changes: 0 additions & 57 deletions src/layout_util.c
Original file line number Diff line number Diff line change
Expand Up @@ -1066,63 +1066,6 @@ static void layout_menu_edit_cb(GtkAction *action, gpointer data)
file_util_start_editor_from_filelist(key, layout_selection_list(lw), layout_get_path(lw), lw->window);
}

#if 0
static void layout_menu_edit_update(LayoutWindow *lw)
{
gint i;

/* main edit menu */

if (!lw->action_group) return;

for (i = 0; i < GQ_EDITOR_GENERIC_SLOTS; i++)
{
gchar *key;
GtkAction *action;
const gchar *name;

key = g_strdup_printf("Editor%d", i);

action = gtk_action_group_get_action(lw->action_group, key);
g_object_set_data(G_OBJECT(action), "edit_index", GINT_TO_POINTER(i));

name = editor_get_name(i);
if (name)
{
gchar *text = g_strdup_printf(_("_%d %s..."), i, name);

g_object_set(action, "label", text,
"sensitive", TRUE, NULL);
g_free(text);
}
else
{
gchar *text;

text = g_strdup_printf(_("_%d empty"), i);
g_object_set(action, "label", text, "sensitive", FALSE, NULL);
g_free(text);
}

g_free(key);
}
}

void layout_edit_update_all(void)
{
GList *work;

work = layout_window_list;
while (work)
{
LayoutWindow *lw = work->data;
work = work->next;

layout_menu_edit_update(lw);
}
}

#endif

static void layout_menu_metadata_write_cb(GtkAction *action, gpointer data)
{
Expand Down
51 changes: 0 additions & 51 deletions src/preferences.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,54 +168,6 @@ void config_entry_to_option(GtkWidget *entry, gchar **option, gchar *(*func)(con
}
}

#if 0
static void config_parse_editor_entries(GtkWidget **editor_name_entry, GtkWidget **editor_command_entry)
{
gint i;
const gchar *buf;
GString *errmsg = g_string_new("");

for (i = 0; i < GQ_EDITOR_SLOTS; i++)
{
gchar *command = NULL;

if (i < GQ_EDITOR_GENERIC_SLOTS)
{
gchar *name = NULL;

buf = gtk_entry_get_text(GTK_ENTRY(editor_name_entry[i]));
if (buf && strlen(buf) > 0) name = g_strdup(buf);
editor_set_name(i, name);
g_free(name);
}

buf = gtk_entry_get_text(GTK_ENTRY(editor_command_entry[i]));
if (buf && strlen(buf) > 0)
{
gint flags = editor_command_parse(buf, NULL, NULL);

if (EDITOR_ERRORS(flags))
{
if (errmsg->str[0]) g_string_append(errmsg, "\n\n");
g_string_append_printf(errmsg, _("%s\n#%d \"%s\":\n%s"), editor_get_error_str(flags),
i+1, options->editor[i].name, buf);

}
command = g_strdup(buf);
}

editor_set_command(i, command);
g_free(command);
}

if (errmsg->str[0])
{
file_util_warning_dialog(_("Invalid editor command"), errmsg->str, GTK_STOCK_DIALOG_ERROR, NULL);
}

g_string_free(errmsg, TRUE);
}
#endif

static gboolean accel_apply_cb(GtkTreeModel *model, GtkTreePath *path, GtkTreeIter *iter, gpointer data)
{
Expand All @@ -242,9 +194,6 @@ static void config_window_apply(void)
gint i;
gboolean refresh = FALSE;

// config_parse_editor_entries(editor_name_entry, editor_command_entry);
// layout_edit_update_all();

config_entry_to_option(safe_delete_path_entry, &options->file_ops.safe_delete_path, remove_trailing_slash);

if (options->file_filter.show_hidden_files != c_options->file_filter.show_hidden_files) refresh = TRUE;
Expand Down
70 changes: 0 additions & 70 deletions src/view_file_icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -1744,76 +1744,6 @@ static void vficon_populate_at_new_size(ViewFile *vf, gint w, gint h, gboolean f
DEBUG_1("col tab pop cols=%d rows=%d", VFICON(vf)->columns, VFICON(vf)->rows);
}

#if 0
static void vficon_sync(ViewFile *vf)
{
GtkTreeModel *store;
GtkTreeIter iter;
GList *work;
gint r, c;
gint valid;

if (VFICON(vf)->rows == 0) return;

store = gtk_tree_view_get_model(GTK_TREE_VIEW(vf->listview));

r = -1;
c = 0;

valid = gtk_tree_model_iter_children(store, &iter, NULL);

work = vf->list;
while (work)
{
GList *list;
r++;
c = 0;
if (valid)
{
gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &list, -1);
gtk_list_store_set(GTK_LIST_STORE(store), &iter, FILE_COLUMN_POINTER, list, -1);
}
else
{
list = vficon_add_row(vf, &iter);
}

while (list)
{
IconData *id;

if (work)
{
id = work->data;
work = work->next;
c++;
}
else
{
id = NULL;
}

list->data = id;
list = list->next;
}
if (valid) valid = gtk_tree_model_iter_next(store, &iter);
}

r++;
while (valid)
{
GList *list;

gtk_tree_model_get(store, &iter, FILE_COLUMN_POINTER, &list, -1);
valid = gtk_list_store_remove(GTK_LIST_STORE(store), &iter);
g_list_free(list);
}

VFICON(vf)->rows = r;

vficon_update_focus(vf);
}
#endif

#if 0
static void vficon_sync_idle(ViewFile *vf)
Expand Down

0 comments on commit cf4208a

Please sign in to comment.