Bug 357499 - QFileDialog don't work if application name contains '/' sign
Summary: QFileDialog don't work if application name contains '/' sign
Status: RESOLVED FIXED
Alias: None
Product: frameworks-kio
Classification: Frameworks and Libraries
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: David Faure
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-01-04 07:41 UTC by Tomasz Meresiński
Modified: 2016-03-05 09:54 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tomasz Meresiński 2016-01-04 07:41:28 UTC
When application has application name containing '/' (for example "dir/subdir") QFileDialog won't work with error "KIO Connection server not listening, could not connect".

Reproducible: Always




Example code:
#include <QApplication>
#include <QFileDialog>

int main(int argc, char *argv[]) {
    QApplication app(argc, argv);
    app.setApplicationName("Dir/Subdir");
    QFileDialog::getOpenFileName();
}

Most probable explanation:
In strace I can see log: "open("/run/user/1000/Dir/SubdirXM5962.2.slave-socket", O_RDWR|O_CREAT|O_EXCL|O_CLOEXEC, 0600) = -1 ENOENT (No such file or directory)" so KIO (or something else) doesn't create necessary directory.
Comment 1 David Faure 2016-03-05 09:48:36 UTC
I can fix this, but I think a lot of other code paths in Qt would break with a '/' in the application name, since it's very often used as a folder name (including within QStandardPaths etc.)...
Comment 2 David Faure 2016-03-05 09:54:43 UTC
Git commit 7ce16af2953df10cc191310b2f178967c7b52a93 by David Faure.
Committed on 05/03/2016 at 09:54.
Pushed by dfaure into branch 'master'.

Fix KIO app-slave connection breaking if appName contains a '/'.

+ improved error handling when KIO can't set up the socket for app-slave communication.
(no point in launching a kioslave with an empty socket as argument, which will then
assert with a confusing message about unknown protocol "")

M  +1    -0    autotests/jobtest.cpp
M  +1    -0    autotests/kiotesthelper.h
M  +3    -1    src/core/connectionbackend.cpp
M  +6    -0    src/core/slave.cpp
M  +1    -0    src/core/slavebase.cpp

http://commits.kde.org/kio/7ce16af2953df10cc191310b2f178967c7b52a93