aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNot Zed <NotZed@Ximian.com>2004-06-11 17:18:55 +0800
committerMichael Zucci <zucchi@src.gnome.org>2004-06-11 17:18:55 +0800
commite74576a4377a8daa0e8fcc233c6c530943aeeba4 (patch)
treea98631de04bdb5fb4d4f9c7008628c9787bd4e3e
parent295bf2894052c2c34639b109166355de5c854fc8 (diff)
downloadgsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar
gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar.gz
gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar.bz2
gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar.lz
gsoc2013-evolution-e74576a4377a8daa0e8fcc233c6c530943aeeba4.tar.xz
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
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/em-folder-selector.c14
-rw-r--r--mail/em-folder-tree.c31
3 files changed, 36 insertions, 19 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c13399c9ce..8a4b463d9f 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,5 +1,15 @@
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.
+
* em-folder-tree-model.c (em_folder_tree_model_add_store): revert
previous change. Stupid emftm.
diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c
index f31e06c78c..9f75db119d 100644
--- a/mail/em-folder-selector.c
+++ b/mail/em-folder-selector.c
@@ -195,7 +195,7 @@ emfs_create_name_changed (GtkEntry *entry, EMFolderSelector *emfs)
if (emfs->name_entry->text_length > 0)
text = gtk_entry_get_text (emfs->name_entry);
- path = em_folder_tree_get_selected_path (emfs->emft);
+ path = em_folder_tree_get_selected_uri(emfs->emft);
active = text && path && !strchr (text, '/');
@@ -279,7 +279,7 @@ emfs_create_name_activate (GtkEntry *entry, EMFolderSelector *emfs)
const char *path, *text;
text = gtk_entry_get_text (emfs->name_entry);
- path = em_folder_tree_get_selected_path (emfs->emft);
+ path = em_folder_tree_get_selected_uri(emfs->emft);
if (text && path && !strchr (text, '/'))
g_signal_emit_by_name (emfs, "response", GTK_RESPONSE_OK);
@@ -403,13 +403,15 @@ em_folder_selector_get_selected_path (EMFolderSelector *emfs)
/* already did the work in a previous call */
return emfs->selected_path;
}
-
- if (!(path = em_folder_tree_get_selected_path (emfs->emft))) {
+
+ if (!em_folder_tree_get_selected_uri(emfs->emft)) {
d(printf ("no selected folder?\n"));
return NULL;
}
-
- if (path && emfs->name_entry) {
+
+ path = em_folder_tree_get_selected_path(emfs->emft);
+ path = path?path:"";
+ if (emfs->name_entry) {
const char *name;
char *newpath;
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");