Update copyright message
[nautilus-actions.git] / src / nact / nact-main-menubar-edit.c
blobb85c4e2174554bfc225e5fa70eb1b0695002a28d
1 /*
2 * Nautilus Actions
3 * A Nautilus extension which offers configurable context menu actions.
5 * Copyright (C) 2005 The GNOME Foundation
6 * Copyright (C) 2006, 2007, 2008 Frederic Ruaudel and others (see AUTHORS)
7 * Copyright (C) 2009, 2010, 2011 Pierre Wieser and others (see AUTHORS)
9 * This Program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of
12 * the License, or (at your option) any later version.
14 * This Program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
19 * You should have received a copy of the GNU General Public
20 * License along with this Library; see the file COPYING. If not,
21 * write to the Free Software Foundation, Inc., 59 Temple Place,
22 * Suite 330, Boston, MA 02111-1307, USA.
24 * Authors:
25 * Frederic Ruaudel <grumz@grumz.net>
26 * Rodrigo Moya <rodrigo@gnome-db.org>
27 * Pierre Wieser <pwieser@trychlos.org>
28 * ... and many others (see AUTHORS)
31 #ifdef HAVE_CONFIG_H
32 #include <config.h>
33 #endif
35 #include <glib/gi18n.h>
37 #include <api/na-core-utils.h>
39 #include <core/na-io-provider.h>
40 #include <core/na-iprefs.h>
42 #include "nact-application.h"
43 #include "nact-iactions-list.h"
44 #include "nact-main-tab.h"
45 #include "nact-main-menubar-edit.h"
46 #include "nact-preferences-editor.h"
48 static GList *prepare_for_paste( NactMainWindow *window );
49 static GList *get_deletables( NAUpdater *updater, GList *tree, GSList **not_deletable );
50 static GSList *get_deletables_rec( NAUpdater *updater, GList *tree );
51 static gchar *add_non_deletable_msg( const NAObjectItem *item, gint reason );
52 static void update_clipboard_counters( NactMainWindow *window );
54 /**
55 * nact_main_menubar_edit_on_update_sensitivities:
56 * @window: the #NactMainWindow main window.
57 * user_data: the data passed to the function via the signal.
58 * @mis: the #MenubarIndicatorsStruct struct.
60 * Update sensitivity of items of the Edit menu.
62 void
63 nact_main_menubar_edit_on_update_sensitivities( NactMainWindow *window, gpointer user_data, MenubarIndicatorsStruct *mis )
65 gboolean cut_enabled;
66 gboolean copy_enabled;
67 gboolean paste_enabled;
68 gboolean paste_into_enabled;
69 gboolean duplicate_enabled;
70 gboolean delete_enabled;
71 GList *is;
72 NAObject *parent_item;
73 NAObject *selected_action;
74 NAObject *selected_item;
75 gboolean are_parents_writable;
76 gboolean is_clipboard_empty;
78 is_clipboard_empty = ( mis->clipboard_menus + mis->clipboard_actions + mis->clipboard_profiles == 0 );
80 /* cut requires a non-empty selection
81 * and that all parents are writable (as implies a delete operation)
83 cut_enabled = mis->treeview_has_focus || mis->popup_handler;
84 cut_enabled &= mis->count_selected > 0;
85 are_parents_writable = TRUE;
86 for( is = mis->selected_items ; is ; is = is->next ){
87 parent_item = ( NAObject * ) na_object_get_parent( is->data );
88 if( parent_item ){
89 if( !na_updater_is_item_writable( mis->updater, NA_OBJECT_ITEM( parent_item ), NULL )){
90 are_parents_writable = FALSE;
91 break;
93 } else if( !mis->is_level_zero_writable ){
94 are_parents_writable = FALSE;
95 break;
98 cut_enabled &= are_parents_writable;
99 nact_main_menubar_enable_item( window, "CutItem", cut_enabled );
101 /* copy only requires a non-empty selection */
102 copy_enabled = mis->treeview_has_focus || mis->popup_handler;
103 copy_enabled &= mis->count_selected > 0;
104 nact_main_menubar_enable_item( window, "CopyItem", copy_enabled );
106 /* paste enabled if
107 * - clipboard is not empty
108 * - current selection is not multiple
109 * - if clipboard contains only profiles,
110 * then current selection must be a profile or an action
111 * and the action must be writable
112 * - if clipboard contains actions or menus,
113 * then current selection (if any) must be a menu or an action
114 * and its parent must be writable
116 paste_enabled = mis->treeview_has_focus || mis->popup_handler;
117 paste_enabled &= !is_clipboard_empty;
118 paste_enabled &= mis->count_selected <= 1;
119 if( mis->clipboard_profiles ){
120 paste_enabled &= mis->count_selected == 1;
121 if( paste_enabled ){
122 selected_action = NA_OBJECT(
123 NA_IS_OBJECT_PROFILE( mis->selected_items->data )
124 ? na_object_get_parent( mis->selected_items->data )
125 : mis->selected_items->data );
126 paste_enabled &= NA_IS_OBJECT_ACTION( selected_action );
127 paste_enabled &= na_updater_is_item_writable( mis->updater, NA_OBJECT_ITEM( selected_action ), NULL );
129 } else {
130 paste_enabled &= mis->has_writable_providers;
131 if( mis->count_selected ){
132 selected_item = NA_OBJECT( mis->selected_items->data );
133 paste_enabled &= NA_IS_OBJECT_ITEM( selected_item );
134 if( paste_enabled ){
135 parent_item = ( NAObject * ) na_object_get_parent( selected_item );
136 paste_enabled &= parent_item
137 ? nact_window_is_item_writable( NACT_WINDOW( window ), NA_OBJECT_ITEM( parent_item ), NULL )
138 : mis->is_level_zero_writable;
140 } else {
141 paste_enabled &= mis->is_level_zero_writable;
144 nact_main_menubar_enable_item( window, "PasteItem", paste_enabled );
146 /* paste into enabled if
147 * - clipboard is not empty
148 * - current selection is not multiple
149 * - if clipboard contains only profiles,
150 * then current selection must be an action
151 * and the action must be writable
152 * - if clipboard contains actions or menus,
153 * then current selection (if any) must be a menu
154 * and its parent must be writable
156 paste_into_enabled = mis->treeview_has_focus || mis->popup_handler;
157 paste_into_enabled &= !is_clipboard_empty;
158 paste_into_enabled &= mis->count_selected <= 1;
159 if( mis->clipboard_profiles ){
160 paste_into_enabled &= mis->count_selected == 1;
161 if( paste_into_enabled ){
162 selected_action = NA_OBJECT( mis->selected_items->data );
163 paste_into_enabled &= NA_IS_OBJECT_ACTION( selected_action );
164 paste_into_enabled &= nact_window_is_item_writable( NACT_WINDOW( window ), NA_OBJECT_ITEM( selected_action ), NULL );
166 } else {
167 paste_into_enabled &= mis->has_writable_providers;
168 if( mis->count_selected ){
169 selected_item = NA_OBJECT( mis->selected_items->data );
170 paste_into_enabled &= NA_IS_OBJECT_MENU( selected_item );
171 if( paste_into_enabled ){
172 parent_item = ( NAObject * ) na_object_get_parent( selected_item );
173 paste_into_enabled &= parent_item
174 ? nact_window_is_item_writable( NACT_WINDOW( window ), NA_OBJECT_ITEM( parent_item ), NULL )
175 : mis->is_level_zero_writable;
177 } else {
178 paste_into_enabled &= mis->is_level_zero_writable;
181 nact_main_menubar_enable_item( window, "PasteIntoItem", paste_into_enabled );
183 /* duplicate items will be duplicated besides each one
184 * selection must be non-empty
185 * each parent must be writable
186 * -> so this is the same than cut
188 duplicate_enabled = cut_enabled;
189 nact_main_menubar_enable_item( window, "DuplicateItem", duplicate_enabled );
191 /* delete is same that cut
192 * but items themselves must be writable (because physically deleted)
193 * this will be checked on delete activated
195 delete_enabled = cut_enabled;
196 nact_main_menubar_enable_item( window, "DeleteItem", delete_enabled );
198 /* reload items always enabled */
200 /* preferences always enabled */
204 * nact_main_menubar_edit_on_cut:
205 * @gtk_action: the #GtkAction action.
206 * @window: the #NactMainWindow main window.
208 * cuts the visible selection
209 * - (tree) get new refs on selected items
210 * - (main) add selected items to main list of deleted,
211 * moving newref from list_from_tree to main_list_of_deleted
212 * - (menu) install in clipboard a copy of selected objects
213 * - (tree) remove selected items, unreffing objects
215 void
216 nact_main_menubar_edit_on_cut( GtkAction *gtk_action, NactMainWindow *window )
218 static const gchar *thisfn = "nact_main_menubar_edit_on_cut";
219 NactApplication *application;
220 NAUpdater *updater;
221 GList *items;
222 NactClipboard *clipboard;
223 GList *to_delete;
224 GSList *non_deletables;
226 g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window );
227 g_return_if_fail( GTK_IS_ACTION( gtk_action ));
228 g_return_if_fail( NACT_IS_MAIN_WINDOW( window ));
230 application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
231 updater = nact_application_get_updater( application );
232 items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
234 non_deletables = NULL;
235 to_delete = get_deletables( updater, items, &non_deletables );
237 if( non_deletables ){
238 gchar *second = na_core_utils_slist_join_at_end( non_deletables, "\n" );
239 base_window_error_dlg(
240 BASE_WINDOW( window ),
241 GTK_MESSAGE_INFO,
242 _( "Not all items have been cut as following ones are not modifiable:" ),
243 second );
244 g_free( second );
245 na_core_utils_slist_free( non_deletables );
248 if( to_delete ){
249 nact_main_window_move_to_deleted( window, to_delete );
250 clipboard = nact_main_window_get_clipboard( window );
251 nact_clipboard_primary_set( clipboard, to_delete, CLIPBOARD_MODE_CUT );
252 update_clipboard_counters( window );
253 nact_iactions_list_bis_delete( NACT_IACTIONS_LIST( window ), to_delete, TRUE );
256 na_object_unref_selected_items( items );
260 * nact_main_menubar_edit_on_copy:
261 * @gtk_action: the #GtkAction action.
262 * @window: the #NactMainWindow main window.
264 * copies the visible selection
265 * - (tree) get new refs on selected items
266 * - (menu) install in clipboard a copy of selected objects
267 * renumbering actions/menus id to ensure unicity at paste time
268 * - (menu) release refs on selected items
269 * - (menu) refresh actions sensitivy (as selection doesn't change)
271 void
272 nact_main_menubar_edit_on_copy( GtkAction *gtk_action, NactMainWindow *window )
274 static const gchar *thisfn = "nact_main_menubar_edit_on_copy";
275 GList *items;
276 NactClipboard *clipboard;
278 g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window );
279 g_return_if_fail( GTK_IS_ACTION( gtk_action ));
280 g_return_if_fail( NACT_IS_MAIN_WINDOW( window ));
282 items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
283 clipboard = nact_main_window_get_clipboard( window );
284 nact_clipboard_primary_set( clipboard, items, CLIPBOARD_MODE_COPY );
285 update_clipboard_counters( window );
286 na_object_unref_selected_items( items );
288 g_signal_emit_by_name( window, MAIN_WINDOW_SIGNAL_UPDATE_ACTION_SENSITIVITIES, NULL );
292 * nact_main_menubar_edit_on_paste:
293 * @gtk_action: the #GtkAction action.
294 * @window: the #NactMainWindow main window.
296 * pastes the current content of the clipboard at the current position
297 * (same path, same level)
298 * - (menu) get from clipboard a copy of installed items
299 * the clipboard will return a new copy
300 * and renumber its own data for allowing a new paste
301 * - (tree) insert new items, the tree store will ref them
302 * attaching each item to its parent
303 * recursively checking edition status of the topmost parent
304 * selecting the first item at end
305 * - (menu) unreffing the copy got from clipboard
307 void
308 nact_main_menubar_edit_on_paste( GtkAction *gtk_action, NactMainWindow *window )
310 static const gchar *thisfn = "nact_main_menubar_edit_on_paste";
311 GList *items;
313 g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window );
315 items = prepare_for_paste( window );
316 if( items ){
317 nact_iactions_list_bis_insert_items( NACT_IACTIONS_LIST( window ), items, NULL );
318 na_object_unref_items( items );
323 * nact_main_menubar_edit_on_paste_into:
324 * @gtk_action: the #GtkAction action.
325 * @window: the #NactMainWindow main window.
327 * pastes the current content of the clipboard as the first child of
328 * currently selected item
329 * - (menu) get from clipboard a copy of installed items
330 * the clipboard will return a new copy
331 * and renumber its own data for allowing a new paste
332 * - (tree) insert new items, the tree store will ref them
333 * attaching each item to its parent
334 * recursively checking edition status of the topmost parent
335 * selecting the first item at end
336 * - (menu) unreffing the copy got from clipboard
338 void
339 nact_main_menubar_edit_on_paste_into( GtkAction *gtk_action, NactMainWindow *window )
341 static const gchar *thisfn = "nact_main_menubar_edit_on_paste_into";
342 GList *items;
344 g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window );
346 items = prepare_for_paste( window );
347 if( items ){
348 nact_iactions_list_bis_insert_into( NACT_IACTIONS_LIST( window ), items );
349 na_object_unref_items( items );
353 static GList *
354 prepare_for_paste( NactMainWindow *window )
356 static const gchar *thisfn = "nact_main_menubar_edit_prepare_for_paste";
357 GList *items, *it;
358 NactClipboard *clipboard;
359 NAObjectAction *action;
360 gboolean relabel;
361 gboolean renumber;
362 NactApplication *application;
363 NAUpdater *updater;
365 application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
366 updater = nact_application_get_updater( application );
368 clipboard = nact_main_window_get_clipboard( window );
369 items = nact_clipboard_primary_get( clipboard, &renumber );
370 action = NULL;
372 /* if pasted items are profiles, then setup the target action
374 for( it = items ; it ; it = it->next ){
376 if( NA_IS_OBJECT_PROFILE( it->data )){
377 if( !action ){
378 g_object_get( G_OBJECT( window ), TAB_UPDATABLE_PROP_SELECTED_ITEM, &action, NULL );
379 g_return_val_if_fail( NA_IS_OBJECT_ACTION( action ), NULL );
383 relabel = nact_main_menubar_edit_is_pasted_object_relabeled( NA_OBJECT( it->data ), NA_PIVOT( updater ));
384 na_object_prepare_for_paste( it->data, relabel, renumber, action );
385 na_object_check_status( it->data );
388 g_debug( "%s: action=%p (%s)",
389 thisfn, ( void * ) action, action ? G_OBJECT_TYPE_NAME( action ): "(null)" );
391 return( items );
395 * nact_main_menubar_edit_on_duplicate:
396 * @gtk_action: the #GtkAction action.
397 * @window: the #NactMainWindow main window.
399 * duplicate is just as paste, with the difference that content comes
400 * from the current selection, instead of coming from the clipboard
402 * this is nonetheless a bit more complicated because when we duplicate
403 * some items (e.g. a multiple selection), we expect to see the new
404 * items just besides the original ones...
406 void
407 nact_main_menubar_edit_on_duplicate( GtkAction *gtk_action, NactMainWindow *window )
409 static const gchar *thisfn = "nact_main_menubar_edit_on_duplicate";
410 NactApplication *application;
411 NAUpdater *updater;
412 NAObjectAction *action;
413 GList *items, *it;
414 GList *dup;
415 NAObject *obj;
416 gboolean relabel;
418 g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window );
419 g_return_if_fail( GTK_IS_ACTION( gtk_action ));
420 g_return_if_fail( NACT_IS_MAIN_WINDOW( window ));
422 application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
423 updater = nact_application_get_updater( application );
425 items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
426 for( it = items ; it ; it = it->next ){
427 obj = NA_OBJECT( na_object_duplicate( it->data ));
428 action = NULL;
430 /* duplicating a profile
431 * as we insert in sibling mode, the parent doesn't change
433 if( NA_IS_OBJECT_PROFILE( obj )){
434 action = NA_OBJECT_ACTION( na_object_get_parent( it->data ));
437 relabel = nact_main_menubar_edit_is_pasted_object_relabeled( obj, NA_PIVOT( updater ));
438 na_object_prepare_for_paste( obj, relabel, TRUE, action );
439 na_object_set_origin( obj, NULL );
440 na_object_check_status( obj );
441 dup = g_list_prepend( NULL, obj );
442 nact_iactions_list_bis_insert_items( NACT_IACTIONS_LIST( window ), dup, it->data );
443 na_object_unref_items( dup );
446 na_object_unref_selected_items( items );
450 * nact_main_menubar_edit_on_delete:
451 * @gtk_action: the #GtkAction action.
452 * @window: the #NactMainWindow main window.
454 * deletes the visible selection
455 * - (tree) get new refs on selected items
456 * - (tree) remove selected items, unreffing objects
457 * - (main) add selected items to main list of deleted,
458 * moving newref from list_from_tree to main_list_of_deleted
459 * - (tree) select next row (if any, or previous if any, or none)
461 * note that we get from selection a list of trees, but we don't have
462 * yet ensured that each element of this tree is actually deletable
463 * each branch of this list must be recursively deletable in order
464 * this branch itself be deleted
466 void
467 nact_main_menubar_edit_on_delete( GtkAction *gtk_action, NactMainWindow *window )
469 static const gchar *thisfn = "nact_main_menubar_edit_on_delete";
470 NactApplication *application;
471 NAUpdater *updater;
472 GList *items;
473 GList *to_delete;
474 GSList *non_deletables;
476 g_debug( "%s: gtk_action=%p, window=%p", thisfn, ( void * ) gtk_action, ( void * ) window );
477 g_return_if_fail( GTK_IS_ACTION( gtk_action ));
478 g_return_if_fail( NACT_IS_MAIN_WINDOW( window ));
480 application = NACT_APPLICATION( base_window_get_application( BASE_WINDOW( window )));
481 updater = nact_application_get_updater( application );
482 items = nact_iactions_list_bis_get_selected_items( NACT_IACTIONS_LIST( window ));
484 non_deletables = NULL;
485 to_delete = get_deletables( updater, items, &non_deletables );
487 if( non_deletables ){
488 gchar *second = na_core_utils_slist_join_at_end( non_deletables, "\n" );
489 base_window_error_dlg(
490 BASE_WINDOW( window ),
491 GTK_MESSAGE_INFO,
492 _( "Not all items have been deleted as following ones are not modifiable:" ),
493 second );
494 g_free( second );
495 na_core_utils_slist_free( non_deletables );
498 if( to_delete ){
499 nact_main_window_move_to_deleted( window, to_delete );
500 nact_iactions_list_bis_delete( NACT_IACTIONS_LIST( window ), to_delete, TRUE );
503 na_object_unref_selected_items( items );
506 static GList *
507 get_deletables( NAUpdater *updater, GList *selected, GSList **non_deletables )
509 GList *to_delete;
510 GList *it;
511 GList *subitems;
512 GSList *sub_deletables;
513 gint reason;
515 to_delete = NULL;
516 for( it = selected ; it ; it = it->next ){
518 if( !na_updater_is_item_writable( updater, NA_OBJECT_ITEM( it->data ), &reason )){
519 *non_deletables = g_slist_prepend(
520 *non_deletables, add_non_deletable_msg( NA_OBJECT_ITEM( it->data ), reason ));
521 continue;
524 if( NA_IS_OBJECT_MENU( it->data )){
525 subitems = na_object_get_items( it->data );
526 sub_deletables = get_deletables_rec( updater, subitems );
528 if( sub_deletables ){
529 *non_deletables = g_slist_concat( *non_deletables, sub_deletables );
530 continue;
534 to_delete = g_list_prepend( to_delete, na_object_ref( it->data ));
537 return( to_delete );
540 static GSList *
541 get_deletables_rec( NAUpdater *updater, GList *tree )
543 GSList *msgs;
544 GList *it;
545 GList *subitems;
546 gint reason;
548 msgs = NULL;
549 for( it = tree ; it ; it = it->next ){
551 if( !na_updater_is_item_writable( updater, NA_OBJECT_ITEM( it->data ), &reason )){
552 msgs = g_slist_prepend(
553 msgs, add_non_deletable_msg( NA_OBJECT_ITEM( it->data ), reason ));
554 continue;
557 if( NA_IS_OBJECT_MENU( it->data )){
558 subitems = na_object_get_items( it->data );
559 msgs = g_slist_concat( msgs, get_deletables_rec( updater, subitems ));
563 return( msgs );
566 static gchar *
567 add_non_deletable_msg( const NAObjectItem *item, gint reason )
569 gchar *msg;
570 gchar *label;
571 gchar *reason_str;
573 label = na_object_get_label( item );
574 reason_str = na_io_provider_get_readonly_tooltip( reason );
576 msg = g_strdup_printf( "%s: %s", label, reason_str );
578 g_free( reason_str );
579 g_free( label );
581 return( msg );
585 * as we are coming from cut or copy to clipboard, report selection
586 * counters to clipboard ones
588 static void
589 update_clipboard_counters( NactMainWindow *window )
591 MenubarIndicatorsStruct *mis;
593 mis = ( MenubarIndicatorsStruct * ) g_object_get_data( G_OBJECT( window ), MENUBAR_PROP_INDICATORS );
595 mis->clipboard_menus = mis->selected_menus;
596 mis->clipboard_actions = mis->selected_actions;
597 mis->clipboard_profiles = mis->selected_profiles;
599 g_debug( "nact_main_menubar_update_clipboard_counters: menus=%d, actions=%d, profiles=%d",
600 mis->clipboard_menus, mis->clipboard_actions, mis->clipboard_profiles );
602 g_signal_emit_by_name( window, MAIN_WINDOW_SIGNAL_UPDATE_ACTION_SENSITIVITIES, NULL );
606 * nact_main_menubar_edit_on_reload:
607 * @gtk_action: the #GtkAction action.
608 * @window: the #NactMainWindow main window.
610 * Reload items from I/O storage subsystems.
612 void
613 nact_main_menubar_edit_on_reload( GtkAction *gtk_action, NactMainWindow *window )
615 nact_main_window_reload( window );
619 * nact_main_menubar_edit_on_preferences:
620 * @gtk_action: the #GtkAction action.
621 * @window: the #NactMainWindow main window.
623 * Edit preferences.
625 void
626 nact_main_menubar_edit_on_prefererences( GtkAction *gtk_action, NactMainWindow *window )
628 nact_preferences_editor_run( BASE_WINDOW( window ));
632 * nact_main_menubar_edit_is_pasted_object_relabeled:
633 * @object: the considered #NAObject-derived object.
634 * @pivot: the #NAPivot instance.
636 * Whether the specified object should be relabeled when pasted ?
638 * Returns: %TRUE if the object should be relabeled, %FALSE else.
640 gboolean
641 nact_main_menubar_edit_is_pasted_object_relabeled( NAObject *object, NAPivot *pivot )
643 static const gchar *thisfn = "nact_main_menubar_edit_is_pasted_object_relabeled";
644 gboolean relabel;
646 if( NA_IS_OBJECT_MENU( object )){
647 relabel = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_RELABEL_MENUS, FALSE );
648 } else if( NA_IS_OBJECT_ACTION( object )){
649 relabel = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_RELABEL_ACTIONS, FALSE );
650 } else if( NA_IS_OBJECT_PROFILE( object )){
651 relabel = na_iprefs_read_bool( NA_IPREFS( pivot ), IPREFS_RELABEL_PROFILES, FALSE );
652 } else {
653 g_warning( "%s: unknown object type at %p", thisfn, ( void * ) object );
654 g_return_val_if_reached( FALSE );
657 return( relabel );