Make sure we can compile QtCore without QT_CONFIG(translation)
Change-Id: I755834b77e50ff6f44bda561f007ec3306f3c1f9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>bb10
parent
a1c84af6f5
commit
710414d4a2
|
|
@ -144,7 +144,7 @@ static inline bool setCloseOnExec(int fd)
|
|||
static inline QString msgOpenDirectory()
|
||||
{
|
||||
const char message[] = QT_TRANSLATE_NOOP("QIODevice", "file to open is a directory");
|
||||
#ifndef QT_BOOTSTRAPPED
|
||||
#if QT_CONFIG(translation)
|
||||
return QIODevice::tr(message);
|
||||
#else
|
||||
return QLatin1String(message);
|
||||
|
|
|
|||
|
|
@ -84,6 +84,9 @@ protected:
|
|||
|
||||
private:
|
||||
void close() Q_DECL_OVERRIDE;
|
||||
#if !QT_CONFIG(translation)
|
||||
static QString tr(const char *string) { return QString::fromLatin1(string); }
|
||||
#endif
|
||||
|
||||
private:
|
||||
Q_DISABLE_COPY(QSaveFile)
|
||||
|
|
|
|||
|
|
@ -72,7 +72,13 @@ QT_BEGIN_NAMESPACE
|
|||
key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
|
||||
{
|
||||
if (key.isEmpty()){
|
||||
errorString = QCoreApplication::tr("%1: key is empty", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
|
||||
errorString =
|
||||
#if QT_CONFIG(translation)
|
||||
QCoreApplication::tr("%1: key is empty", "QSystemSemaphore")
|
||||
#else
|
||||
QString::fromLatin1("%1: key is empty")
|
||||
#endif
|
||||
.arg(QLatin1String("QSystemSemaphore::handle:"));
|
||||
error = QSystemSemaphore::KeyError;
|
||||
return -1;
|
||||
}
|
||||
|
|
@ -84,16 +90,30 @@ key_t QSystemSemaphorePrivate::handle(QSystemSemaphore::AccessMode mode)
|
|||
// Create the file needed for ftok
|
||||
int built = QSharedMemoryPrivate::createUnixKeyFile(fileName);
|
||||
if (-1 == built) {
|
||||
errorString = QCoreApplication::tr("%1: unable to make key", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
|
||||
errorString =
|
||||
#if QT_CONFIG(translation)
|
||||
QCoreApplication::tr("%1: unable to make key", "QSystemSemaphore")
|
||||
#else
|
||||
QString::fromLatin1("%1: unable to make key")
|
||||
#endif
|
||||
.arg(QLatin1String("QSystemSemaphore::handle:"));
|
||||
error = QSystemSemaphore::KeyError;
|
||||
return -1;
|
||||
}
|
||||
createdFile = (1 == built);
|
||||
|
||||
#if !defined(QT_NO_SHAREDMEMORY) && !defined(QT_POSIX_IPC) && !defined(Q_OS_ANDROID)
|
||||
// Get the unix key for the created file
|
||||
unix_key = qt_safe_ftok(QFile::encodeName(fileName), 'Q');
|
||||
#endif
|
||||
if (-1 == unix_key) {
|
||||
errorString = QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore").arg(QLatin1String("QSystemSemaphore::handle:"));
|
||||
errorString =
|
||||
#if QT_CONFIG(translation)
|
||||
QCoreApplication::tr("%1: ftok failed", "QSystemSemaphore")
|
||||
#else
|
||||
QString::fromLatin1("%1: ftok failed")
|
||||
#endif
|
||||
.arg(QLatin1String("QSystemSemaphore::handle:"));
|
||||
error = QSystemSemaphore::KeyError;
|
||||
return -1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue