chore: remove unused base/Path class

This commit is contained in:
sithlord48 2025-12-01 21:44:19 -05:00 committed by Chris Rizzitello
parent ea0222b1e6
commit 9b40bf2f9b
6 changed files with 0 additions and 109 deletions

View file

@ -27,8 +27,6 @@ add_library(base STATIC
Log.h
LogLevel.h
NetworkProtocol.h
Path.cpp
Path.h
PriorityQueue.h
SimpleEventQueueBuffer.cpp
SimpleEventQueueBuffer.h

View file

@ -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 <QString>
#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

View file

@ -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 <string>
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

View file

@ -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

View file

@ -1,35 +0,0 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
* 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 <fstream>
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)

View file

@ -1,15 +0,0 @@
/*
* Deskflow -- mouse and keyboard sharing utility
* SPDX-FileCopyrightText: (C) 2025 Chris Rizzitello <sithlord48@gmail.com>
* SPDX-License-Identifier: GPL-2.0-only WITH LicenseRef-OpenSSL-Exception
*/
#include <QTest>
class PathTests : public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase();
void testOpen();
};