${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemsemaphore.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemsemaphore_p.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qmath.h
- ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemerror_p.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qcore_unix_p.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qeventdispatcher_unix_p.h
${CMAKE_CURRENT_SOURCE_DIR}/plugin/qfactoryinterface.h
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsharedmemory.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemsemaphore.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qpointer.cpp
- ${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemerror.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qcore_unix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsharedmemory_unix.cpp
${CMAKE_CURRENT_SOURCE_DIR}/kernel/qsystemsemaphore_unix.cpp
#include "qfile.h"
#include "qfilesystementry_p.h"
#include "qfilesystemmetadata_p.h"
-#include "qsystemerror_p.h"
QT_BEGIN_NAMESPACE
static bool createDirectory(const QFileSystemEntry &entry, bool createParents);
static bool removeDirectory(const QFileSystemEntry &entry, bool removeEmptyParents);
- static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
+ static bool createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, int *error);
- static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
- static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error);
- static bool removeFile(const QFileSystemEntry &entry, QSystemError &error);
+ static bool copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, int *error);
+ static bool renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, int *error);
+ static bool removeFile(const QFileSystemEntry &entry, int *error);
- static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error);
+ static bool setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, int *error);
static bool setCurrentPath(const QFileSystemEntry &entry);
static QFileSystemEntry currentPath();
}
//static
-bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
+bool QFileSystemEngine::createLink(const QFileSystemEntry &source, const QFileSystemEntry &target, int *error)
{
if (::symlink(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)
return true;
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
return false;
}
//static
-bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
+bool QFileSystemEngine::copyFile(const QFileSystemEntry &source, const QFileSystemEntry &target, int *error)
{
QT_STATBUF st;
if (QT_STAT(source.nativeFilePath().constData(), &st) == 0) {
const int sourcefd = QT_OPEN(source.nativeFilePath().constData(), O_RDONLY);
if (sourcefd == -1) {
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
return false;
}
const int targetfd = QT_CREAT(target.nativeFilePath().constData(), st.st_mode);
if (targetfd == -1) {
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
::close(sourcefd);
return false;
}
ssize_t sendresult = QT_SENDFILE(targetfd, sourcefd, Q_NULLPTR, tocopy);
while (sendresult != tocopy) {
if (sendresult == -1) {
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
::close(sourcefd);
::close(targetfd);
return false;
while (QT_OFF_T(totalwrite) != tocopy) {
const size_t readresult = QT_READ(sourcefd, copybuffer, sizeof(copybuffer));
if (readresult == -1) {
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
::close(sourcefd);
::close(targetfd);
return false;
const size_t writeresult = QT_WRITE(targetfd, copybuffer, readresult);
if (writeresult != readresult) {
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
::close(sourcefd);
::close(targetfd);
return false;
}
//static
-bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, QSystemError &error)
+bool QFileSystemEngine::renameFile(const QFileSystemEntry &source, const QFileSystemEntry &target, int *error)
{
if (::rename(source.nativeFilePath().constData(), target.nativeFilePath().constData()) == 0)
return true;
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
return false;
}
//static
-bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, QSystemError &error)
+bool QFileSystemEngine::removeFile(const QFileSystemEntry &entry, int *error)
{
if (unlink(entry.nativeFilePath().constData()) == 0)
return true;
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
return false;
}
//static
-bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, QSystemError &error)
+bool QFileSystemEngine::setPermissions(const QFileSystemEntry &entry, QFile::Permissions permissions, int *error)
{
mode_t mode = 0;
if (permissions & QFile::ReadOwner)
if (::chmod(entry.nativeFilePath().constData(), mode) == 0)
return true;
- error = QSystemError(errno, QSystemError::StandardLibraryError);
+ *error = errno;
return false;
}
bool QFSFileEngine::remove()
{
Q_D(QFSFileEngine);
- QSystemError error;
- bool ret = QFileSystemEngine::removeFile(d->fileEntry, error);
+ int error;
+ bool ret = QFileSystemEngine::removeFile(d->fileEntry, &error);
d->metaData.clear();
if (!ret) {
- setError(QFile::RemoveError, error.toString());
+ setError(QFile::RemoveError, qt_error_string(error));
}
return ret;
}
bool QFSFileEngine::copy(const QString &newName)
{
Q_D(QFSFileEngine);
- QSystemError error;
- bool ret = QFileSystemEngine::copyFile(d->fileEntry, QFileSystemEntry(newName), error);
+ int error;
+ bool ret = QFileSystemEngine::copyFile(d->fileEntry, QFileSystemEntry(newName), &error);
if (!ret) {
- setError(QFile::CopyError, error.toString());
+ setError(QFile::CopyError, qt_error_string(error));
}
return ret;
}
bool QFSFileEngine::rename(const QString &newName)
{
Q_D(QFSFileEngine);
- QSystemError error;
- bool ret = QFileSystemEngine::renameFile(d->fileEntry, QFileSystemEntry(newName), error);
+ int error;
+ bool ret = QFileSystemEngine::renameFile(d->fileEntry, QFileSystemEntry(newName), &error);
if (!ret) {
- setError(QFile::RenameError, error.toString());
+ setError(QFile::RenameError, qt_error_string(error));
}
return ret;
bool QFSFileEngine::link(const QString &newName)
{
Q_D(QFSFileEngine);
- QSystemError error;
- bool ret = QFileSystemEngine::createLink(d->fileEntry, QFileSystemEntry(newName), error);
+ int error;
+ bool ret = QFileSystemEngine::createLink(d->fileEntry, QFileSystemEntry(newName), &error);
if (!ret) {
- setError(QFile::RenameError, error.toString());
+ setError(QFile::RenameError, qt_error_string(error));
}
return ret;
}
bool QFSFileEngine::setPermissions(uint perms)
{
Q_D(QFSFileEngine);
- QSystemError error;
- if (!QFileSystemEngine::setPermissions(d->fileEntry, QFile::Permissions(perms), error)) {
- setError(QFile::PermissionsError, error.toString());
+ int error;
+ if (!QFileSystemEngine::setPermissions(d->fileEntry, QFile::Permissions(perms), &error)) {
+ setError(QFile::PermissionsError, qt_error_string(error));
return false;
}
return true;
#include "qplatformdefs.h"
#include "qfile_p.h"
#include "qfsfileengine_p.h"
-#include "qsystemerror_p.h"
#include "qfilesystemengine_p.h"
#include "qcore_unix_p.h" // overrides QT_OPEN
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2016-2020 Ivailo Monev
-**
-** This file is part of the QtCore module of the Katie Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-**
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "qsystemerror_p.h"
-
-QT_BEGIN_NAMESPACE
-
-QString QSystemError::toString()
-{
- if (Q_LIKELY(errorScope == QSystemError::StandardLibraryError)) {
- return qt_error_string(errorCode);
- }
-
- qWarning("invalid error scope");
- return QLatin1String("No error");
-}
-
-QT_END_NAMESPACE
-
+++ /dev/null
-/****************************************************************************
-**
-** Copyright (C) 2015 The Qt Company Ltd.
-** Copyright (C) 2016-2020 Ivailo Monev
-**
-** This file is part of the QtCore module of the Katie Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-**
-** GNU Lesser General Public License Usage
-** This file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** As a special exception, The Qt Company gives you certain additional
-** rights. These rights are described in The Qt Company LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3.0 as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 3.0 requirements will be
-** met: http://www.gnu.org/copyleft/gpl.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QSYSTEMERROR_P_H
-#define QSYSTEMERROR_P_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Katie API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qstring.h"
-
-QT_BEGIN_NAMESPACE
-
-class Q_CORE_EXPORT QSystemError
-{
-public:
- enum ErrorScope {
- NoError,
- StandardLibraryError
- };
-
- inline QSystemError(int error, ErrorScope scope);
- inline QSystemError();
-
- QString toString();
- inline ErrorScope scope() { return errorScope; }
- inline int error() { return errorCode; }
-
-private:
- //data members
- int errorCode;
- ErrorScope errorScope;
-};
-
-QSystemError::QSystemError(int error, QSystemError::ErrorScope scope)
- : errorCode(error), errorScope(scope)
-{
-
-}
-
-QSystemError::QSystemError()
- : errorCode(0), errorScope(NoError)
-{
-
-}
-
-
-QT_END_NAMESPACE
-
-#endif // QSYSTEMERROR_P_H
${CMAKE_SOURCE_DIR}/src/core/io/qfilesystemiterator_unix.cpp
${CMAKE_SOURCE_DIR}/src/core/io/qfsfileengine_unix.cpp
${CMAKE_SOURCE_DIR}/src/core/kernel/qmetatype.cpp
- ${CMAKE_SOURCE_DIR}/src/core/kernel/qsystemerror.cpp
${CMAKE_SOURCE_DIR}/src/core/tools/qbytearray.cpp
${CMAKE_SOURCE_DIR}/src/core/tools/qbytearraymatcher.cpp
${CMAKE_SOURCE_DIR}/src/core/tools/qchar.cpp