[nautilus] Display recent files in modification time order
- From: William Jon McCann <mccann src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus] Display recent files in modification time order
- Date: Mon, 16 Jul 2012 17:08:29 +0000 (UTC)
commit 5b69193ce6f117cd48a1a5777d3b1dd0e1be72cb
Author: William Jon McCann <jmccann redhat com>
Date: Mon Jul 16 10:39:07 2012 -0400
Display recent files in modification time order
libnautilus-private/nautilus-file.c | 23 +++++++++++++++--------
1 files changed, 15 insertions(+), 8 deletions(-)
---
diff --git a/libnautilus-private/nautilus-file.c b/libnautilus-private/nautilus-file.c
index 598b4db..1721c68 100644
--- a/libnautilus-private/nautilus-file.c
+++ b/libnautilus-private/nautilus-file.c
@@ -7446,17 +7446,21 @@ nautilus_file_list_from_uris (GList *uri_list)
static gboolean
get_attributes_for_default_sort_type (NautilusFile *file,
+ gboolean *is_recent,
gboolean *is_download,
gboolean *is_trash)
{
- gboolean is_download_dir, is_desktop_dir, is_trash_dir, retval;
+ gboolean is_recent_dir, is_download_dir, is_desktop_dir, is_trash_dir, retval;
+ *is_recent = FALSE;
*is_download = FALSE;
*is_trash = FALSE;
retval = FALSE;
/* special handling for certain directories */
if (file && nautilus_file_is_directory (file)) {
+ is_recent_dir =
+ nautilus_file_is_in_recent (file);
is_download_dir =
nautilus_file_is_user_special_directory (file, G_USER_DIRECTORY_DOWNLOAD);
is_desktop_dir =
@@ -7470,6 +7474,9 @@ get_attributes_for_default_sort_type (NautilusFile *file,
} else if (is_trash_dir) {
*is_trash = TRUE;
retval = TRUE;
+ } else if (is_recent_dir) {
+ *is_recent = TRUE;
+ retval = TRUE;
}
}
@@ -7481,14 +7488,14 @@ nautilus_file_get_default_sort_type (NautilusFile *file,
gboolean *reversed)
{
NautilusFileSortType retval;
- gboolean is_download, is_trash, res;
+ gboolean is_recent, is_download, is_trash, res;
retval = NAUTILUS_FILE_SORT_NONE;
- is_download = is_trash = FALSE;
- res = get_attributes_for_default_sort_type (file, &is_download, &is_trash);
+ is_recent = is_download = is_trash = FALSE;
+ res = get_attributes_for_default_sort_type (file, &is_recent, &is_download, &is_trash);
if (res) {
- if (is_download) {
+ if (is_recent || is_download) {
retval = NAUTILUS_FILE_SORT_BY_MTIME;
} else if (is_trash) {
retval = NAUTILUS_FILE_SORT_BY_TRASHED_TIME;
@@ -7507,14 +7514,14 @@ nautilus_file_get_default_sort_attribute (NautilusFile *file,
gboolean *reversed)
{
const gchar *retval;
- gboolean is_download, is_trash, res;
+ gboolean is_recent, is_download, is_trash, res;
retval = NULL;
is_download = is_trash = FALSE;
- res = get_attributes_for_default_sort_type (file, &is_download, &is_trash);
+ res = get_attributes_for_default_sort_type (file, &is_recent, &is_download, &is_trash);
if (res) {
- if (is_download) {
+ if (is_recent || is_download) {
retval = g_quark_to_string (attribute_date_modified_q);
} else if (is_trash) {
retval = g_quark_to_string (attribute_trashed_on_q);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]