diff --git a/src/lib/base/CMakeLists.txt b/src/lib/base/CMakeLists.txt index 7b1476fce..7efa5bb58 100644 --- a/src/lib/base/CMakeLists.txt +++ b/src/lib/base/CMakeLists.txt @@ -27,8 +27,6 @@ add_library(base STATIC Log.h LogLevel.h NetworkProtocol.h - Path.cpp - Path.h PriorityQueue.h SimpleEventQueueBuffer.cpp SimpleEventQueueBuffer.h diff --git a/src/lib/base/Path.cpp b/src/lib/base/Path.cpp deleted file mode 100644 index 04fd62105..000000000 --- a/src/lib/base/Path.cpp +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2014 - 2021 Symless Ltd. - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#include "Path.h" - -#if SYSAPI_WIN32 -#include -#endif - -namespace deskflow::filesystem { - -#ifdef SYSAPI_WIN32 - -std::wstring path(const std::string &filePath) -{ - const auto qstring = QString::fromStdString(filePath); - return qstring.toStdWString(); -} - -#else -std::string path(const std::string &filePath) -{ - return filePath; -} -#endif - -} // namespace deskflow::filesystem diff --git a/src/lib/base/Path.h b/src/lib/base/Path.h deleted file mode 100644 index f407cbb4b..000000000 --- a/src/lib/base/Path.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2014 - 2021 Symless Ltd. - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#pragma once - -#include - -namespace deskflow::filesystem { - -#ifdef SYSAPI_WIN32 -std::wstring path(const std::string &filePath); -#else -std::string path(const std::string &filePath); -#endif - -} // namespace deskflow::filesystem diff --git a/src/unittests/base/CMakeLists.txt b/src/unittests/base/CMakeLists.txt index 3a6fbf5d9..8f07edcae 100644 --- a/src/unittests/base/CMakeLists.txt +++ b/src/unittests/base/CMakeLists.txt @@ -5,14 +5,6 @@ if(WIN32) set(extra_libs version) endif() -create_test( - NAME PathTests - DEPENDS base - LIBS arch - SOURCE PathTests.cpp - WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src/lib/base" -) - create_test( NAME StringTests DEPENDS base diff --git a/src/unittests/base/PathTests.cpp b/src/unittests/base/PathTests.cpp deleted file mode 100644 index 2049316ea..000000000 --- a/src/unittests/base/PathTests.cpp +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello - * SPDX-FileCopyrightText: (C) 2014 - 2021 Symless Ltd. - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#include "PathTests.h" - -#include "base/Path.h" - -#include - -void PathTests::initTestCase() -{ - QDir dir; - QVERIFY(dir.mkpath("tmp/test")); -} - -void PathTests::testOpen() -{ - const QString filePath = QStringLiteral("tmp/test/тіás.txt"); - QFile file(filePath); - - QVERIFY(file.open(QIODevice::WriteOnly)); - QVERIFY(file.write("test", 4)); - - file.close(); - QVERIFY(!file.isOpen()); - - std::ifstream inFile(deskflow::filesystem::path(filePath.toStdString())); - QVERIFY(inFile.is_open()); -} - -QTEST_MAIN(PathTests) diff --git a/src/unittests/base/PathTests.h b/src/unittests/base/PathTests.h deleted file mode 100644 index c10609817..000000000 --- a/src/unittests/base/PathTests.h +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Deskflow -- mouse and keyboard sharing utility - * SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello - * SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception - */ - -#include - -class PathTests : public QObject -{ - Q_OBJECT -private Q_SLOTS: - void initTestCase(); - void testOpen(); -};