diff options
author | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-08-24 19:22:38 +0800 |
---|---|---|
committer | Philip Withnall <philip.withnall@collabora.co.uk> | 2010-08-27 17:23:48 +0800 |
commit | 4b17d88ae214bc8b9b74d7fd6c0c01e14f206478 (patch) | |
tree | 34e52622df4119ea0b533ed133556165077cfe58 /libempathy-gtk | |
parent | c9bc158a8897e4ab2f0758d87084f048e51de165 (diff) | |
download | gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.tar gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.tar.gz gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.tar.bz2 gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.tar.lz gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.tar.xz gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.tar.zst gsoc2013-empathy-4b17d88ae214bc8b9b74d7fd6c0c01e14f206478.zip |
Add an EmpathyIndividualView feature for dropping files on Individuals
This allows drag and drop to be enabled for the linking dialogue without
allowing files to be dropped onto the dialogue, which wouldn't make sense.
Helps: bgo#627715
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 16 | ||||
-rw-r--r-- | libempathy-gtk/empathy-individual-view.h | 3 |
2 files changed, 13 insertions, 6 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 6767c3bfd..66ddad73a 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -557,13 +557,19 @@ individual_view_drag_motion (GtkWidget *widget, else { /* This is a file drag, and it can only be dropped on contacts, - not groups. - */ - FolksIndividual *individual; + * not groups. + * If we don't have FEATURE_FILE_DROP, disallow the drop completely, + * even if we have a valid target. */ + FolksIndividual *individual = NULL; EmpathyCapabilities caps = EMPATHY_CAPABILITIES_NONE; - gtk_tree_model_get (model, &iter, - EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, &individual, -1); + if (priv->view_features & EMPATHY_INDIVIDUAL_VIEW_FEATURE_FILE_DROP) + { + gtk_tree_model_get (model, &iter, + EMPATHY_INDIVIDUAL_STORE_COL_INDIVIDUAL, &individual, + -1); + } + if (individual != NULL) { EmpathyContact *contact = NULL; diff --git a/libempathy-gtk/empathy-individual-view.h b/libempathy-gtk/empathy-individual-view.h index 003ff2ab3..4a581c35c 100644 --- a/libempathy-gtk/empathy-individual-view.h +++ b/libempathy-gtk/empathy-individual-view.h @@ -57,7 +57,8 @@ typedef enum EMPATHY_INDIVIDUAL_VIEW_FEATURE_CONTACT_DROP = 1 << 4, EMPATHY_INDIVIDUAL_VIEW_FEATURE_CONTACT_DRAG = 1 << 5, EMPATHY_INDIVIDUAL_VIEW_FEATURE_CONTACT_TOOLTIP = 1 << 6, - EMPATHY_INDIVIDUAL_VIEW_FEATURE_ALL = (1 << 7) - 1, + EMPATHY_INDIVIDUAL_VIEW_FEATURE_FILE_DROP = 1 << 7, + EMPATHY_INDIVIDUAL_VIEW_FEATURE_ALL = (1 << 8) - 1, } EmpathyIndividualViewFeatureFlags; struct _EmpathyIndividualView |