diff options
author | Not Zed <NotZed@Ximian.com> | 2004-06-11 17:18:55 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-06-11 17:18:55 +0800 |
commit | e74576a4377a8daa0e8fcc233c6c530943aeeba4 (patch) | |
tree | a98631de04bdb5fb4d4f9c7008628c9787bd4e3e /mail/em-folder-tree.c | |
parent | 295bf2894052c2c34639b109166355de5c854fc8 (diff) | |
download | gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar.gz gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar.zst gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.zip |
rearrange the setting up of the target flags, stores can have a null path.
2004-06-11 Not Zed <NotZed@Ximian.com>
* em-folder-tree.c (emft_tree_button_press): rearrange the setting
up of the target flags, stores can have a null path.
* em-folder-selector.c (emfs_create_name_changed): use
get_selected_uri rather than path. a valid uri may have a null
path now.
(emfs_create_name_activate): and here too.
(em_folder_selector_get_selected_path): check the uri is null for
a selected path, and then handle a null path.
svn path=/trunk/; revision=26307
Diffstat (limited to 'mail/em-folder-tree.c')
-rw-r--r-- | mail/em-folder-tree.c | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index 614012deb3..1988fc2d73 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -994,6 +994,7 @@ tree_drag_data_received(GtkWidget *widget, GdkDragContext *context, int x, int y COL_STRING_FULL_NAME, &full_name, -1); /* make sure user isn't try to drop on a placeholder row */ + /* FIXME: must allow drop of folders onto a store */ if (full_name == NULL) { gtk_drag_finish (context, FALSE, FALSE, GDK_CURRENT_TIME); return; @@ -2632,25 +2633,29 @@ emft_tree_button_press (GtkTreeView *treeview, GdkEventButton *event, EMFolderTr gtk_tree_model_get (model, &iter, COL_POINTER_CAMEL_STORE, &store, COL_STRING_URI, &uri, COL_STRING_FULL_NAME, &full_name, COL_BOOL_IS_STORE, &isstore, -1); - - if (full_name == NULL) + + /* Stores have full_name == NULL, otherwise its just a placeholder */ + /* NB: This is kind of messy */ + if (!isstore && full_name == NULL) return FALSE; - if (isstore) + /* TODO: em_popup_target_folder_new? */ + if (isstore) { flags |= EM_POPUP_FOLDER_STORE; - else + } else { flags |= EM_POPUP_FOLDER_FOLDER; + + local = mail_component_peek_local_store (NULL); - local = mail_component_peek_local_store (NULL); - - /* don't allow deletion of special local folders */ - if (!(store == local && is_special_local_folder (full_name))) - flags |= EM_POPUP_FOLDER_DELETE; - - /* hack for vTrash/vJunk */ - if (!strcmp (full_name, CAMEL_VTRASH_NAME) || !strcmp (full_name, CAMEL_VJUNK_NAME)) - info_flags |= CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_NOINFERIORS; + /* don't allow deletion of special local folders */ + if (!(store == local && is_special_local_folder (full_name))) + flags |= EM_POPUP_FOLDER_DELETE; + /* hack for vTrash/vJunk */ + if (!strcmp (full_name, CAMEL_VTRASH_NAME) || !strcmp (full_name, CAMEL_VJUNK_NAME)) + info_flags |= CAMEL_FOLDER_VIRTUAL | CAMEL_FOLDER_NOINFERIORS; + } + /* handle right-click by opening a context menu */ emp = em_popup_new ("com.ximian.mail.storageset.popup.select"); |