~ubuntu-branches/ubuntu/vivid/cairo-dock-plug-ins/vivid

« back to all changes in this revision

Viewing changes to shortcuts/src/applet-bookmarks.c

Tags: upstream-2.0.9
ImportĀ upstreamĀ versionĀ 2.0.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
17
17
* along with this program.  If not, see <http://www.gnu.org/licenses/>.
18
18
*/
19
19
 
20
 
/******************************************************************************
21
 
 
22
 
This file is a part of the cairo-dock program,
23
 
released under the terms of the GNU General Public License.
24
 
 
25
 
Written by Fabrice Rey (for any bug report, please mail me to fabounet@users.berlios.de)
26
 
 
27
 
******************************************************************************/
28
20
#include <stdlib.h>
29
21
#include <string.h>
30
22
#include <glib/gi18n.h>
107
99
                                        }
108
100
                                }
109
101
                                Icon *pExistingIcon = cairo_dock_get_icon_with_base_uri (pPrevBookmarkIconList, cOneBookmark);
110
 
                                if (pExistingIcon != NULL && (cUserName == NULL || strcmp (pExistingIcon->acName, cUserName) == 0) && cURI != NULL)  // on la reinsere a sa place. Si le nom utilisateur a change, on se prend pas la tete, on la recree.
 
102
                                if (pExistingIcon != NULL && (cUserName == NULL || strcmp (pExistingIcon->cName, cUserName) == 0) && cURI != NULL)  // on la reinsere a sa place. Si le nom utilisateur a change, on se prend pas la tete, on la recree.
111
103
                                {
112
104
                                        cd_message (" = 1 signet : %s", cOneBookmark);
113
105
                                        pPrevBookmarkIconList = g_list_remove (pPrevBookmarkIconList, pExistingIcon);
143
135
                                                }
144
136
                                                if (cRealURI == NULL)
145
137
                                                        cRealURI = g_strdup ("none");
146
 
                                                pNewIcon->acName = cName;
147
 
                                                pNewIcon->acCommand = cRealURI;
148
 
                                                pNewIcon->acFileName = cIconName;
 
138
                                                pNewIcon->cName = cName;
 
139
                                                pNewIcon->cCommand = cRealURI;
 
140
                                                pNewIcon->cFileName = cIconName;
149
141
                                                pNewIcon->iVolumeID = iVolumeID;
150
142
                                                pNewIcon->fOrder = fCurrentOrder ++;
151
143
                                                if (myDesklet)
188
180
                }
189
181
                g_free (cBookmarkFilePath);
190
182
                if (myDock)
 
183
                {
191
184
                        cairo_dock_update_dock_size (myIcon->pSubDock);
 
185
                }
192
186
                else
193
187
                {
194
 
                        cairo_dock_set_desklet_renderer_by_name (myDesklet, "Tree", NULL, CAIRO_DOCK_LOAD_ICONS_FOR_DESKLET, NULL);
195
 
                        gtk_widget_queue_draw (myDesklet->pWidget);
 
188
                        const gchar *cDeskletRendererName = NULL;
 
189
                        switch (myConfig.iDeskletRendererType)
 
190
                        {
 
191
                                case CD_DESKLET_SLIDE :
 
192
                                default :
 
193
                                        cDeskletRendererName = "Slide";
 
194
                                break ;
 
195
                                
 
196
                                case CD_DESKLET_TREE :
 
197
                                        cDeskletRendererName = "Tree";
 
198
                                break ;
 
199
                        }
 
200
                        cairo_dock_set_desklet_renderer_by_name (myDesklet, cDeskletRendererName, NULL, CAIRO_DOCK_LOAD_ICONS_FOR_DESKLET, NULL);
 
201
                        gtk_widget_queue_draw (myDesklet->container.pWidget);
196
202
                }
197
203
        }
198
204
}
342
348
                                }
343
349
                                if (cRealURI == NULL)
344
350
                                        cRealURI = g_strdup ("none");
345
 
                                pNewIcon->acName = cName;
346
 
                                pNewIcon->acCommand = cRealURI;
347
 
                                pNewIcon->acFileName = cIconName;
 
351
                                pNewIcon->cName = cName;
 
352
                                pNewIcon->cCommand = cRealURI;
 
353
                                pNewIcon->cFileName = cIconName;
348
354
                                pNewIcon->iVolumeID = iVolumeID;
349
355
                                pNewIcon->fOrder = fCurrentOrder ++;
350
356
                                pBookmarkIconList = g_list_append (pBookmarkIconList, pNewIcon);