Opened 13 years ago
Closed 12 years ago
#7951 closed enhancement (fixed)
[LaunchBox] add Open containing folder option (easy)
Reported by: | diver | Owned by: | stippi |
---|---|---|---|
Priority: | normal | Milestone: | R1 |
Component: | Applications/LaunchBox | Version: | R1/Development |
Keywords: | gsoc2012 | Cc: | |
Blocked By: | Blocking: | ||
Platform: | All |
Description
It would be handy to be able to open containing folder if some problem arise or just quickly go to app folder. We already have "Open Target Folder" tracker add-on, so it might be better to add Tracker's Add-ons menu instead.
Attachments (3)
Change History (15)
comment:1 by , 13 years ago
Summary: | [LaunchBox] add Open target folder option → [LaunchBox] add Open containing folder option (easy) |
---|
comment:2 by , 13 years ago
comment:3 by , 13 years ago
The LaunchBox contains links to objects. It would be nice to be able to right-click such an object and have a menu to open the folder it's located in. Tracker has such a function under "Add-ons | Open target folder (ALT+OPT+O)" when you right-click a symlinked object -- see all entries of "Deskbar | Applications" for example.
Instead of a single new menu item in LaunchBox to "Open target folder", it would be even nicer to provide the same "Add-Ons" menu Tracker is showing. It's contents depends on the filetype of the object and there might be other interesting Tracker Add-Ons for the object.
comment:4 by , 13 years ago
patch: | 0 → 1 |
---|
comment:5 by , 13 years ago
I've made mistake in new2.patch...the new3.patch file is working...try it out and give me your feedback
comment:6 by , 13 years ago
Thanks for the patch! It looks basically good, and everything seems to be at the right place. I have a few suggestions, though, and there are a few coding style violations:
- Please don't use abbreviations that hide the meaning of the word. For example, the
CONT
in the message constant should just stayCONTAINING
. - Why add the button as reference if you only ever use its Ref()? You could add the entry_ref directly to the message instead.
- If the method you are calling isn't documented to return a value different from B_OK on success, you should only test ==, not >=.
- We prefer to use
button->Ref() != NULL
in comparisons to make it a boolean comparison for clarity. - The code you are using does not do any error checking. The only effect this will have in this case is that nothing happens, so that's probably acceptable. In any case, you might want to only add that menu item if the button is not empty, and has a valid entry_ref in the first place.
- Instead of nesting to if's without any extra code, you could use a && and save an extra indenting level.
- The variable names you chose aren't coding style compliant; we use camel case, and variable names always start with a lower case letter. In other words,
Opentarget
would becomeopenTarget
,Openmsger
could be calledtracker
instead, or, if you prefertrackerMessenger
, etc. - You sometimes use no spacing, like after the second
if
, or around the=
operator.
Would be great if you could take another look at your code with the comments in mind :-)
follow-up: 8 comment:7 by , 13 years ago
Thank you for your suggestions..I have made a new patch rectifying most of them
- There are a lot of cases where the if conditions don't have an RHS..is this a part of the guideline?
- I have used the button as a reference because I thought it might help while creating the add-on menu
If I have made any more mistakes I'll be happy to rectify them..Appreciate your reply
comment:8 by , 13 years ago
Replying to abhiin1947:
- There are a lot of cases where the if conditions don't have an RHS..is this a part of the guideline?
RHS = right hand side? The condition should always be a boolean condition - if it already is, there is no need for a == true
, for example.
Also, our coding style is evolving over time, too, and not everyone is always writing perfect code, anyway. We just try hard to follow it as much as possible, and try to only accept new code which follows it.
- I have used the button as a reference because I thought it might help while creating the add-on menu
What add-on menu do you mean?
Anyway, thanks for the update! Your patch looks very good now, and I would apply it as soon as possible; while I don't have much time right now, it'll happen next weekend at the latest.
comment:11 by , 13 years ago
Keywords: | gsoc2012 added |
---|
comment:12 by , 12 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Applied in hrev45291. Thanks for the patch abhiin1947!
Sorry, could you explain this one a bit further? Found this one in the easy tasks lists but I don't fully understand it.