From 85e41d95005a60429681ad99f7ecb18698d0a1c3 Mon Sep 17 00:00:00 2001
From: kondou <kondou@ts.unde.re>
Date: Thu, 5 Sep 2013 23:17:53 +0200
Subject: [PATCH] Sort files by name, not by mimetype

---
 apps/files/ajax/rawlist.php | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/apps/files/ajax/rawlist.php b/apps/files/ajax/rawlist.php
index 2fd6f67d30..e51932dff0 100644
--- a/apps/files/ajax/rawlist.php
+++ b/apps/files/ajax/rawlist.php
@@ -42,4 +42,13 @@ if (is_array($mimetypes) && count($mimetypes)) {
 	}
 }
 
+// Sort by name
+function cmp($a, $b) {
+	if ($a['name'] === $b['name']) {
+		 return 0;
+	}
+	return ($a['name'] < $b['name']) ? -1 : 1;
+}
+uasort($files, 'cmp');
+
 OC_JSON::success(array('data' => $files));
-- 
GitLab