Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

qdirstat.desktop file: Exec key value #21

Closed
mcfadzgit opened this issue Jun 30, 2016 · 3 comments
Closed

qdirstat.desktop file: Exec key value #21

mcfadzgit opened this issue Jun 30, 2016 · 3 comments
Labels

Comments

@mcfadzgit
Copy link

Enclosing the field code in double quotes means that if QDirStat is run without parameters, it assumes the current directory is to be opened. Expected behaviour would surely be to prompt for the directory to open, if there is no directory parameter specified?

Also, perhaps it would be helpful to add mount point mime-type to MimeType key value.

Suggested changes:
Exec=qdirstat %u
MimeType=inode/directory;inode/mount-point;

@shundhammer
Copy link
Owner

Yes, you are right, it should open a directory selection box when started without URL. I was wondering if that plain %u without double quotes might be a security problem, but it turns out that there is no shell expansion involved that might break URLs with, say, blanks into two parameters, so it should still be safe.

In addition to that, the code in main() now also checks if that URL parameter is empty and only uses it if it contains anything.

And while testing this, I discovered that the error handling was not very graceful if an invalid path was specified on the command line; this will now no longer just throw an exception on the command line and make the program appear to have crashed, it now opens an error popup.

Thanks for spotting this!

@shundhammer
Copy link
Owner

As for that inode/mount-point MimeType, I added it, but I could not see any difference in my desktop environment (KDE 4; will try XFce in the next days) since it does not seem to make a difference between mount points and other directories. Maybe other desktop environments do, so I added your suggested change; if it doesn't help, I don't see that it might hurt anyone.

@mcfadzgit
Copy link
Author

Thank you for fixing these issues so swiftly.
It depends on which program is determining MIME-type:
'file' and 'gvfs' return a mount point as 'inode/directory', but 'mimetype' returns 'inode/mount-point'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants