From 81be7a185c95e15d2e7df0826dba4f45c87bf33b Mon Sep 17 00:00:00 2001 From: Sam Bosley Date: Fri, 25 May 2012 13:41:31 -0700 Subject: [PATCH] Better filename display construction --- .../com/todoroo/astrid/files/FilesControlSet.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java b/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java index 0a90090c2..d21b7eba3 100644 --- a/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java +++ b/astrid/plugin-src/com/todoroo/astrid/files/FilesControlSet.java @@ -195,13 +195,13 @@ public class FilesControlSet extends PopupControlSet { } private String getNameString(Metadata metadata) { - int fileType = metadata.getValue(FileMetadata.FILE_TYPE); - if (fileType == FileMetadata.FILE_TYPE_AUDIO || fileType == FileMetadata.FILE_TYPE_IMG) { + File f = new File(metadata.getValue(FileMetadata.FILE_PATH)); + String name = f.getName(); + + if (name.matches("\\d+_\\d+_\\w+.\\w+")) { //$NON-NLS-1$ Date date = new Date(metadata.getValue(FileMetadata.ATTACH_DATE)); return DateUtilities.getDateStringWithTime(activity, date); } else { - File f = new File(metadata.getValue(FileMetadata.FILE_PATH)); - String name = f.getName(); int extension = name.lastIndexOf('.'); if (extension < 0) return name;