qt 6.5.1 original

This commit is contained in:
kleuter
2023-10-29 23:33:08 +01:00
parent 71d22ab6b0
commit 85d238dfda
21202 changed files with 5499099 additions and 0 deletions

View File

@ -0,0 +1,13 @@
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: BSD-3-Clause
#####################################################################
## qlockfile_test_helper Binary:
#####################################################################
qt_internal_add_test_helper(qlockfile_test_helper
OVERRIDE_OUTPUT_DIRECTORY
OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/"
SOURCES
qlockfile_test_helper.cpp
)

View File

@ -0,0 +1,46 @@
// Copyright (C) 2013 David Faure <faure+bluesystems@kde.org>
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
#include <QDebug>
#include <QCoreApplication>
#include <QLockFile>
#include <QThread>
#ifdef Q_OS_UNIX
# include <unistd.h>
#else
# include <stdlib.h>
#endif
int main(int argc, char *argv[])
{
QCoreApplication app(argc, argv);
if (argc <= 1)
return -1;
const QString lockName = QString::fromLocal8Bit(argv[1]);
QString option;
if (argc > 2)
option = QString::fromLocal8Bit(argv[2]);
if (option == "-uncleanexit") {
QLockFile lockFile(lockName);
lockFile.lock();
// exit on purpose, so that the lock remains!
_exit(0);
} else if (option == "-busy") {
QLockFile lockFile(lockName);
lockFile.lock();
QThread::msleep(500);
return 0;
} else {
QLockFile lockFile(lockName);
if (lockFile.isLocked()) // cannot happen, before calling lock or tryLock
return QLockFile::UnknownError;
lockFile.tryLock();
return lockFile.error();
}
}