Skip to content

Commit 9aae774

Browse files
committed
avoid uninitialised QProcess usage
`mount.readAllStandardError()` yields the empty string as the QProcess is not set up yet, i.e. mounting a disk via clicking on it in Dolphin does not work and instead just shows an unhelpful error. Remove the block that appears further down in the function again. Mounting still fails, but with a proper error this time. Needs more fixing, but this part is obviously wrong. From @klemensn
1 parent 9f6b2d9 commit 9aae774

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/blockfilesystem.cpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,19 +124,12 @@ QString BlockFilesystem::Mount(const Block& block,
124124
return QString();
125125
}
126126

127-
QProcess mount;
128-
const QString mountPoint = createMountPoint(block.id().replace(' ', '_'), uidReply.value());
129-
if (mountPoint.isEmpty()) {
130-
const QString error = "Mount: failed with " + mount.readAllStandardError();
131-
removeMountPoint(mountPoint);
132-
conn.send(msg.createErrorReply("org.freedesktop.UDisks2.Error.Failed", error));
133-
return QString();
134-
}
135-
127+
const auto mountPoint = createMountPoint(block.id().replace(' ', '_'), uidReply.value());
136128
const auto mountProg = getMountCommand();
137129
if (mountProg.isEmpty())
138130
return QString();
139131

132+
QProcess mount;
140133
mount.setProgram(mountProg);
141134

142135
QStringList args;

0 commit comments

Comments
 (0)