diff --git a/thunar/thunar-shortcuts-model.c b/thunar/thunar-shortcuts-model.c index 6a98e9a44b64a24a49d7f481096bf1bb85e9a0f1..9e954d212f4f5cb5652e2446f99a84c67a951944 100644 --- a/thunar/thunar-shortcuts-model.c +++ b/thunar/thunar-shortcuts-model.c @@ -1960,6 +1960,8 @@ thunar_shortcuts_model_add (ThunarShortcutsModel *model, { ThunarShortcut *shortcut; GFile *location; + GList *lp; + guint position = 0; _thunar_return_if_fail (THUNAR_IS_SHORTCUTS_MODEL (model)); _thunar_return_if_fail (dst_path == NULL || gtk_tree_path_get_depth (dst_path) > 0); @@ -1987,6 +1989,16 @@ thunar_shortcuts_model_add (ThunarShortcutsModel *model, shortcut->gicon = g_themed_icon_new ("folder-remote"); } + /* if no position was given, place the shortcut at the bottom */ + if (dst_path == NULL) + { + for (lp = model->shortcuts; lp != NULL; lp = lp->next) + if (THUNAR_SHORTCUT (lp->data)->group == THUNAR_SHORTCUT_GROUP_PLACES_BOOKMARKS) + position++; + + shortcut->sort_id = ++position; + } + /* add the shortcut to the list at the given position */ thunar_shortcuts_model_add_shortcut_with_path (model, shortcut, dst_path);