kdesudo: use the static QFile::exists() method instead of constructing QFile object and changing its filename

Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
Ivailo Monev 2022-10-09 03:44:50 +03:00
parent dcc3b987b4
commit 3bc3e31176

View file

@ -177,10 +177,7 @@ KdeSudo::KdeSudo(const QString &icon, const QString &appname) :
// non root users need to be able to read the xauth file.
// the xauth file is deleted when kdesudo exits. security?
QFile tf;
tf.setFileName(m_tmpName);
if (!runas.isEmpty() && runas != "root" && tf.exists()) {
if (!runas.isEmpty() && runas != "root" && QFile::exists(m_tmpName)) {
chmod(QFile::encodeName(m_tmpName), 0644);
}