Mark error message in qfsfileengine_unix.cpp as translatable.
Task-number: QTBUG-35594 Change-Id: I7aeab890a5972813f38370ff20f5b68839833e3b Reviewed-by: David Faure <david.faure@kdab.com>
This commit is contained in:
parent
419a1f53d5
commit
d47f83cab0
@ -45,6 +45,7 @@
|
|||||||
#include "private/qcore_unix_p.h"
|
#include "private/qcore_unix_p.h"
|
||||||
#include "qfilesystementry_p.h"
|
#include "qfilesystementry_p.h"
|
||||||
#include "qfilesystemengine_p.h"
|
#include "qfilesystemengine_p.h"
|
||||||
|
#include "qcoreapplication.h"
|
||||||
|
|
||||||
#ifndef QT_NO_FSFILEENGINE
|
#ifndef QT_NO_FSFILEENGINE
|
||||||
|
|
||||||
@ -142,6 +143,16 @@ static inline bool setCloseOnExec(int fd)
|
|||||||
return fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) != -1;
|
return fd != -1 && fcntl(fd, F_SETFD, FD_CLOEXEC) != -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static inline QString msgOpenDirectory()
|
||||||
|
{
|
||||||
|
const char message[] = QT_TRANSLATE_NOOP("QIODevice", "file to open is a directory");
|
||||||
|
#ifndef QT_BOOTSTRAPPED
|
||||||
|
return QIODevice::tr(message);
|
||||||
|
#else
|
||||||
|
return QLatin1String(message);
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
\internal
|
\internal
|
||||||
*/
|
*/
|
||||||
@ -169,7 +180,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
|
|||||||
// we had received EISDIR anyway.
|
// we had received EISDIR anyway.
|
||||||
if (QFileSystemEngine::fillMetaData(fd, metaData)
|
if (QFileSystemEngine::fillMetaData(fd, metaData)
|
||||||
&& metaData.isDirectory()) {
|
&& metaData.isDirectory()) {
|
||||||
q->setError(QFile::OpenError, QLatin1String("file to open is a directory"));
|
q->setError(QFile::OpenError, msgOpenDirectory());
|
||||||
QT_CLOSE(fd);
|
QT_CLOSE(fd);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -210,7 +221,7 @@ bool QFSFileEnginePrivate::nativeOpen(QIODevice::OpenMode openMode)
|
|||||||
// we had received EISDIR anyway.
|
// we had received EISDIR anyway.
|
||||||
if (QFileSystemEngine::fillMetaData(QT_FILENO(fh), metaData)
|
if (QFileSystemEngine::fillMetaData(QT_FILENO(fh), metaData)
|
||||||
&& metaData.isDirectory()) {
|
&& metaData.isDirectory()) {
|
||||||
q->setError(QFile::OpenError, QLatin1String("file to open is a directory"));
|
q->setError(QFile::OpenError, msgOpenDirectory());
|
||||||
fclose(fh);
|
fclose(fh);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user