Extension Column is Empty.
Windows visual diff and merge for files and directories
Brought to you by:
christianlist,
grimmdp
Version 2.13.4 Unicode
When doing a Folder compare the Extension column is empty for *all* files. This may relate to bug:2563314 where it was requested that Folder.extensions do not show up...
(Personally that may depend. I don't know if the .de is part of an Operating System localization tag (and therefore should be hidden) or if it is by choice. Perhaps we could follow the "Hide Extensions" flag that the operating system puts into the file browser or "finder".
But then, how would we Sort by Extension? Well...sort could be /functional/ and still not show the extensions???
Anyway, have a look at it will you?
Many Thanks,
Yep. I'll look at this.
The fix
Attaching a patch fixing the bug. Simply was using "wrong" path to get the filename.
File Added: Fix_showing_filename_ext.patch
Fix committed to SVN trunk:
Completed: At revision: 6553
Will commit to 2.12 branch too.
Thanks!
I'll check it when it becomes available. :-)
Committed to 2.12 branch (for 2.12.2 stable release):
Completed: At revision: 6554
There is another problem related to extension column.
The extension column is not sortable.
Index: DirViewColItems.cpp
--- DirViewColItems.cpp (revision 6555)
+++ DirViewColItems.cpp (working copy)
@@ -647,10 +647,13 @@
*/
static int ColExtSort(const CDiffContext *pCtxt, const void *p, const void *q)
{
- const String &r = *static_cast<const String*>(p);
- const String &s = *static_cast<const String*>(q);
- return lstrcmpi(PathFindExtension(r.c_str()), PathFindExtension(s.c_str()));
- //return ColExtGet(pCtxt, p).CompareNoCase(ColExtGet(pCtxt, q));
+ const DIFFITEM &ldi = *static_cast<const DIFFITEM *>(p);
+ const DIFFITEM &rdi = *static_cast<const DIFFITEM *>(q);
+ if (ldi.diffcode.isDirectory() && !rdi.diffcode.isDirectory())
+ return -1;
+ if (!ldi.diffcode.isDirectory() && rdi.diffcode.isDirectory())
+ return 1;
+ return lstrcmpi(ColExtGet(pCtxt, p).c_str(), ColExtGet(pCtxt, q).c_str());
}
/**
Argh. I thought the extension fix (original one) was simple enough. But it totally broke the column. :(
+ if (ldi.diffcode.isDirectory() && !rdi.diffcode.isDirectory())
+ return -1;
+ if (!ldi.diffcode.isDirectory() && rdi.diffcode.isDirectory())
+ return 1;
Why you need this? I don't think it is possible to have directory and file in the same line? Our GUI sure doesn't handle that kind of situation so we'd be in problems before sorting... But good point, need to test that kind of situation sometimes.
Oops. Forget my last comment. When sorting we of course compare items from two *different* lines. Variable names ldi and rdi confused me for a moment. So your change is of course ok. Please commit to 2.12 branch too.
Committed to SVN trunk. Completed: At revision: 6560
Committed to 2.12 branch. Completed: At revision: 6561
Should be now fixed in 2.13.5 experimental release.
Closing. Fix Verified in 2.13.5 |:-D
Thanks!