2007-12-06 [colin] 3.1.0cvs62
[claws.git] / src / addressbook.c
index ebf88737109c44e4fcfcdb0de9358f9ca6b9068b..43fedc7c81281e4577312cc96e82e1e84622fe23 100644 (file)
@@ -1872,9 +1872,6 @@ static void addressbook_list_menu_setup( void ) {
        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;
@@ -1952,21 +1949,6 @@ static void addressbook_list_menu_setup( void ) {
                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;
@@ -2102,13 +2084,11 @@ static void addressbook_clip_paste_cb( void ) {
                /* 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_ );
@@ -5004,17 +4984,15 @@ gboolean addressbook_add_contact(
 /*
  * 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;
@@ -5034,15 +5012,15 @@ gboolean addressbook_folder_selection( gchar **folderpath )
                                        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;
 }
 
 /* ***********************************************************************