Open Containing Folder bug #2628

Closed
opened 2026-02-21 16:19:25 -05:00 by deekerman · 16 comments
Owner

Originally created by @tekko on GitHub (Jun 12, 2015).

"open containing folder" under torrent content won't work for file names like "123-123-abc-1080p,.mp4"
It was a single file torrent with no root folder.
Removing the comma before the file extension fixes it. (123-123-abc-1080p.mp4)

xpsp3 x86
qbt v3.2.0

Originally created by @tekko on GitHub (Jun 12, 2015). "open containing folder" under torrent content won't work for file names like "123-123-abc-1080p,.mp4" It was a single file torrent with no root folder. Removing the comma before the file extension fixes it. (123-123-abc-1080p.mp4) xpsp3 x86 qbt v3.2.0
deekerman 2026-02-21 16:19:25 -05:00
Author
Owner

@ngosang commented on GitHub (Jun 12, 2015):

@pmzqla Maybe it's already fixed in #2544.

@ngosang commented on GitHub (Jun 12, 2015): @pmzqla Maybe it's already fixed in #2544.
Author
Owner

@chrishirst commented on GitHub (Jun 12, 2015):

https://msdn.microsoft.com/en-us/library/aa368590(v=vs.85).aspx

@chrishirst commented on GitHub (Jun 12, 2015): https://msdn.microsoft.com/en-us/library/aa368590(v=vs.85).aspx
Author
Owner

@Dementei2 commented on GitHub (Jul 12, 2015):

Please fix it.
qbt 3.2.1 not fixed.

@Dementei2 commented on GitHub (Jul 12, 2015): Please fix it. qbt 3.2.1 not fixed.
Author
Owner

@chrishirst commented on GitHub (Jul 12, 2015):

It is a Windows problem, not a qBittorrent one, and has been problematic, under some circumstances, since Microsoft "kludged" long file names in to Windows 95/98

@chrishirst commented on GitHub (Jul 12, 2015): It is a Windows problem, not a qBittorrent one, and has been problematic, under some circumstances, since Microsoft "kludged" long file names in to Windows 95/98
Author
Owner

@tekko commented on GitHub (Jul 12, 2015):

Don't know if it makes any difference, it opens with default player when I double clicked. And I have short filenames disabled.

@tekko commented on GitHub (Jul 12, 2015): Don't know if it makes any difference, it opens with default player when I double clicked. And I have short filenames disabled.
Author
Owner

@Dementei2 commented on GitHub (Jul 16, 2015):

Firefox, free download manager do not have this problem.

@Dementei2 commented on GitHub (Jul 16, 2015): Firefox, free download manager do not have this problem.
Author
Owner

@pmzqla commented on GitHub (Jul 16, 2015):

Could you add a white space somewhere in the name of the file that contains a comma and try to open it?

Rationale: Qt automatically wraps the arguments with quotes if there are white spaces in them. We are not doing that manually because of this, but probably we will have to because of special chars such as commas that apparently causes issues on Windows.

@pmzqla commented on GitHub (Jul 16, 2015): Could you add a white space somewhere in the name of the file that contains a comma and try to open it? Rationale: Qt automatically wraps the arguments with quotes if there are white spaces in them. We are not doing that manually because of this, but probably we will have to because of special chars such as commas that apparently causes issues on Windows.
Author
Owner

@Dementei2 commented on GitHub (Jul 16, 2015):

After adding a space everything is ok.

@Dementei2 commented on GitHub (Jul 16, 2015): After adding a space everything is ok.
Author
Owner

@pmzqla commented on GitHub (Jul 16, 2015):

OK.

@sledgehammer999 This is a Windows thing, could you take care of it?
Not sure of this, but I'd try with something like:

QProcess::startDetached("explorer.exe", QStringList() << "/select," << "\"" + toNativePath(path) + "\"");
@pmzqla commented on GitHub (Jul 16, 2015): OK. @sledgehammer999 This is a Windows thing, could you take care of it? Not sure of this, but I'd try with something like: ``` QProcess::startDetached("explorer.exe", QStringList() << "/select," << "\"" + toNativePath(path) + "\""); ```
Author
Owner

@chrishirst commented on GitHub (Jul 16, 2015):

but probably we will have to because of special chars such as commas that apparently causes issues on Windows.

It is specifically 'special characters' at the end of the file name and some at the start that you need to be concerned about.

@chrishirst commented on GitHub (Jul 16, 2015): > but probably we will have to because of special chars such as commas that apparently causes issues on Windows. It is specifically 'special characters' at the end of the file name and some at the start that you need to be concerned about.
Author
Owner

@sledgehammer999 commented on GitHub (Aug 29, 2015):

For anyone wanting to fix this please see my comment here: https://github.com/qbittorrent/qBittorrent/pull/2544#issuecomment-135988754

@sledgehammer999 commented on GitHub (Aug 29, 2015): For anyone wanting to fix this please see my comment here: https://github.com/qbittorrent/qBittorrent/pull/2544#issuecomment-135988754
Author
Owner

@heksbeks commented on GitHub (Nov 28, 2015):

Here is a simpler way than the current fix to do it, it also works with comma in absolutePath.
It uses the concurrent framework to start it detached with a lambda function (the capture list
has the variable absolutePath):

QtConcurrent::run([absolutePath](){
    QProcess p;
    p.setNativeArguments("/e, /select, \"" + QDir::toNativeSeparators(absolutePath) + "\"");
    p.start("explorer");
    p.waitForFinished();
});
@heksbeks commented on GitHub (Nov 28, 2015): Here is a simpler way than the current fix to do it, it also works with comma in absolutePath. It uses the concurrent framework to start it detached with a lambda function (the capture list has the variable absolutePath): ``` QtConcurrent::run([absolutePath](){ QProcess p; p.setNativeArguments("/e, /select, \"" + QDir::toNativeSeparators(absolutePath) + "\""); p.start("explorer"); p.waitForFinished(); }); ```
Author
Owner

@ngosang commented on GitHub (Nov 28, 2015):

@sledgehammer999

@ngosang commented on GitHub (Nov 28, 2015): @sledgehammer999
Author
Owner

@sledgehammer999 commented on GitHub (Nov 29, 2015):

Thanks but I am not going to change it to the above.

@sledgehammer999 commented on GitHub (Nov 29, 2015): Thanks but I am not going to change it to the above.
Author
Owner

@heksbeks commented on GitHub (Nov 29, 2015):

No prop. Just for the records, this here works too:
QProcess::startDetached("explorer", QStringList() << "/e," << "/select," << QDir::toNativeSeparators(absolutePath));

@heksbeks commented on GitHub (Nov 29, 2015): No prop. Just for the records, this here works too: QProcess::startDetached("explorer", QStringList() << "/e," << "/select," << QDir::toNativeSeparators(absolutePath));
Author
Owner

@heksbeks commented on GitHub (Nov 29, 2015):

I wonder what went wrong in the code above, maybe the bug is in the old Qt version, I tested with Qt 5.5.1.

@heksbeks commented on GitHub (Nov 29, 2015): I wonder what went wrong in the code above, maybe the bug is in the old Qt version, I tested with Qt 5.5.1.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/qBittorrent#2628
No description provided.