Commit 007bddc8 authored by Abhijeetsingh Meena's avatar Abhijeetsingh Meena
Browse files

Coded in the normal coding style and removed comments

parent 7ec22c2c
Pipeline #12174 passed with stages
in 5 minutes and 58 seconds
......@@ -674,36 +674,11 @@ thunar_device_sort (const ThunarDevice *device1,
if (G_OBJECT_TYPE (device1->device) != G_OBJECT_TYPE (device2->device))
return G_IS_MOUNT (device1->device) ? 1 : -1;
// OLD CODE
// /* sort by detect stamp */
// return device1->stamp > device2->stamp ? 1 : -1;
// NEW CODE
// name1 and name2 are pointer which stores data of type gchar ( gtk char )
// name1 and name2 stores names of device1 and device2 respectively
// thunar_device_get_name function is used to assign device names to name1 and name2
gchar * name1 = thunar_device_get_name(device1);
gchar * name2 = thunar_device_get_name(device2);
// code which arranges devices in ASCII order
for ( long unsigned int i = 0 ; i < ( strlen(name1) > strlen(name2) ? strlen(name1) : strlen(name2) ) ; i++ ) {
if ( name1[i] == name2[i] ) {
continue;
}
<<<<<<< Updated upstream
return ( name1[i] > name2[i] ? 1 : -1 );
}
// though code will not reach return 0, but while compiling it was giving warning " control reached end of non-void function "
return 0;
=======
gchar* name1 = thunar_device_get_name(device1);
gchar* name2 = thunar_device_get_name(device2);
/* code which arranges devices in ASCII order */
return g_strcmp0(name1, name2);
>>>>>>> Stashed changes
}
......
......@@ -1084,11 +1084,7 @@ thunar_tree_model_device_added (ThunarDeviceMonitor *device_monitor,
ThunarTreeModel *model)
{
// added item1 to point to next node data
<<<<<<< Updated upstream
ThunarTreeModelItem *item , *item1;
=======
ThunarTreeModelItem *item, *next_item;
>>>>>>> Stashed changes
GtkTreePath *path;
GtkTreeIter iter;
GNode *node;
......@@ -1112,22 +1108,6 @@ thunar_tree_model_device_added (ThunarDeviceMonitor *device_monitor,
for (; node->next != NULL; node = node->next)
{
item = THUNAR_TREE_MODEL_ITEM (node->next->data);
<<<<<<< Updated upstream
/* item1 points to next node data */
item1 = THUNAR_TREE_MODEL_ITEM ((node->next)->next->data);
if (item->device == NULL || item1->device == NULL)
break;
// OLD CODE
// /* sort devices by timestamp */
// if (thunar_device_sort (item->device, device) > 0)
// break;
// NEW CODE
/* sort devices by ASCII order */
if (thunar_device_sort ( item->device , item1->device ) > 0)
=======
/* next_item points to next node data */
next_item = THUNAR_TREE_MODEL_ITEM ((node->next)->next->data);
......@@ -1136,7 +1116,6 @@ thunar_tree_model_device_added (ThunarDeviceMonitor *device_monitor,
/* sort devices by ASCII order */
if (thunar_device_sort (item->device, next_item->device) > 0)
>>>>>>> Stashed changes
break;
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment