gboolean canCopy = FALSE;
gboolean canPaste = FALSE;
gboolean canBrowse = FALSE;
- AddrSelectItem *item;
- AddrItemObject *aio;
- GList *list, *node;
pobj = gtk_ctree_node_get_row_data( GTK_CTREE(addrbook.ctree), addrbook.treeSelected );
if( pobj == NULL ) return;
canBrowse = FALSE;
}
- /* Forbid cut/copy when selection contains a group */
- list = addrselect_get_list( _addressSelect_ );
- node = list;
- while( node ) {
- item = node->data;
- aio = ( AddrItemObject * ) item->addressItem;
- if (aio && aio->type == ADDR_ITEM_GROUP) {
- canCut = FALSE;
- canCopy = FALSE;
- break;
- }
- node = g_list_next( node );
- }
- g_list_free( list );
-
/* Forbid write changes when read-only */
if( iface && iface->readOnly ) {
canCut = FALSE;
/* Paste/Cut */
folderGroup = addrclip_paste_cut( _clipBoard_, abf, folder );
- if (folderGroup) {
- /* Remove all groups and folders in clipboard from tree node */
- addressbook_treenode_remove_item();
+ /* Remove all groups and folders in clipboard from tree node */
+ addressbook_treenode_remove_item();
- /* Remove all "cut" items */
- addrclip_delete_item( _clipBoard_ );
- }
+ /* Remove all "cut" items */
+ addrclip_delete_item( _clipBoard_ );
/* Clear clipboard - cut items??? */
addrclip_clear( _clipBoard_ );
/*
* This function is used by the matcher dialog to select a book/folder.
*/
-gboolean addressbook_folder_selection( gchar **folderpath )
+gchar *addressbook_folder_selection( const gchar *folderpath)
{
AddressBookFile *book = NULL;
ItemFolder *folder = NULL;
- gchar *path;
+ gchar *path = NULL;
- g_return_val_if_fail( folderpath != NULL, FALSE);
+ g_return_val_if_fail( folderpath != NULL, NULL);
- path = *folderpath;
- *folderpath = NULL;
- if ( addressbook_foldersel_selection( _addressIndex_, &book, &folder, path )
+ if ( addressbook_foldersel_selection( _addressIndex_, &book, &folder, folderpath )
&& book != NULL ) {
if ( folder != NULL) {
gchar *tmp = NULL;
g_free(oldtmp);
}
}
- *folderpath = g_strdup_printf("%s/%s", book->fileName, tmp);
+ path = g_strdup_printf("%s/%s", book->fileName, tmp);
g_free(tmp);
} else {
- *folderpath = g_strdup_printf("%s", book->fileName);
+ path = g_strdup_printf("%s", book->fileName);
}
- debug_print( "addressbook_foldersel: %s\n", *folderpath?*folderpath:"(null)");
- return (*folderpath != NULL);
+ debug_print( "addressbook_foldersel: %s\n", path?path:"(null)");
+ return path;
}
- return FALSE;
+ return NULL;
}
/* ***********************************************************************