chore: remove unused base/Path class
This commit is contained in:
parent
ea0222b1e6
commit
9b40bf2f9b
6 changed files with 0 additions and 109 deletions
|
|
@ -27,8 +27,6 @@ add_library(base STATIC
|
||||||
Log.h
|
Log.h
|
||||||
LogLevel.h
|
LogLevel.h
|
||||||
NetworkProtocol.h
|
NetworkProtocol.h
|
||||||
Path.cpp
|
|
||||||
Path.h
|
|
||||||
PriorityQueue.h
|
PriorityQueue.h
|
||||||
SimpleEventQueueBuffer.cpp
|
SimpleEventQueueBuffer.cpp
|
||||||
SimpleEventQueueBuffer.h
|
SimpleEventQueueBuffer.h
|
||||||
|
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -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
|
|
||||||
|
|
@ -5,14 +5,6 @@ if(WIN32)
|
||||||
set(extra_libs version)
|
set(extra_libs version)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
create_test(
|
|
||||||
NAME PathTests
|
|
||||||
DEPENDS base
|
|
||||||
LIBS arch
|
|
||||||
SOURCE PathTests.cpp
|
|
||||||
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/src/lib/base"
|
|
||||||
)
|
|
||||||
|
|
||||||
create_test(
|
create_test(
|
||||||
NAME StringTests
|
NAME StringTests
|
||||||
DEPENDS base
|
DEPENDS base
|
||||||
|
|
|
||||||
|
|
@ -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)
|
|
||||||
|
|
@ -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();
|
|
||||||
};
|
|
||||||
Loading…
Reference in a new issue