DownloadQueue: log full path on ed2k-link duplicate - #172
Merged
Conversation
The "You already have the file '%s'" log line printed only the bare filename, which made the file hard to locate on disk when the user had renamed it locally or had several shared roots. The full path is already computed two lines above for the existence check; just pass that to CFormat instead of the bare filename. Output goes from You already have the file 'XYZ.avi' to You already have the file '/home/user/Music/XYZ.avi' The basename is still present in the formatted string (it's the tail of the path), so existing log greps for the filename still match. The msgid stays byte-identical so .pot/.po catalogs are untouched. Closes amule-project#168
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #168.
The "You already have the file '%s'" log line printed only the bare filename when an
ed2k://link resolved to a file already in the user's shared set. Stoatwblr's report on #168: when the local file has been renamed (or lives in a non-default shared root), the bare filename in the log doesn't tell the user where to actually find it on disk.The full path is already computed two lines above the log site in
DownloadQueue.cpp:385for theFileExists()existence check, so the fix is a one-liner — swapfile->GetFileName()forfullpathin theCFormat:Output goes from
You already have the file 'XYZ.avi'toYou already have the file '/home/user/Music/XYZ.avi'. The basename is still in the formatted string (tail of the path), so existing log greps for the filename keep matching.The msgid stays byte-identical, so
po/amule.potand the 40po/*.pocatalogs are untouched and translators don't get a fuzzy entry.Scope limit
IsFileExistingonly receives the MD4 hash, not the ed2k-link filename the user clicked. Stoat's example showed both names (link name "as" local name); plumbing the link filename through every caller would be a much bigger change for a log-line tweak. Showing the on-disk path solves the "can't find the file" problem on its own.Test plan