Skip to content

Commit

Permalink
🦄 refactor(common): use self db
Browse files Browse the repository at this point in the history
  • Loading branch information
xqyjlj committed Dec 17, 2023
1 parent 7c52af1 commit b8aec43
Show file tree
Hide file tree
Showing 15 changed files with 74 additions and 1,988 deletions.
4 changes: 2 additions & 2 deletions common/core/inc/os.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ class os final

/**
* @brief traverse to get all the files in the specified directory
* @param p: directory path
* @param path: directory path
* @param filters: file filter
* @return file list
*/
static QStringList files(const QString &p, const QStringList &filters);
static QStringList files(const QString &path, const QStringList &filters);

/**
* @brief traverse to get all the files in the specified directory
Expand Down
2 changes: 1 addition & 1 deletion common/core/src/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ static constexpr const char *csp_config_file_path = "config.ini";
static constexpr const char *csp_config_default_value = "null";

static constexpr const char *csp_config_key_repo_dir = "core/repodir";
static constexpr const char *csp_config_value_default_repo_dir = "csp_repo";
static constexpr const char *csp_config_value_default_repo_dir = "repo";

static constexpr const char *csp_config_key_language = "core/language";
static constexpr const char *csp_config_value_default_language = "zh_CN";
Expand Down
6 changes: 3 additions & 3 deletions common/core/src/os.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -141,12 +141,12 @@ QString os::getsavefile(const QString &title, const QString &default_file, const
return QFileDialog::getSaveFileName(nullptr, title, default_file, filter);
}

QStringList os::files(const QString &p, const QStringList &filters)
QStringList os::files(const QString &path, const QStringList &filters)
{
if (!isdir(p))
if (!isdir(path))
return {};

const QDir dir(p);
const QDir dir(path);
auto files = dir.entryInfoList(filters, QDir::Files | QDir::Hidden | QDir::NoSymLinks);
QStringList paths;
for (const QFileInfo &file : files)
Expand Down
3 changes: 2 additions & 1 deletion common/repo/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,12 @@ target_include_directories(repo PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/inc)
##########################################################################

file(GLOB_RECURSE TESTCASES
test/db/*.cpp)
test/*.cpp)

foreach (TESTCASE ${TESTCASES})
get_filename_component(TARGET_NAME ${TESTCASE} NAME_WE)
add_executable(${TARGET_NAME} ${TESTCASE} test/res/res.qrc)
target_compile_definitions(${TARGET_NAME} PRIVATE -DCSP_EXE_DIR=\"${CSP_EXE_DIR}\")
target_link_libraries(${TARGET_NAME} PRIVATE Qt5::Test repo)
add_test(NAME ${TARGET_NAME} COMMAND ${TARGET_NAME})
endforeach ()
216 changes: 0 additions & 216 deletions common/repo/test/res/geehy/apm32f103zet6.yml

This file was deleted.

65 changes: 0 additions & 65 deletions common/repo/test/res/ip.yml

This file was deleted.

Loading

0 comments on commit b8aec43

Please sign in to comment.