missing path variable in user commands

Bug #654015 reported by DjSlash
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
LinuxDC++
Fix Released
Wishlist
DjSlash

Bug Description

This is in extend of bug #271565 - the commited fix didn't contain the path of the filename.

I added a patch to make this available. It's created on revno 392 and I tested it. The added variable is %[filePH] and aliased as %[filepath]

Related branches

DjSlash (djslash)
tags: added: user-commands
Revision history for this message
Razzloss (razzloss) wrote :

So there was no need to modify the dcpp/*?

Do you know if similar variables are available in windows dc++ (or other clients)? And if they are, the names should be the same.

--RZ

Revision history for this message
DjSlash (djslash) wrote :

No, no need for a modification on dcpp/* - it was only those cr/lf's. Apparantly I removed them because they were annoying me. I checked by getting the latest trunk and comparing my older dcpp/DirectoryListing.cpp with the newer one.

There are similar variables available in windows dc++, but they are all different. I've compared them recently:

%[mynick] = %[myNI]
%[nick] = %[userNI]
%[file] = %[filePH]%[fileFN]

the last one is with my patch applied, otherwise it's just %[fileFN] - but the windows variant is (iirc) containing the full path.

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Correct me if I'm wrong, but with your patch the behavior between linuxdcpp and dc++ will differ. DC++ has the following:

%[file] = %[fileFN] = path + filename

So DC++ has only one variable to hold both pathname and filename. While your patch will separate path and filename into separate variables:

%[file] = %[fileFN] = filename
%[filepath] = %[filePH] = path

DC++ doesn't seem to have %[filePH] and %[filepath] or any other variable to hold just the path. Of course, the current behavior in linuxdcpp is wrong since it only contains the filename, but shouldn't we fix that by adding the path to %[file] and %[fileFN] instead of creating new variables? Are these other variables common in other clients is that why you included them?

Changed in linuxdcpp:
status: New → Incomplete
Revision history for this message
DjSlash (djslash) wrote :

I didnt want to seperate the path and filename in the first place, but I didn't want to mess with the current variables, so I just added the path variable. Besides that, I could think of things that it might be useful to have those seperated. However, making fileFN containing the path and filename is an easy thing to fix.

Only variable that would be missing is a Magnet link then.

I don't know if other clients have these variables, my guess would be that they have.

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

I would accept a patch to add path to file and fileFN to stay consistent with DC++. If you feel like adding the magnet one, that sounds good as well.

Changed in linuxdcpp:
importance: Undecided → Wishlist
status: Incomplete → Confirmed
Revision history for this message
DjSlash (djslash) wrote :

New patch added

Revision history for this message
DjSlash (djslash) wrote :

Disregard that one, I forgot to clean up

Revision history for this message
DjSlash (djslash) wrote :

Ok, cleaned the patch up and this one also contains my changes to include %[fileMN] for magnet links.

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Crashes if you right click a dir in sharebrowser. You need to check if it is a file or a dir before casting.

Revision history for this message
DjSlash (djslash) wrote :

Noticed that too and changed it already. But I'm a bit stuck now, because if I want to get the path for the directory, it end up with path/to/directory/directory in fileFN. And since my programming skills are a bit limited, I don't know how to fix that at this moment. I attached my changes in sharebrowser.cc

Revision history for this message
Steven Sheehy (steven-sheehy) wrote :

Since you were stuck, I went ahead and made the fix to sharebrowser by getting the path of dir->getParent(). I also added the path to the dirView user commands since that was missing. Thanks for the patch. Your first, but hopefully not your last. :)

Changed in linuxdcpp:
assignee: nobody → DjSlash (djslash)
milestone: none → 1.1.0
status: Confirmed → Fix Committed
Revision history for this message
DjSlash (djslash) wrote :

Great, learned another thing. Thanks for your help. I'll be on the lookout for other things that I might be able to fix. :)

Changed in linuxdcpp:
status: Fix Committed → Fix Released
tags: added: ui
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.