| 43 | | /* Don't sort top level */ |
| 44 | | if(!gtk_tree_model_iter_parent(model, &parent, first)) |
| 45 | | { |
| 46 | | g_assert(!gtk_tree_model_iter_parent(model, &parent, second)); |
| 47 | | return 0; |
| 48 | | } |
| 49 | | |
| 50 | | gtk_tree_model_get(model, first, INF_GTK_BROWSER_MODEL_COL_BROWSER, &br_one, INF_GTK_BROWSER_MODEL_COL_NODE, &bri_one, -1); |
| 51 | | gtk_tree_model_get(model, second, INF_GTK_BROWSER_MODEL_COL_BROWSER, &br_two, INF_GTK_BROWSER_MODEL_COL_NODE, &bri_two, -1); |
| 52 | | |
| 53 | | if (infc_browser_iter_is_subdirectory(br_one, bri_one) && !infc_browser_iter_is_subdirectory(br_two, bri_two)) |
| 54 | | result = -1; |
| 55 | | else if (!infc_browser_iter_is_subdirectory(br_one, bri_one) && infc_browser_iter_is_subdirectory(br_two, bri_two)) |
| 56 | | result = 1; |
| 57 | | else |
| | 43 | if(gtk_tree_model_iter_parent(model, &parent, first)) |
| | 44 | { |
| | 45 | g_assert(gtk_tree_model_iter_parent(model, &parent, second)); |
| | 46 | |
| | 47 | gtk_tree_model_get( |
| | 48 | model, first, |
| | 49 | INF_GTK_BROWSER_MODEL_COL_BROWSER, &br_one, |
| | 50 | INF_GTK_BROWSER_MODEL_COL_NODE, &bri_one, |
| | 51 | -1); |
| | 52 | gtk_tree_model_get( |
| | 53 | model, second, |
| | 54 | INF_GTK_BROWSER_MODEL_COL_BROWSER, &br_two, |
| | 55 | INF_GTK_BROWSER_MODEL_COL_NODE, &bri_two, |
| | 56 | -1); |
| | 57 | |
| | 58 | if(infc_browser_iter_is_subdirectory(br_one, bri_one) && |
| | 59 | !infc_browser_iter_is_subdirectory(br_two, bri_two)) |
| | 60 | { |
| | 61 | result = -1; |
| | 62 | } |
| | 63 | else if(!infc_browser_iter_is_subdirectory(br_one, bri_one) && |
| | 64 | infc_browser_iter_is_subdirectory(br_two, bri_two)) |
| | 65 | { |
| | 66 | result = 1; |
| | 67 | } |
| | 68 | else |
| | 69 | { |
| | 70 | result = 0; |
| | 71 | } |
| | 72 | |
| | 73 | g_object_unref(br_one); |
| | 74 | g_object_unref(br_two); |
| | 75 | infc_browser_iter_free(bri_one); |
| | 76 | infc_browser_iter_free(bri_two); |
| | 77 | } |
| | 78 | |
| | 79 | if(!result) |
| 61 | | |
| 62 | | gtk_tree_model_get(model, first, INF_GTK_BROWSER_MODEL_COL_NAME, &name_one, -1); |
| 63 | | gtk_tree_model_get(model, second, INF_GTK_BROWSER_MODEL_COL_NAME, &name_two, -1); |
| 64 | | |
| | 83 | |
| | 84 | gtk_tree_model_get( |
| | 85 | model, first, |
| | 86 | INF_GTK_BROWSER_MODEL_COL_NAME, &name_one, |
| | 87 | -1); |
| | 88 | gtk_tree_model_get( |
| | 89 | model, second, |
| | 90 | INF_GTK_BROWSER_MODEL_COL_NAME, &name_two, |
| | 91 | -1); |
| | 92 | |