From 25b556ae14571f1007469ad954053b2659c4ea26 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Wed, 24 Apr 2024 22:39:13 +0800 Subject: [PATCH] migrate to cmake --- .gitignore | 2 + CMakeLists.txt | 13 + libs/CMakeLists.txt | 2 + libs/QHotkey | 2 +- libs/libs.pro | 5 - libs/vtextedit | 2 +- src/CMakeLists.txt | 88 ++++++ src/core/CMakeLists.txt | 87 ++++++ src/core/buffer/buffer.pri | 31 -- src/core/core.pri | 76 ----- src/core/notebook/notebook.pri | 30 -- src/core/notebookbackend/notebookbackend.pri | 10 - .../notebookconfigmgr/notebookconfigmgr.pri | 16 - .../versioncontroller/versioncontroller.pri | 11 - src/data/core/icons/vnote.rc | 1 + src/export/CMakeLists.txt | 5 + src/export/export.pri | 11 - src/imagehost/CMakeLists.txt | 8 + src/imagehost/imagehost.pri | 18 -- src/search/CMakeLists.txt | 10 + src/search/search.pri | 20 -- src/snippet/CMakeLists.txt | 5 + src/snippet/snippet.pri | 12 - src/src.pro | 171 ----------- src/task/CMakeLists.txt | 6 + src/task/task.pri | 13 - src/unitedentry/CMakeLists.txt | 11 + src/unitedentry/unitedentry.pri | 24 -- src/utils/CMakeLists.txt | 18 ++ src/utils/utils.pri | 41 --- src/widgets/CMakeLists.txt | 143 +++++++++ src/widgets/widgets.pri | 281 ------------------ tests/CMakeLists.txt | 3 + tests/common.pri | 10 - tests/commonfull.pri | 33 -- tests/test_core/CMakeLists.txt | 2 + tests/test_core/test_core.pro | 5 - tests/test_core/test_notebook/CMakeLists.txt | 0 .../test_core/test_notebook/test_notebook.pro | 16 - tests/test_core/test_theme/test_theme.pro | 28 -- tests/test_task/test_task.pro | 10 - tests/test_utils/test_utils.pro | 21 -- tests/tests.pro | 6 - vnote.pro | 11 - 44 files changed, 406 insertions(+), 912 deletions(-) create mode 100644 CMakeLists.txt create mode 100644 libs/CMakeLists.txt delete mode 100644 libs/libs.pro create mode 100644 src/CMakeLists.txt create mode 100644 src/core/CMakeLists.txt delete mode 100644 src/core/buffer/buffer.pri delete mode 100644 src/core/core.pri delete mode 100644 src/core/notebook/notebook.pri delete mode 100644 src/core/notebookbackend/notebookbackend.pri delete mode 100644 src/core/notebookconfigmgr/notebookconfigmgr.pri delete mode 100644 src/core/versioncontroller/versioncontroller.pri create mode 100644 src/data/core/icons/vnote.rc create mode 100644 src/export/CMakeLists.txt delete mode 100644 src/export/export.pri create mode 100644 src/imagehost/CMakeLists.txt delete mode 100644 src/imagehost/imagehost.pri create mode 100644 src/search/CMakeLists.txt delete mode 100644 src/search/search.pri create mode 100644 src/snippet/CMakeLists.txt delete mode 100644 src/snippet/snippet.pri delete mode 100644 src/src.pro create mode 100644 src/task/CMakeLists.txt delete mode 100644 src/task/task.pri create mode 100644 src/unitedentry/CMakeLists.txt delete mode 100644 src/unitedentry/unitedentry.pri create mode 100644 src/utils/CMakeLists.txt delete mode 100644 src/utils/utils.pri create mode 100644 src/widgets/CMakeLists.txt delete mode 100644 src/widgets/widgets.pri create mode 100644 tests/CMakeLists.txt delete mode 100644 tests/common.pri delete mode 100644 tests/commonfull.pri create mode 100644 tests/test_core/CMakeLists.txt delete mode 100644 tests/test_core/test_core.pro create mode 100644 tests/test_core/test_notebook/CMakeLists.txt delete mode 100644 tests/test_core/test_notebook/test_notebook.pro delete mode 100644 tests/test_core/test_theme/test_theme.pro delete mode 100644 tests/test_task/test_task.pro delete mode 100644 tests/test_utils/test_utils.pro delete mode 100644 tests/tests.pro delete mode 100644 vnote.pro diff --git a/.gitignore b/.gitignore index 5b58e761a0..2a5e9bc31d 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,5 @@ GRTAGS GTAGS aqtinstall.log tags +CMakeLists.txt.user +build diff --git a/CMakeLists.txt b/CMakeLists.txt new file mode 100644 index 0000000000..3d6757b3e0 --- /dev/null +++ b/CMakeLists.txt @@ -0,0 +1,13 @@ +cmake_minimum_required (VERSION 3.12) +project(VNote VERSION 3.17.0 LANGUAGES C CXX) +set(CMAKE_CXX_STANDARD 14) +set(CMAKE_CXX_STANDARD_REQUIRED ON) + +set(CMAKE_AUTOMOC ON) +set(CMAKE_AUTOUIC ON) +set(CMAKE_AUTORCC ON) + +add_subdirectory(libs) +add_subdirectory(src) +# TODO: find a better way to organize tests +# add_subdirectory(tests) diff --git a/libs/CMakeLists.txt b/libs/CMakeLists.txt new file mode 100644 index 0000000000..390fc4ffbe --- /dev/null +++ b/libs/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(QHotKey) +add_subdirectory(vtextedit) diff --git a/libs/QHotkey b/libs/QHotkey index 18ac011008..9bf5b15a52 160000 --- a/libs/QHotkey +++ b/libs/QHotkey @@ -1 +1 @@ -Subproject commit 18ac011008d3ae55abc19233ba94fad1ea9801d8 +Subproject commit 9bf5b15a521ca94070adfef91bde54a975a5298c diff --git a/libs/libs.pro b/libs/libs.pro deleted file mode 100644 index 4d0f4ef4b2..0000000000 --- a/libs/libs.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS += \ - vtextedit \ - QHotkey diff --git a/libs/vtextedit b/libs/vtextedit index b512b5126f..70b856b124 160000 --- a/libs/vtextedit +++ b/libs/vtextedit @@ -1 +1 @@ -Subproject commit b512b5126fe0898a29280204f2959e2dbeb67660 +Subproject commit 70b856b124aedf6b683926d9170b65eda45578cf diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt new file mode 100644 index 0000000000..a5f87e45b9 --- /dev/null +++ b/src/CMakeLists.txt @@ -0,0 +1,88 @@ +cmake_minimum_required(VERSION 3.16) + +set(CMAKE_INCLUDE_CURRENT_DIR ON) + +set(QT_DEFAULT_MAJOR_VERSION 6 CACHE STRING "Qt version to use (5 or 6), defaults to 6") +find_package(Qt${QT_DEFAULT_MAJOR_VERSION} REQUIRED COMPONENTS Core Gui Network PrintSupport Sql Svg Widgets WebChannel WebEngineWidgets LinguistTools) +find_package(Qt${QT_DEFAULT_MAJOR_VERSION} OPTIONAL_COMPONENTS Core5Compat) + +if ((QT_DEFAULT_MAJOR_VERSION GREATER 5)) + qt_standard_project_setup() +else() + set(CMAKE_AUTOMOC ON) + set(CMAKE_AUTORCC ON) + set(CMAKE_AUTOUIC ON) +endif() + +# Application icon on Windows +set(VX_APP_ICON_RC_WIN data/core/icons/vnote.rc) + +# Application icon on macOS +set(MACOSX_BUNDLE_ICON_FILE vnote.icns) +set(VX_APP_ICON_MACOS data/core/icons/vnote.icns) +set_source_files_properties(${VX_APP_ICON_MACOS} PROPERTIES + MACOSX_PACKAGE_LOCATION "Resources") + +# Translations +set(VX_TS_FILES data/core/translations/vnote_zh_CN.ts + data/core/translations/vnote_ja.ts) +set_source_files_properties(${VX_TS_FILES} PROPERTIES OUTPUT_LOCATION "data/core/translations") +qt_add_translation(VX_QM_FILES ${VX_TS_FILES}) + +# Resources +set(VX_RESOURCE_FILES data/core/core.qrc) +qt_add_binary_resources(VX_EXTRA_RESOURCE data/extra/extra.qrc DESTINATION vnote_extra.rcc) + +add_executable(vnote WIN32 MACOSX_BUNDLE + application.cpp application.h + commandlineoptions.cpp commandlineoptions.h + fakeaccessible.cpp fakeaccessible.h + main.cpp + ${VX_APP_ICON_RC_WIN} ${VX_APP_ICON_MACOS} ${VX_RESOURCE_FILES} +) + +add_dependencies(vnote VX_EXTRA_RESOURCE) + +set(VX_LIBS_FOLDER ../libs) +target_include_directories(vnote PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) + +find_program(GOLD_LINKER "ld.gold") +if (NOT ${GOLD_LINKER} STREQUAL GOLD_LINKER-NOTFOUND) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -fuse-ld=gold") +endif() + +target_compile_definitions(vnote PRIVATE + QT_MESSAGELOGCONTEXT +) + +add_subdirectory(core) +add_subdirectory(export) +add_subdirectory(imagehost) +add_subdirectory(search) +add_subdirectory(snippet) +add_subdirectory(task) +add_subdirectory(unitedentry) +add_subdirectory(utils) +add_subdirectory(widgets) + +target_link_libraries(vnote PRIVATE + Qt::Core + Qt::Gui + Qt::Network + Qt::PrintSupport + Qt::Sql + Qt::Svg + Qt::WebChannel + Qt::WebEngineWidgets + Qt::Widgets + VTextEdit + qhotkey +) + +if((QT_DEFAULT_MAJOR_VERSION GREATER 5)) + target_link_libraries(vnote PRIVATE + Qt::Core5Compat + ) +endif() diff --git a/src/core/CMakeLists.txt b/src/core/CMakeLists.txt new file mode 100644 index 0000000000..a654be4716 --- /dev/null +++ b/src/core/CMakeLists.txt @@ -0,0 +1,87 @@ +target_sources(vnote PRIVATE + buffer/buffer.cpp buffer/buffer.h + buffer/bufferprovider.cpp buffer/bufferprovider.h + buffer/filebufferprovider.cpp buffer/filebufferprovider.h + buffer/filetypehelper.cpp buffer/filetypehelper.h + buffer/ibufferfactory.h + buffer/markdownbuffer.cpp buffer/markdownbuffer.h + buffer/markdownbufferfactory.cpp buffer/markdownbufferfactory.h + buffer/mindmapbuffer.cpp buffer/mindmapbuffer.h + buffer/mindmapbufferfactory.cpp buffer/mindmapbufferfactory.h + buffer/nodebufferprovider.cpp buffer/nodebufferprovider.h + buffer/pdfbuffer.cpp buffer/pdfbuffer.h + buffer/pdfbufferfactory.cpp buffer/pdfbufferfactory.h + buffer/textbuffer.cpp buffer/textbuffer.h + buffer/textbufferfactory.cpp buffer/textbufferfactory.h + buffer/urlbasedbufferprovider.h + buffermgr.cpp buffermgr.h + clipboarddata.cpp clipboarddata.h + configmgr.cpp configmgr.h + coreconfig.cpp coreconfig.h + editorconfig.cpp editorconfig.h + events.h + exception.h + externalfile.cpp externalfile.h + file.cpp file.h + filelocator.h + fileopenparameters.h + global.cpp global.h + historyitem.cpp historyitem.h + historymgr.cpp historymgr.h + htmltemplatehelper.cpp htmltemplatehelper.h + iconfig.h + location.h + logger.cpp logger.h + mainconfig.cpp mainconfig.h + markdowneditorconfig.cpp markdowneditorconfig.h + mindmapeditorconfig.cpp mindmapeditorconfig.h + namebasedserver.h + noncopyable.h + notebook/bundlenotebook.cpp notebook/bundlenotebook.h + notebook/bundlenotebookfactory.cpp notebook/bundlenotebookfactory.h + notebook/externalnode.cpp notebook/externalnode.h + notebook/historyi.h + notebook/inotebookfactory.h + notebook/node.cpp notebook/node.h + notebook/nodeparameters.cpp notebook/nodeparameters.h + notebook/notebook.cpp notebook/notebook.h + notebook/notebookdatabaseaccess.cpp notebook/notebookdatabaseaccess.h + notebook/notebookparameters.cpp notebook/notebookparameters.h + notebook/notebooktagmgr.cpp notebook/notebooktagmgr.h + notebook/tag.cpp notebook/tag.h + notebook/tagi.h + notebook/vxnode.cpp notebook/vxnode.h + notebook/vxnodefile.cpp notebook/vxnodefile.h + notebookbackend/inotebookbackend.cpp notebookbackend/inotebookbackend.h + notebookbackend/inotebookbackendfactory.h + notebookbackend/localnotebookbackend.cpp notebookbackend/localnotebookbackend.h + notebookbackend/localnotebookbackendfactory.cpp notebookbackend/localnotebookbackendfactory.h + notebookconfigmgr/bundlenotebookconfigmgr.cpp notebookconfigmgr/bundlenotebookconfigmgr.h + notebookconfigmgr/inotebookconfigmgr.cpp notebookconfigmgr/inotebookconfigmgr.h + notebookconfigmgr/inotebookconfigmgrfactory.h + notebookconfigmgr/notebookconfig.cpp notebookconfigmgr/notebookconfig.h + notebookconfigmgr/vxnodeconfig.cpp notebookconfigmgr/vxnodeconfig.h + notebookconfigmgr/vxnotebookconfigmgr.cpp notebookconfigmgr/vxnotebookconfigmgr.h + notebookconfigmgr/vxnotebookconfigmgrfactory.cpp notebookconfigmgr/vxnotebookconfigmgrfactory.h + notebookmgr.cpp notebookmgr.h + pdfviewerconfig.cpp pdfviewerconfig.h + quickaccesshelper.cpp quickaccesshelper.h + sessionconfig.cpp sessionconfig.h + singleinstanceguard.cpp singleinstanceguard.h + templatemgr.cpp templatemgr.h + texteditorconfig.cpp texteditorconfig.h + theme.cpp theme.h + thememgr.cpp thememgr.h + versioncontroller/dummyversioncontroller.cpp versioncontroller/dummyversioncontroller.h + versioncontroller/dummyversioncontrollerfactory.cpp versioncontroller/dummyversioncontrollerfactory.h + versioncontroller/iversioncontroller.h + versioncontroller/iversioncontrollerfactory.h + versioncontroller/versioncontrollerserver.cpp versioncontroller/versioncontrollerserver.h + vnotex.cpp vnotex.h + webresource.h + widgetconfig.cpp widgetconfig.h +) + +target_include_directories(vnote PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR} +) diff --git a/src/core/buffer/buffer.pri b/src/core/buffer/buffer.pri deleted file mode 100644 index a1d16fd783..0000000000 --- a/src/core/buffer/buffer.pri +++ /dev/null @@ -1,31 +0,0 @@ -SOURCES += \ - $$PWD/buffer.cpp \ - $$PWD/bufferprovider.cpp \ - $$PWD/filebufferprovider.cpp \ - $$PWD/markdownbuffer.cpp \ - $$PWD/markdownbufferfactory.cpp \ - $$PWD/filetypehelper.cpp \ - $$PWD/mindmapbuffer.cpp \ - $$PWD/mindmapbufferfactory.cpp \ - $$PWD/nodebufferprovider.cpp \ - $$PWD/pdfbuffer.cpp \ - $$PWD/pdfbufferfactory.cpp \ - $$PWD/textbuffer.cpp \ - $$PWD/textbufferfactory.cpp - -HEADERS += \ - $$PWD/bufferprovider.h \ - $$PWD/buffer.h \ - $$PWD/filebufferprovider.h \ - $$PWD/ibufferfactory.h \ - $$PWD/markdownbuffer.h \ - $$PWD/markdownbufferfactory.h \ - $$PWD/filetypehelper.h \ - $$PWD/mindmapbuffer.h \ - $$PWD/mindmapbufferfactory.h \ - $$PWD/nodebufferprovider.h \ - $$PWD/pdfbuffer.h \ - $$PWD/pdfbufferfactory.h \ - $$PWD/textbuffer.h \ - $$PWD/textbufferfactory.h \ - $$PWD/urlbasedbufferprovider.h diff --git a/src/core/core.pri b/src/core/core.pri deleted file mode 100644 index fc649821b7..0000000000 --- a/src/core/core.pri +++ /dev/null @@ -1,76 +0,0 @@ -INCLUDEPATH *= $$PWD - -include($$PWD/notebookbackend/notebookbackend.pri) - -include($$PWD/versioncontroller/versioncontroller.pri) - -include($$PWD/notebookconfigmgr/notebookconfigmgr.pri) - -include($$PWD/notebook/notebook.pri) - -include($$PWD/buffer/buffer.pri) - -SOURCES += \ - $$PWD/buffermgr.cpp \ - $$PWD/configmgr.cpp \ - $$PWD/coreconfig.cpp \ - $$PWD/editorconfig.cpp \ - $$PWD/externalfile.cpp \ - $$PWD/file.cpp \ - $$PWD/global.cpp \ - $$PWD/historyitem.cpp \ - $$PWD/historymgr.cpp \ - $$PWD/htmltemplatehelper.cpp \ - $$PWD/logger.cpp \ - $$PWD/mainconfig.cpp \ - $$PWD/markdowneditorconfig.cpp \ - $$PWD/mindmapeditorconfig.cpp \ - $$PWD/pdfviewerconfig.cpp \ - $$PWD/quickaccesshelper.cpp \ - $$PWD/singleinstanceguard.cpp \ - $$PWD/templatemgr.cpp \ - $$PWD/texteditorconfig.cpp \ - $$PWD/vnotex.cpp \ - $$PWD/thememgr.cpp \ - $$PWD/notebookmgr.cpp \ - $$PWD/theme.cpp \ - $$PWD/sessionconfig.cpp \ - $$PWD/clipboarddata.cpp \ - $$PWD/widgetconfig.cpp - -HEADERS += \ - $$PWD/buffermgr.h \ - $$PWD/configmgr.h \ - $$PWD/coreconfig.h \ - $$PWD/editorconfig.h \ - $$PWD/events.h \ - $$PWD/externalfile.h \ - $$PWD/file.h \ - $$PWD/filelocator.h \ - $$PWD/fileopenparameters.h \ - $$PWD/historyitem.h \ - $$PWD/historymgr.h \ - $$PWD/htmltemplatehelper.h \ - $$PWD/location.h \ - $$PWD/logger.h \ - $$PWD/mainconfig.h \ - $$PWD/markdowneditorconfig.h \ - $$PWD/mindmapeditorconfig.h \ - $$PWD/noncopyable.h \ - $$PWD/pdfviewerconfig.h \ - $$PWD/quickaccesshelper.h \ - $$PWD/singleinstanceguard.h \ - $$PWD/iconfig.h \ - $$PWD/templatemgr.h \ - $$PWD/texteditorconfig.h \ - $$PWD/vnotex.h \ - $$PWD/thememgr.h \ - $$PWD/global.h \ - $$PWD/namebasedserver.h \ - $$PWD/exception.h \ - $$PWD/notebookmgr.h \ - $$PWD/theme.h \ - $$PWD/sessionconfig.h \ - $$PWD/clipboarddata.h \ - $$PWD/webresource.h \ - $$PWD/widgetconfig.h diff --git a/src/core/notebook/notebook.pri b/src/core/notebook/notebook.pri deleted file mode 100644 index f7a3dac324..0000000000 --- a/src/core/notebook/notebook.pri +++ /dev/null @@ -1,30 +0,0 @@ -SOURCES += \ - $$PWD/externalnode.cpp \ - $$PWD/nodeparameters.cpp \ - $$PWD/notebook.cpp \ - $$PWD/bundlenotebookfactory.cpp \ - $$PWD/notebookdatabaseaccess.cpp \ - $$PWD/notebookparameters.cpp \ - $$PWD/bundlenotebook.cpp \ - $$PWD/node.cpp \ - $$PWD/notebooktagmgr.cpp \ - $$PWD/tag.cpp \ - $$PWD/vxnode.cpp \ - $$PWD/vxnodefile.cpp - -HEADERS += \ - $$PWD/externalnode.h \ - $$PWD/historyi.h \ - $$PWD/nodeparameters.h \ - $$PWD/notebook.h \ - $$PWD/inotebookfactory.h \ - $$PWD/bundlenotebookfactory.h \ - $$PWD/notebookdatabaseaccess.h \ - $$PWD/notebookparameters.h \ - $$PWD/bundlenotebook.h \ - $$PWD/node.h \ - $$PWD/notebooktagmgr.h \ - $$PWD/tag.h \ - $$PWD/tagi.h \ - $$PWD/vxnode.h \ - $$PWD/vxnodefile.h diff --git a/src/core/notebookbackend/notebookbackend.pri b/src/core/notebookbackend/notebookbackend.pri deleted file mode 100644 index 2b74073776..0000000000 --- a/src/core/notebookbackend/notebookbackend.pri +++ /dev/null @@ -1,10 +0,0 @@ -SOURCES += \ - $$PWD/localnotebookbackend.cpp \ - $$PWD/localnotebookbackendfactory.cpp \ - $$PWD/inotebookbackend.cpp - -HEADERS += \ - $$PWD/inotebookbackend.h \ - $$PWD/localnotebookbackend.h \ - $$PWD/inotebookbackendfactory.h \ - $$PWD/localnotebookbackendfactory.h diff --git a/src/core/notebookconfigmgr/notebookconfigmgr.pri b/src/core/notebookconfigmgr/notebookconfigmgr.pri deleted file mode 100644 index de570d370b..0000000000 --- a/src/core/notebookconfigmgr/notebookconfigmgr.pri +++ /dev/null @@ -1,16 +0,0 @@ -SOURCES += \ - $$PWD/vxnodeconfig.cpp \ - $$PWD/vxnotebookconfigmgr.cpp \ - $$PWD/vxnotebookconfigmgrfactory.cpp \ - $$PWD/inotebookconfigmgr.cpp \ - $$PWD/notebookconfig.cpp \ - $$PWD/bundlenotebookconfigmgr.cpp - -HEADERS += \ - $$PWD/inotebookconfigmgr.h \ - $$PWD/vxnodeconfig.h \ - $$PWD/vxnotebookconfigmgr.h \ - $$PWD/inotebookconfigmgrfactory.h \ - $$PWD/vxnotebookconfigmgrfactory.h \ - $$PWD/notebookconfig.h \ - $$PWD/bundlenotebookconfigmgr.h diff --git a/src/core/versioncontroller/versioncontroller.pri b/src/core/versioncontroller/versioncontroller.pri deleted file mode 100644 index 7456ee526c..0000000000 --- a/src/core/versioncontroller/versioncontroller.pri +++ /dev/null @@ -1,11 +0,0 @@ -SOURCES += \ - $$PWD/dummyversioncontroller.cpp \ - $$PWD/versioncontrollerserver.cpp \ - $$PWD/dummyversioncontrollerfactory.cpp - -HEADERS += \ - $$PWD/iversioncontroller.h \ - $$PWD/dummyversioncontroller.h \ - $$PWD/versioncontrollerserver.h \ - $$PWD/iversioncontrollerfactory.h \ - $$PWD/dummyversioncontrollerfactory.h diff --git a/src/data/core/icons/vnote.rc b/src/data/core/icons/vnote.rc new file mode 100644 index 0000000000..da52d77771 --- /dev/null +++ b/src/data/core/icons/vnote.rc @@ -0,0 +1 @@ +IDI_ICON1 ICON DISCARDABLE "vnote.ico" diff --git a/src/export/CMakeLists.txt b/src/export/CMakeLists.txt new file mode 100644 index 0000000000..d648d52a2e --- /dev/null +++ b/src/export/CMakeLists.txt @@ -0,0 +1,5 @@ +target_sources(vnote PRIVATE + exportdata.cpp exportdata.h + exporter.cpp exporter.h + webviewexporter.cpp webviewexporter.h +) diff --git a/src/export/export.pri b/src/export/export.pri deleted file mode 100644 index f66abc10ba..0000000000 --- a/src/export/export.pri +++ /dev/null @@ -1,11 +0,0 @@ -QT += widgets - -SOURCES += \ - $$PWD/exportdata.cpp \ - $$PWD/exporter.cpp \ - $$PWD/webviewexporter.cpp - -HEADERS += \ - $$PWD/exportdata.h \ - $$PWD/exporter.h \ - $$PWD/webviewexporter.h diff --git a/src/imagehost/CMakeLists.txt b/src/imagehost/CMakeLists.txt new file mode 100644 index 0000000000..c72570ceb6 --- /dev/null +++ b/src/imagehost/CMakeLists.txt @@ -0,0 +1,8 @@ +target_sources(vnote PRIVATE + giteeimagehost.cpp giteeimagehost.h + githubimagehost.cpp githubimagehost.h + imagehost.cpp imagehost.h + imagehostmgr.cpp imagehostmgr.h + imagehostutils.cpp imagehostutils.h + repoimagehost.cpp repoimagehost.h +) diff --git a/src/imagehost/imagehost.pri b/src/imagehost/imagehost.pri deleted file mode 100644 index c6e8d80ab5..0000000000 --- a/src/imagehost/imagehost.pri +++ /dev/null @@ -1,18 +0,0 @@ -QT += widgets - -HEADERS += \ - $$PWD/giteeimagehost.h \ - $$PWD/githubimagehost.h \ - $$PWD/imagehost.h \ - $$PWD/imagehostmgr.h \ - $$PWD/imagehostutils.h \ - $$PWD/repoimagehost.h - -SOURCES += \ - $$PWD/giteeimagehost.cpp \ - $$PWD/githubimagehost.cpp \ - $$PWD/imagehost.cpp \ - $$PWD/imagehostmgr.cpp \ - $$PWD/imagehostutils.cpp \ - $$PWD/repoimagehost.cpp - diff --git a/src/search/CMakeLists.txt b/src/search/CMakeLists.txt new file mode 100644 index 0000000000..3a53112bb3 --- /dev/null +++ b/src/search/CMakeLists.txt @@ -0,0 +1,10 @@ +target_sources(vnote PRIVATE + filesearchengine.cpp filesearchengine.h + isearchengine.h + isearchinfoprovider.h + searchdata.cpp searchdata.h + searcher.cpp searcher.h + searchhelper.cpp searchhelper.h + searchresultitem.cpp searchresultitem.h + searchtoken.cpp searchtoken.h +) diff --git a/src/search/search.pri b/src/search/search.pri deleted file mode 100644 index bcc61c8921..0000000000 --- a/src/search/search.pri +++ /dev/null @@ -1,20 +0,0 @@ -QT += widgets - -HEADERS += \ - $$PWD/filesearchengine.h \ - $$PWD/isearchengine.h \ - $$PWD/isearchinfoprovider.h \ - $$PWD/searchdata.h \ - $$PWD/searcher.h \ - $$PWD/searchhelper.h \ - $$PWD/searchresultitem.h \ - $$PWD/searchtoken.h - -SOURCES += \ - $$PWD/filesearchengine.cpp \ - $$PWD/searchdata.cpp \ - $$PWD/searcher.cpp \ - $$PWD/searchhelper.cpp \ - $$PWD/searchresultitem.cpp \ - $$PWD/searchtoken.cpp - diff --git a/src/snippet/CMakeLists.txt b/src/snippet/CMakeLists.txt new file mode 100644 index 0000000000..22b567100b --- /dev/null +++ b/src/snippet/CMakeLists.txt @@ -0,0 +1,5 @@ +target_sources(vnote PRIVATE + dynamicsnippet.cpp dynamicsnippet.h + snippet.cpp snippet.h + snippetmgr.cpp snippetmgr.h +) diff --git a/src/snippet/snippet.pri b/src/snippet/snippet.pri deleted file mode 100644 index af4ba2fb0c..0000000000 --- a/src/snippet/snippet.pri +++ /dev/null @@ -1,12 +0,0 @@ -QT += widgets - -HEADERS += \ - $$PWD/dynamicsnippet.h \ - $$PWD/snippet.h \ - $$PWD/snippetmgr.h - -SOURCES += \ - $$PWD/dynamicsnippet.cpp \ - $$PWD/snippet.cpp \ - $$PWD/snippetmgr.cpp - diff --git a/src/src.pro b/src/src.pro deleted file mode 100644 index 313c3d644f..0000000000 --- a/src/src.pro +++ /dev/null @@ -1,171 +0,0 @@ -lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5 and above") - -equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12): error("requires Qt 5.12 and above") - -QT += core gui widgets webenginewidgets webchannel network svg printsupport -QT += sql - -greaterThan(QT_MAJOR_VERSION, 5) { - QT += core5compat -} - -CONFIG -= qtquickcompiler - -unix:!mac:exists(/usr/bin/ld.gold) { - CONFIG += use_gold_linker -} - -# Enable message log in release build -DEFINES += QT_MESSAGELOGCONTEXT - -TARGET = vnote -TEMPLATE = app - -win32:CONFIG(release, debug|release) { - SRC_DESTDIR = $$OUT_PWD/release -} else:win32:CONFIG(debug, debug|release) { - SRC_DESTDIR = $$OUT_PWD/debug -} else { - SRC_DESTDIR = $$OUT_PWD -} - -RC_ICONS = data/core/icons/vnote.ico -ICON = data/core/icons/vnote.icns - -TRANSLATIONS += \ - data/core/translations/vnote_zh_CN.ts \ - data/core/translations/vnote_ja.ts - -SOURCES += \ - application.cpp \ - commandlineoptions.cpp \ - fakeaccessible.cpp \ - main.cpp - -INCLUDEPATH *= $$PWD - -LIBS_FOLDER = $$PWD/../libs - -include($$LIBS_FOLDER/vtextedit/src/editor/editor_export.pri) - -include($$LIBS_FOLDER/vtextedit/src/libs/syntax-highlighting/syntax-highlighting_export.pri) - -include($$LIBS_FOLDER/QHotkey/QHotkey_export.pri) - -include($$PWD/utils/utils.pri) - -include($$PWD/export/export.pri) - -include($$PWD/search/search.pri) - -include($$PWD/snippet/snippet.pri) - -include($$PWD/imagehost/imagehost.pri) - -include($$PWD/task/task.pri) - -include($$PWD/core/core.pri) - -include($$PWD/widgets/widgets.pri) - -include($$PWD/unitedentry/unitedentry.pri) - -RESOURCES += \ - $$PWD/data/core/core.qrc - -RCC_BINARY_SOURCES += $$PWD/data/extra/extra.qrc - -win32 { - rcc_binary.commands = $$shell_path($$[QT_HOST_BINS]/rcc.exe) -name ${QMAKE_FILE_IN_BASE} -binary ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} - rcc_binary.depend_command = $$shell_path($$[QT_HOST_BINS]/rcc.exe) -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} -} else { - greaterThan(QT_MAJOR_VERSION, 5) { - rcc_binary.commands = $$[QT_HOST_LIBEXECS]/rcc -name ${QMAKE_FILE_IN_BASE} -binary ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} - rcc_binary.depend_command = $$[QT_HOST_LIBEXECS]/rcc -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} - } else { - rcc_binary.commands = $$[QT_HOST_BINS]/rcc -name ${QMAKE_FILE_IN_BASE} -binary ${QMAKE_FILE_IN} -o ${QMAKE_FILE_OUT} - rcc_binary.depend_command = $$[QT_HOST_BINS]/rcc -list $$QMAKE_RESOURCE_FLAGS ${QMAKE_FILE_IN} - } -} -rcc_binary.input = RCC_BINARY_SOURCES -rcc_binary.output = $$SRC_DESTDIR/vnote_${QMAKE_FILE_IN_BASE}.rcc -rcc_binary.CONFIG += no_link target_predeps -QMAKE_EXTRA_COMPILERS += rcc_binary - -OTHER_FILES += $$RCC_BINARY_SOURCES - -macx { - QMAKE_INFO_PLIST = data/core/Info.plist - - # Process VTextEdit framework - vte_lib_name = VTextEdit - vte_lib_dir = $${OUT_PWD}/../libs/vtextedit/src/editor - vte_lib_full_name = $${vte_lib_name}.framework/Versions/1/$${vte_lib_name} - app_bundle_dir = $${TARGET}.app/Contents/MacOS - app_target = $${app_bundle_dir}/$${TARGET} - QMAKE_POST_LINK += \ - install_name_tool -add_rpath $${vte_lib_dir} $${app_target} && \ - install_name_tool -change $${vte_lib_full_name} @rpath/$${vte_lib_full_name} $${app_target} && \ - - # Process VSyntaxHighlighting framework - sh_lib_name = VSyntaxHighlighting - sh_lib_dir = $${OUT_PWD}/../libs/vtextedit/src/libs/syntax-highlighting - sh_lib_full_name = $${sh_lib_name}.framework/Versions/1/$${sh_lib_name} - QMAKE_POST_LINK += \ - install_name_tool -add_rpath $${sh_lib_dir} $${app_target} && \ - install_name_tool -change $${sh_lib_full_name} @rpath/$${sh_lib_full_name} $${app_target} - - # Move vnote_extra.rcc to the bundle. - BUNDLE_EXTRA_RCC.files = $${SRC_DESTDIR}/vnote_extra.rcc - BUNDLE_EXTRA_RCC.path = Contents/MacOS - QMAKE_BUNDLE_DATA += BUNDLE_EXTRA_RCC -} - -## INSTALLS -unix:!macx { - isEmpty(PREFIX): PREFIX = /usr - DATADIR = $${PREFIX}/share - BINDIR = $${PREFIX}/bin - LIBDIR = $${PREFIX}/lib - INCLUDEDIR = $${PREFIX}/include - - # install desktop file - desktop.path = $${DATADIR}/applications - desktop.files += data/core/vnote.desktop - - # install icons - icon16.path = $${DATADIR}/icons/hicolor/16x16/apps - icon16.files = data/core/logo/16x16/vnote.png - - icon32.path = $${DATADIR}/icons/hicolor/32x32/apps - icon32.files = data/core/logo/32x32/vnote.png - - icon48.path = $${DATADIR}/icons/hicolor/48x48/apps - icon48.files = data/core/logo/48x48/vnote.png - - icon64.path = $${DATADIR}/icons/hicolor/64x64/apps - icon64.files = data/core/logo/64x64/vnote.png - - icon128.path = $${DATADIR}/icons/hicolor/128x128/apps - icon128.files = data/core/logo/128x128/vnote.png - - icon256.path = $${DATADIR}/icons/hicolor/256x256/apps - icon256.files = data/core/logo/256x256/vnote.png - - iconsvg.path = $${DATADIR}/icons/hicolor/scalable/apps - iconsvg.files = data/core/logo/vnote.svg - - target.path = $${BINDIR} - - extraresource.path = $${BINDIR} - extraresource.extra = cp $${SRC_DESTDIR}/vnote_extra.rcc $(INSTALL_ROOT)$${BINDIR}/vnote_extra.rcc - - INSTALLS += target desktop icon16 icon32 icon48 icon64 icon128 icon256 iconsvg - INSTALLS += extraresource - message("VNote will be installed in prefix $${PREFIX}") -} - -HEADERS += \ - application.h \ - commandlineoptions.h \ - fakeaccessible.h diff --git a/src/task/CMakeLists.txt b/src/task/CMakeLists.txt new file mode 100644 index 0000000000..c3001b00d3 --- /dev/null +++ b/src/task/CMakeLists.txt @@ -0,0 +1,6 @@ +target_sources(vnote PRIVATE + shellexecution.cpp shellexecution.h + task.cpp task.h + taskmgr.cpp taskmgr.h + taskvariablemgr.cpp taskvariablemgr.h +) diff --git a/src/task/task.pri b/src/task/task.pri deleted file mode 100644 index 80ada9d025..0000000000 --- a/src/task/task.pri +++ /dev/null @@ -1,13 +0,0 @@ -QT += widgets - -SOURCES += \ - $$PWD/task.cpp \ - $$PWD/taskmgr.cpp \ - $$PWD/taskvariablemgr.cpp \ - $$PWD/shellexecution.cpp - -HEADERS += \ - $$PWD/task.h \ - $$PWD/taskmgr.h \ - $$PWD/taskvariablemgr.h \ - $$PWD/shellexecution.h diff --git a/src/unitedentry/CMakeLists.txt b/src/unitedentry/CMakeLists.txt new file mode 100644 index 0000000000..c19f9d9dad --- /dev/null +++ b/src/unitedentry/CMakeLists.txt @@ -0,0 +1,11 @@ +target_sources(vnote PRIVATE + entrypopup.cpp entrypopup.h + entrywidgetfactory.cpp entrywidgetfactory.h + findunitedentry.cpp findunitedentry.h + helpunitedentry.cpp helpunitedentry.h + iunitedentry.cpp iunitedentry.h + unitedentry.cpp unitedentry.h + unitedentryalias.cpp unitedentryalias.h + unitedentryhelper.cpp unitedentryhelper.h + unitedentrymgr.cpp unitedentrymgr.h +) diff --git a/src/unitedentry/unitedentry.pri b/src/unitedentry/unitedentry.pri deleted file mode 100644 index 7e03edbc23..0000000000 --- a/src/unitedentry/unitedentry.pri +++ /dev/null @@ -1,24 +0,0 @@ -QT += widgets - -HEADERS += \ - $$PWD/entrypopup.h \ - $$PWD/entrywidgetfactory.h \ - $$PWD/findunitedentry.h \ - $$PWD/helpunitedentry.h \ - $$PWD/iunitedentry.h \ - $$PWD/unitedentry.h \ - $$PWD/unitedentryalias.h \ - $$PWD/unitedentryhelper.h \ - $$PWD/unitedentrymgr.h - -SOURCES += \ - $$PWD/entrypopup.cpp \ - $$PWD/entrywidgetfactory.cpp \ - $$PWD/findunitedentry.cpp \ - $$PWD/helpunitedentry.cpp \ - $$PWD/iunitedentry.cpp \ - $$PWD/unitedentry.cpp \ - $$PWD/unitedentryalias.cpp \ - $$PWD/unitedentryhelper.cpp \ - $$PWD/unitedentrymgr.cpp - diff --git a/src/utils/CMakeLists.txt b/src/utils/CMakeLists.txt new file mode 100644 index 0000000000..6b3ffce037 --- /dev/null +++ b/src/utils/CMakeLists.txt @@ -0,0 +1,18 @@ +target_sources(vnote PRIVATE + asyncworker.cpp asyncworker.h + callbackpool.cpp callbackpool.h + clipboardutils.cpp clipboardutils.h + contentmediautils.cpp contentmediautils.h + docsutils.cpp docsutils.h + fileutils.cpp fileutils.h + htmlutils.cpp htmlutils.h + iconutils.cpp iconutils.h + imageutils.cpp imageutils.h + pathutils.cpp pathutils.h + printutils.cpp printutils.h + processutils.cpp processutils.h + urldragdroputils.cpp urldragdroputils.h + utils.cpp utils.h + webutils.cpp webutils.h + widgetutils.cpp widgetutils.h +) diff --git a/src/utils/utils.pri b/src/utils/utils.pri deleted file mode 100644 index e0081702f1..0000000000 --- a/src/utils/utils.pri +++ /dev/null @@ -1,41 +0,0 @@ -QT += widgets svg - -greaterThan(QT_MAJOR_VERSION, 5) { - QT += core5compat -} - -SOURCES += \ - $$PWD/asyncworker.cpp \ - $$PWD/callbackpool.cpp \ - $$PWD/contentmediautils.cpp \ - $$PWD/docsutils.cpp \ - $$PWD/htmlutils.cpp \ - $$PWD/imageutils.cpp \ - $$PWD/pathutils.cpp \ - $$PWD/printutils.cpp \ - $$PWD/processutils.cpp \ - $$PWD/urldragdroputils.cpp \ - $$PWD/utils.cpp \ - $$PWD/fileutils.cpp \ - $$PWD/iconutils.cpp \ - $$PWD/webutils.cpp \ - $$PWD/widgetutils.cpp \ - $$PWD/clipboardutils.cpp - -HEADERS += \ - $$PWD/asyncworker.h \ - $$PWD/callbackpool.h \ - $$PWD/contentmediautils.h \ - $$PWD/docsutils.h \ - $$PWD/htmlutils.h \ - $$PWD/imageutils.h \ - $$PWD/pathutils.h \ - $$PWD/printutils.h \ - $$PWD/processutils.h \ - $$PWD/urldragdroputils.h \ - $$PWD/utils.h \ - $$PWD/fileutils.h \ - $$PWD/iconutils.h \ - $$PWD/webutils.h \ - $$PWD/widgetutils.h \ - $$PWD/clipboardutils.h diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt new file mode 100644 index 0000000000..61450e9319 --- /dev/null +++ b/src/widgets/CMakeLists.txt @@ -0,0 +1,143 @@ +target_sources(vnote PRIVATE + attachmentdragdropareaindicator.cpp attachmentdragdropareaindicator.h + attachmentpopup.cpp attachmentpopup.h + biaction.cpp biaction.h + buttonpopup.cpp buttonpopup.h + combobox.cpp combobox.h + consoleviewer.cpp consoleviewer.h + dialogs/deleteconfirmdialog.cpp dialogs/deleteconfirmdialog.h + dialogs/dialog.cpp dialogs/dialog.h + dialogs/exportdialog.cpp dialogs/exportdialog.h + dialogs/filepropertiesdialog.cpp dialogs/filepropertiesdialog.h + dialogs/folderfilesfilterwidget.cpp dialogs/folderfilesfilterwidget.h + dialogs/folderpropertiesdialog.cpp dialogs/folderpropertiesdialog.h + dialogs/imageinsertdialog.cpp dialogs/imageinsertdialog.h + dialogs/importfolderdialog.cpp dialogs/importfolderdialog.h + dialogs/importfolderutils.cpp dialogs/importfolderutils.h + dialogs/importlegacynotebookdialog.cpp dialogs/importlegacynotebookdialog.h + dialogs/importnotebookdialog.cpp dialogs/importnotebookdialog.h + dialogs/legacynotebookutils.cpp dialogs/legacynotebookutils.h + dialogs/levellabelwithupbutton.cpp dialogs/levellabelwithupbutton.h + dialogs/linkinsertdialog.cpp dialogs/linkinsertdialog.h + dialogs/managenotebooksdialog.cpp dialogs/managenotebooksdialog.h + dialogs/newfolderdialog.cpp dialogs/newfolderdialog.h + dialogs/newnotebookdialog.cpp dialogs/newnotebookdialog.h + dialogs/newnotebookfromfolderdialog.cpp dialogs/newnotebookfromfolderdialog.h + dialogs/newnotedialog.cpp dialogs/newnotedialog.h + dialogs/newsnippetdialog.cpp dialogs/newsnippetdialog.h + dialogs/newtagdialog.cpp dialogs/newtagdialog.h + dialogs/nodeinfowidget.cpp dialogs/nodeinfowidget.h + dialogs/notebookinfowidget.cpp dialogs/notebookinfowidget.h + dialogs/notepropertiesdialog.cpp dialogs/notepropertiesdialog.h + dialogs/notetemplateselector.cpp dialogs/notetemplateselector.h + dialogs/renametagdialog.cpp dialogs/renametagdialog.h + dialogs/scrolldialog.cpp dialogs/scrolldialog.h + dialogs/selectdialog.cpp dialogs/selectdialog.h + dialogs/selectionitemwidget.cpp dialogs/selectionitemwidget.h + dialogs/settings/appearancepage.cpp dialogs/settings/appearancepage.h + dialogs/settings/editorpage.cpp dialogs/settings/editorpage.h + dialogs/settings/fileassociationpage.cpp dialogs/settings/fileassociationpage.h + dialogs/settings/generalpage.cpp dialogs/settings/generalpage.h + dialogs/settings/imagehostpage.cpp dialogs/settings/imagehostpage.h + dialogs/settings/markdowneditorpage.cpp dialogs/settings/markdowneditorpage.h + dialogs/settings/miscpage.cpp dialogs/settings/miscpage.h + dialogs/settings/newimagehostdialog.cpp dialogs/settings/newimagehostdialog.h + dialogs/settings/notemanagementpage.cpp dialogs/settings/notemanagementpage.h + dialogs/settings/quickaccesspage.cpp dialogs/settings/quickaccesspage.h + dialogs/settings/settingsdialog.cpp dialogs/settings/settingsdialog.h + dialogs/settings/settingspage.cpp dialogs/settings/settingspage.h + dialogs/settings/texteditorpage.cpp dialogs/settings/texteditorpage.h + dialogs/settings/themepage.cpp dialogs/settings/themepage.h + dialogs/settings/vipage.cpp dialogs/settings/vipage.h + dialogs/snippetinfowidget.cpp dialogs/snippetinfowidget.h + dialogs/snippetpropertiesdialog.cpp dialogs/snippetpropertiesdialog.h + dialogs/sortdialog.cpp dialogs/sortdialog.h + dialogs/tableinsertdialog.cpp dialogs/tableinsertdialog.h + dialogs/updater.cpp dialogs/updater.h + dialogs/viewtagsdialog.cpp dialogs/viewtagsdialog.h + dockwidgethelper.cpp dockwidgethelper.h + dragdropareaindicator.cpp dragdropareaindicator.h + editors/graphhelper.cpp editors/graphhelper.h + editors/graphvizhelper.cpp editors/graphvizhelper.h + editors/markdowneditor.cpp editors/markdowneditor.h + editors/markdowntable.cpp editors/markdowntable.h + editors/markdowntablehelper.cpp editors/markdowntablehelper.h + editors/markdownviewer.cpp editors/markdownviewer.h + editors/markdownvieweradapter.cpp editors/markdownvieweradapter.h + editors/mindmapeditor.cpp editors/mindmapeditor.h + editors/mindmapeditoradapter.cpp editors/mindmapeditoradapter.h + editors/pdfviewer.cpp editors/pdfviewer.h + editors/pdfvieweradapter.cpp editors/pdfvieweradapter.h + editors/plantumlhelper.cpp editors/plantumlhelper.h + editors/previewhelper.cpp editors/previewhelper.h + editors/statuswidget.cpp editors/statuswidget.h + editors/texteditor.cpp editors/texteditor.h + editors/webviewadapter.cpp editors/webviewadapter.h + editreaddiscardaction.cpp editreaddiscardaction.h + filesystemviewer.cpp filesystemviewer.h + findandreplacewidget.cpp findandreplacewidget.h + floatingwidget.cpp floatingwidget.h + framelessmainwindow/framelessmainwindow.cpp framelessmainwindow/framelessmainwindow.h + framelessmainwindow/framelessmainwindowimpl.h + framelessmainwindow/framelessmainwindowlinux.cpp framelessmainwindow/framelessmainwindowlinux.h + framelessmainwindow/framelessmainwindowwin.cpp framelessmainwindow/framelessmainwindowwin.h + fullscreentoggleaction.cpp fullscreentoggleaction.h + historypanel.cpp historypanel.h + itemproxystyle.cpp itemproxystyle.h + labelwithbuttonswidget.cpp labelwithbuttonswidget.h + lineedit.cpp lineedit.h + lineeditdelegate.cpp lineeditdelegate.h + lineeditwithsnippet.cpp lineeditwithsnippet.h + listwidget.cpp listwidget.h + locationinputwithbrowsebutton.cpp locationinputwithbrowsebutton.h + locationlist.cpp locationlist.h + mainwindow.cpp mainwindow.h + markdownviewwindow.cpp markdownviewwindow.h + messageboxhelper.cpp messageboxhelper.h + mindmapviewwindow.cpp mindmapviewwindow.h + navigationmode.cpp navigationmode.h + navigationmodemgr.cpp navigationmodemgr.h + navigationmodewrapper.h + notebookexplorer.cpp notebookexplorer.h + notebookexplorersession.cpp notebookexplorersession.h + notebooknodeexplorer.cpp notebooknodeexplorer.h + notebookselector.cpp notebookselector.h + outlinepopup.cpp outlinepopup.h + outlineprovider.cpp outlineprovider.h + outlineviewer.cpp outlineviewer.h + pdfviewwindow.cpp pdfviewwindow.h + propertydefs.cpp propertydefs.h + qtreewidgetstatecache.h + quickselector.cpp quickselector.h + searchinfoprovider.cpp searchinfoprovider.h + searchpanel.cpp searchpanel.h + simplesegmenthighlighter.cpp simplesegmenthighlighter.h + snippetpanel.cpp snippetpanel.h + statusbarhelper.cpp statusbarhelper.h + styleditemdelegate.cpp styleditemdelegate.h + systemtrayhelper.cpp systemtrayhelper.h + tagexplorer.cpp tagexplorer.h + tagpopup.cpp tagpopup.h + tagviewer.cpp tagviewer.h + textviewwindow.cpp textviewwindow.h + textviewwindowhelper.h + titlebar.cpp titlebar.h + titletoolbar.cpp titletoolbar.h + toolbarhelper.cpp toolbarhelper.h + toolbox.cpp toolbox.h + treeview.cpp treeview.h + treewidget.cpp treewidget.h + treewidgetitem.cpp treewidgetitem.h + viewarea.cpp viewarea.h + viewareasession.cpp viewareasession.h + viewsplit.cpp viewsplit.h + viewwindow.cpp viewwindow.h + viewwindowsession.cpp viewwindowsession.h + viewwindowtoolbarhelper.cpp viewwindowtoolbarhelper.h + webpage.cpp webpage.h + webviewer.cpp webviewer.h + widgetsfactory.cpp widgetsfactory.h + windowspanel.cpp windowspanel.h + windowsprovider.cpp windowsprovider.h + wordcountpopup.cpp wordcountpopup.h +) diff --git a/src/widgets/widgets.pri b/src/widgets/widgets.pri deleted file mode 100644 index eaf719070c..0000000000 --- a/src/widgets/widgets.pri +++ /dev/null @@ -1,281 +0,0 @@ -SOURCES += \ - $$PWD/attachmentdragdropareaindicator.cpp \ - $$PWD/attachmentpopup.cpp \ - $$PWD/biaction.cpp \ - $$PWD/buttonpopup.cpp \ - $$PWD/combobox.cpp \ - $$PWD/consoleviewer.cpp \ - $$PWD/dialogs/dialog.cpp \ - $$PWD/dialogs/exportdialog.cpp \ - $$PWD/dialogs/filepropertiesdialog.cpp \ - $$PWD/dialogs/imageinsertdialog.cpp \ - $$PWD/dialogs/importfolderdialog.cpp \ - $$PWD/dialogs/importlegacynotebookdialog.cpp \ - $$PWD/dialogs/importnotebookdialog.cpp \ - $$PWD/dialogs/legacynotebookutils.cpp \ - $$PWD/dialogs/levellabelwithupbutton.cpp \ - $$PWD/dialogs/linkinsertdialog.cpp \ - $$PWD/dialogs/newnotebookfromfolderdialog.cpp \ - $$PWD/dialogs/newsnippetdialog.cpp \ - $$PWD/dialogs/newtagdialog.cpp \ - $$PWD/dialogs/renametagdialog.cpp \ - $$PWD/dialogs/selectdialog.cpp \ - $$PWD/dialogs/selectionitemwidget.cpp \ - $$PWD/dialogs/settings/appearancepage.cpp \ - $$PWD/dialogs/settings/editorpage.cpp \ - $$PWD/dialogs/settings/fileassociationpage.cpp \ - $$PWD/dialogs/settings/generalpage.cpp \ - $$PWD/dialogs/settings/imagehostpage.cpp \ - $$PWD/dialogs/settings/markdowneditorpage.cpp \ - $$PWD/dialogs/settings/miscpage.cpp \ - $$PWD/dialogs/settings/newimagehostdialog.cpp \ - $$PWD/dialogs/settings/notemanagementpage.cpp \ - $$PWD/dialogs/settings/quickaccesspage.cpp \ - $$PWD/dialogs/settings/settingspage.cpp \ - $$PWD/dialogs/settings/settingsdialog.cpp \ - $$PWD/dialogs/settings/texteditorpage.cpp \ - $$PWD/dialogs/settings/themepage.cpp \ - $$PWD/dialogs/settings/vipage.cpp \ - $$PWD/dialogs/snippetinfowidget.cpp \ - $$PWD/dialogs/snippetpropertiesdialog.cpp \ - $$PWD/dialogs/sortdialog.cpp \ - $$PWD/dialogs/tableinsertdialog.cpp \ - $$PWD/dialogs/updater.cpp \ - $$PWD/dialogs/viewtagsdialog.cpp \ - $$PWD/dialogs/notetemplateselector.cpp \ - $$PWD/dockwidgethelper.cpp \ - $$PWD/dragdropareaindicator.cpp \ - $$PWD/editors/graphhelper.cpp \ - $$PWD/editors/graphvizhelper.cpp \ - $$PWD/editors/markdowneditor.cpp \ - $$PWD/editors/markdowntable.cpp \ - $$PWD/editors/markdowntablehelper.cpp \ - $$PWD/editors/markdownviewer.cpp \ - $$PWD/editors/markdownvieweradapter.cpp \ - $$PWD/editors/mindmapeditor.cpp \ - $$PWD/editors/mindmapeditoradapter.cpp \ - $$PWD/editors/pdfviewer.cpp \ - $$PWD/editors/pdfvieweradapter.cpp \ - $$PWD/editors/plantumlhelper.cpp \ - $$PWD/editors/previewhelper.cpp \ - $$PWD/editors/statuswidget.cpp \ - $$PWD/editors/texteditor.cpp \ - $$PWD/editors/webviewadapter.cpp \ - $$PWD/editreaddiscardaction.cpp \ - $$PWD/filesystemviewer.cpp \ - $$PWD/dialogs/folderfilesfilterwidget.cpp \ - $$PWD/findandreplacewidget.cpp \ - $$PWD/floatingwidget.cpp \ - $$PWD/framelessmainwindow/framelessmainwindow.cpp \ - $$PWD/framelessmainwindow/framelessmainwindowlinux.cpp \ - $$PWD/framelessmainwindow/framelessmainwindowwin.cpp \ - $$PWD/fullscreentoggleaction.cpp \ - $$PWD/historypanel.cpp \ - $$PWD/itemproxystyle.cpp \ - $$PWD/labelwithbuttonswidget.cpp \ - $$PWD/lineedit.cpp \ - $$PWD/lineeditdelegate.cpp \ - $$PWD/lineeditwithsnippet.cpp \ - $$PWD/listwidget.cpp \ - $$PWD/locationinputwithbrowsebutton.cpp \ - $$PWD/locationlist.cpp \ - $$PWD/mainwindow.cpp \ - $$PWD/markdownviewwindow.cpp \ - $$PWD/mindmapviewwindow.cpp \ - $$PWD/navigationmodemgr.cpp \ - $$PWD/notebookexplorersession.cpp \ - $$PWD/outlinepopup.cpp \ - $$PWD/outlineprovider.cpp \ - $$PWD/outlineviewer.cpp \ - $$PWD/pdfviewwindow.cpp \ - $$PWD/propertydefs.cpp \ - $$PWD/quickselector.cpp \ - $$PWD/searchinfoprovider.cpp \ - $$PWD/searchpanel.cpp \ - $$PWD/simplesegmenthighlighter.cpp \ - $$PWD/snippetpanel.cpp \ - $$PWD/styleditemdelegate.cpp \ - $$PWD/systemtrayhelper.cpp \ - $$PWD/tagexplorer.cpp \ - $$PWD/tagpopup.cpp \ - $$PWD/tagviewer.cpp \ - $$PWD/textviewwindow.cpp \ - $$PWD/toolbarhelper.cpp \ - $$PWD/treeview.cpp \ - $$PWD/treewidgetitem.cpp \ - $$PWD/viewareasession.cpp \ - $$PWD/viewsplit.cpp \ - $$PWD/viewwindow.cpp \ - $$PWD/viewwindowsession.cpp \ - $$PWD/viewwindowtoolbarhelper.cpp \ - $$PWD/webpage.cpp \ - $$PWD/webviewer.cpp \ - $$PWD/widgetsfactory.cpp \ - $$PWD/toolbox.cpp \ - $$PWD/navigationmode.cpp \ - $$PWD/titlebar.cpp \ - $$PWD/notebookexplorer.cpp \ - $$PWD/dialogs/newnotebookdialog.cpp \ - $$PWD/dialogs/scrolldialog.cpp \ - $$PWD/notebookselector.cpp \ - $$PWD/notebooknodeexplorer.cpp \ - $$PWD/messageboxhelper.cpp \ - $$PWD/dialogs/newfolderdialog.cpp \ - $$PWD/treewidget.cpp \ - $$PWD/dialogs/newnotedialog.cpp \ - $$PWD/dialogs/managenotebooksdialog.cpp \ - $$PWD/dialogs/notebookinfowidget.cpp \ - $$PWD/dialogs/notepropertiesdialog.cpp \ - $$PWD/dialogs/folderpropertiesdialog.cpp \ - $$PWD/dialogs/nodeinfowidget.cpp \ - $$PWD/statusbarhelper.cpp \ - $$PWD/dialogs/deleteconfirmdialog.cpp \ - $$PWD/dialogs/importfolderutils.cpp \ - $$PWD/titletoolbar.cpp \ - $$PWD/viewarea.cpp \ - $$PWD/windowspanel.cpp \ - $$PWD/windowsprovider.cpp \ - $$PWD/wordcountpopup.cpp - -HEADERS += \ - $$PWD/attachmentdragdropareaindicator.h \ - $$PWD/attachmentpopup.h \ - $$PWD/biaction.h \ - $$PWD/buttonpopup.h \ - $$PWD/combobox.h \ - $$PWD/consoleviewer.h \ - $$PWD/dialogs/dialog.h \ - $$PWD/dialogs/exportdialog.h \ - $$PWD/dialogs/importfolderutils.h \ - $$PWD/dialogs/filepropertiesdialog.h \ - $$PWD/dialogs/imageinsertdialog.h \ - $$PWD/dialogs/importfolderdialog.h \ - $$PWD/dialogs/importlegacynotebookdialog.h \ - $$PWD/dialogs/importnotebookdialog.h \ - $$PWD/dialogs/legacynotebookutils.h \ - $$PWD/dialogs/levellabelwithupbutton.h \ - $$PWD/dialogs/linkinsertdialog.h \ - $$PWD/dialogs/newnotebookfromfolderdialog.h \ - $$PWD/dialogs/newsnippetdialog.h \ - $$PWD/dialogs/newtagdialog.h \ - $$PWD/dialogs/renametagdialog.h \ - $$PWD/dialogs/selectdialog.h \ - $$PWD/dialogs/selectionitemwidget.h \ - $$PWD/dialogs/settings/appearancepage.h \ - $$PWD/dialogs/settings/editorpage.h \ - $$PWD/dialogs/settings/fileassociationpage.h \ - $$PWD/dialogs/settings/generalpage.h \ - $$PWD/dialogs/settings/imagehostpage.h \ - $$PWD/dialogs/settings/markdowneditorpage.h \ - $$PWD/dialogs/settings/miscpage.h \ - $$PWD/dialogs/settings/newimagehostdialog.h \ - $$PWD/dialogs/settings/notemanagementpage.h \ - $$PWD/dialogs/settings/quickaccesspage.h \ - $$PWD/dialogs/settings/settingspage.h \ - $$PWD/dialogs/settings/settingsdialog.h \ - $$PWD/dialogs/settings/texteditorpage.h \ - $$PWD/dialogs/settings/themepage.h \ - $$PWD/dialogs/settings/vipage.h \ - $$PWD/dialogs/snippetinfowidget.h \ - $$PWD/dialogs/snippetpropertiesdialog.h \ - $$PWD/dialogs/sortdialog.h \ - $$PWD/dialogs/tableinsertdialog.h \ - $$PWD/dialogs/updater.h \ - $$PWD/dialogs/viewtagsdialog.h \ - $$PWD/dialogs/notetemplateselector.h \ - $$PWD/dockwidgethelper.h \ - $$PWD/dragdropareaindicator.h \ - $$PWD/editors/graphhelper.h \ - $$PWD/editors/graphvizhelper.h \ - $$PWD/editors/markdowneditor.h \ - $$PWD/editors/markdowntable.h \ - $$PWD/editors/markdowntablehelper.h \ - $$PWD/editors/markdownviewer.h \ - $$PWD/editors/markdownvieweradapter.h \ - $$PWD/editors/mindmapeditor.h \ - $$PWD/editors/mindmapeditoradapter.h \ - $$PWD/editors/pdfviewer.h \ - $$PWD/editors/pdfvieweradapter.h \ - $$PWD/editors/plantumlhelper.h \ - $$PWD/editors/previewhelper.h \ - $$PWD/editors/statuswidget.h \ - $$PWD/editors/texteditor.h \ - $$PWD/editors/webviewadapter.h \ - $$PWD/editreaddiscardaction.h \ - $$PWD/filesystemviewer.h \ - $$PWD/dialogs/folderfilesfilterwidget.h \ - $$PWD/findandreplacewidget.h \ - $$PWD/floatingwidget.h \ - $$PWD/framelessmainwindow/framelessmainwindow.h \ - $$PWD/framelessmainwindow/framelessmainwindowimpl.h \ - $$PWD/framelessmainwindow/framelessmainwindowlinux.h \ - $$PWD/framelessmainwindow/framelessmainwindowwin.h \ - $$PWD/fullscreentoggleaction.h \ - $$PWD/historypanel.h \ - $$PWD/itemproxystyle.h \ - $$PWD/labelwithbuttonswidget.h \ - $$PWD/lineedit.h \ - $$PWD/lineeditdelegate.h \ - $$PWD/lineeditwithsnippet.h \ - $$PWD/listwidget.h \ - $$PWD/locationinputwithbrowsebutton.h \ - $$PWD/locationlist.h \ - $$PWD/mainwindow.h \ - $$PWD/markdownviewwindow.h \ - $$PWD/mindmapviewwindow.h \ - $$PWD/navigationmodemgr.h \ - $$PWD/navigationmodewrapper.h \ - $$PWD/notebookexplorersession.h \ - $$PWD/outlinepopup.h \ - $$PWD/outlineprovider.h \ - $$PWD/outlineviewer.h \ - $$PWD/pdfviewwindow.h \ - $$PWD/propertydefs.h \ - $$PWD/quickselector.h \ - $$PWD/searchinfoprovider.h \ - $$PWD/searchpanel.h \ - $$PWD/simplesegmenthighlighter.h \ - $$PWD/snippetpanel.h \ - $$PWD/styleditemdelegate.h \ - $$PWD/systemtrayhelper.h \ - $$PWD/tagexplorer.h \ - $$PWD/tagpopup.h \ - $$PWD/tagviewer.h \ - $$PWD/textviewwindow.h \ - $$PWD/textviewwindowhelper.h \ - $$PWD/toolbarhelper.h \ - $$PWD/treeview.h \ - $$PWD/treewidgetitem.h \ - $$PWD/viewareasession.h \ - $$PWD/viewsplit.h \ - $$PWD/viewwindow.h \ - $$PWD/viewwindowsession.h \ - $$PWD/viewwindowtoolbarhelper.h \ - $$PWD/webpage.h \ - $$PWD/webviewer.h \ - $$PWD/widgetsfactory.h \ - $$PWD/toolbox.h \ - $$PWD/navigationmode.h \ - $$PWD/titlebar.h \ - $$PWD/notebookexplorer.h \ - $$PWD/dialogs/newnotebookdialog.h \ - $$PWD/dialogs/scrolldialog.h \ - $$PWD/notebookselector.h \ - $$PWD/notebooknodeexplorer.h \ - $$PWD/messageboxhelper.h \ - $$PWD/dialogs/newfolderdialog.h \ - $$PWD/qtreewidgetstatecache.h \ - $$PWD/treewidget.h \ - $$PWD/dialogs/newnotedialog.h \ - $$PWD/dialogs/managenotebooksdialog.h \ - $$PWD/dialogs/notebookinfowidget.h \ - $$PWD/dialogs/notepropertiesdialog.h \ - $$PWD/dialogs/folderpropertiesdialog.h \ - $$PWD/dialogs/nodeinfowidget.h \ - $$PWD/statusbarhelper.h \ - $$PWD/dialogs/deleteconfirmdialog.h \ - $$PWD/titletoolbar.h \ - $$PWD/viewarea.h \ - $$PWD/windowspanel.h \ - $$PWD/windowsprovider.h \ - $$PWD/wordcountpopup.h diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt new file mode 100644 index 0000000000..7843fb35e6 --- /dev/null +++ b/tests/CMakeLists.txt @@ -0,0 +1,3 @@ +add_subdirectory(test_core) +add_subdirectory(test_task) +add_subdirectory(test_utils) diff --git a/tests/common.pri b/tests/common.pri deleted file mode 100644 index 2d4d19412c..0000000000 --- a/tests/common.pri +++ /dev/null @@ -1,10 +0,0 @@ -lessThan(QT_MAJOR_VERSION, 5): error("requires Qt 5 and above") - -equals(QT_MAJOR_VERSION, 5):lessThan(QT_MINOR_VERSION, 12): error("requires Qt 5.12 and above") - -QT += core gui widgets network svg webenginewidgets webchannel -QT += testlib - -CONFIG += c++14 testcase - -CONFIG += no_testcase_installs diff --git a/tests/commonfull.pri b/tests/commonfull.pri deleted file mode 100644 index 43db8a05a1..0000000000 --- a/tests/commonfull.pri +++ /dev/null @@ -1,33 +0,0 @@ -include($$PWD/common.pri) - -QT += sql - -SRC_FOLDER = $$PWD/../src - -LIBS_FOLDER = $$PWD/../libs - -INCLUDEPATH *= $$SRC_FOLDER - -include($$LIBS_FOLDER/vtextedit/src/editor/editor_export.pri) - -include($$LIBS_FOLDER/vtextedit/src/libs/syntax-highlighting/syntax-highlighting_export.pri) - -include($$LIBS_FOLDER/QHotkey/QHotkey_export.pri) - -include($$SRC_FOLDER/utils/utils.pri) - -include($$SRC_FOLDER/export/export.pri) - -include($$SRC_FOLDER/search/search.pri) - -include($$SRC_FOLDER/snippet/snippet.pri) - -include($$SRC_FOLDER/imagehost/imagehost.pri) - -include($$SRC_FOLDER/task/task.pri) - -include($$SRC_FOLDER/core/core.pri) - -include($$SRC_FOLDER/widgets/widgets.pri) - -include($$SRC_FOLDER/unitedentry/unitedentry.pri) diff --git a/tests/test_core/CMakeLists.txt b/tests/test_core/CMakeLists.txt new file mode 100644 index 0000000000..4ea4231a84 --- /dev/null +++ b/tests/test_core/CMakeLists.txt @@ -0,0 +1,2 @@ +add_subdirectory(test_notebook) +add_subdirectory(test_theme) diff --git a/tests/test_core/test_core.pro b/tests/test_core/test_core.pro deleted file mode 100644 index f82e91e43b..0000000000 --- a/tests/test_core/test_core.pro +++ /dev/null @@ -1,5 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = \ - test_notebook \ - test_theme diff --git a/tests/test_core/test_notebook/CMakeLists.txt b/tests/test_core/test_notebook/CMakeLists.txt new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/test_core/test_notebook/test_notebook.pro b/tests/test_core/test_notebook/test_notebook.pro deleted file mode 100644 index 9e2e87a3ee..0000000000 --- a/tests/test_core/test_notebook/test_notebook.pro +++ /dev/null @@ -1,16 +0,0 @@ -include($$PWD/../../commonfull.pri) - -TARGET = test_notebook -TEMPLATE = app - -SOURCES += \ - dummynode.cpp \ - dummynotebook.cpp \ - test_notebook.cpp \ - testnotebookdatabase.cpp - -HEADERS += \ - dummynode.h \ - dummynotebook.h \ - test_notebook.h \ - testnotebookdatabase.h diff --git a/tests/test_core/test_theme/test_theme.pro b/tests/test_core/test_theme/test_theme.pro deleted file mode 100644 index 58ba01b56b..0000000000 --- a/tests/test_core/test_theme/test_theme.pro +++ /dev/null @@ -1,28 +0,0 @@ -include($$PWD/../../common.pri) - -TARGET = test_theme -TEMPLATE = app - -SRC_FOLDER = $$PWD/../../../src -CORE_FOLDER = $$SRC_FOLDER/core -UTILS_FOLDER = $$SRC_FOLDER/utils - -INCLUDEPATH *= $$SRC_FOLDER -INCLUDEPATH *= $$SRC_FOLDER/core - -SOURCES += \ - test_theme.cpp \ - $$CORE_FOLDER/theme.cpp \ - $$UTILS_FOLDER/pathutils.cpp \ - $$UTILS_FOLDER/utils.cpp \ - $$UTILS_FOLDER/widgetutils.cpp \ - $$UTILS_FOLDER/fileutils.cpp \ - -HEADERS += \ - test_theme.h \ - $$CORE_FOLDER/exception.h \ - $$CORE_FOLDER/theme.h \ - $$UTILS_FOLDER/pathutils.h \ - $$UTILS_FOLDER/utils.h \ - $$UTILS_FOLDER/widgetutils.h \ - $$UTILS_FOLDER/fileutils.h \ diff --git a/tests/test_task/test_task.pro b/tests/test_task/test_task.pro deleted file mode 100644 index 275e6ef5d8..0000000000 --- a/tests/test_task/test_task.pro +++ /dev/null @@ -1,10 +0,0 @@ -include($$PWD/../commonfull.pri) - -TARGET = test_task -TEMPLATE = app - -SOURCES += \ - test_task.cpp - -HEADERS += \ - test_task.h diff --git a/tests/test_utils/test_utils.pro b/tests/test_utils/test_utils.pro deleted file mode 100644 index 91e5681f8d..0000000000 --- a/tests/test_utils/test_utils.pro +++ /dev/null @@ -1,21 +0,0 @@ -include($$PWD/../common.pri) - -TARGET = test_utils -TEMPLATE = app - -SRC_FOLDER = $$PWD/../../src -UTILS_FOLDER = $$SRC_FOLDER/utils - -INCLUDEPATH *= $$SRC_FOLDER - -SOURCES += \ - test_utils.cpp \ - $$UTILS_FOLDER/utils.cpp \ - $$UTILS_FOLDER/pathutils.cpp \ - $$UTILS_FOLDER/fileutils.cpp - -HEADERS += \ - test_utils.h \ - $$UTILS_FOLDER/utils.h \ - $$UTILS_FOLDER/pathutils.h \ - $$UTILS_FOLDER/fileutils.h diff --git a/tests/tests.pro b/tests/tests.pro deleted file mode 100644 index ae57b17f49..0000000000 --- a/tests/tests.pro +++ /dev/null @@ -1,6 +0,0 @@ -TEMPLATE = subdirs - -SUBDIRS = \ - test_utils \ - test_core \ - test_task diff --git a/vnote.pro b/vnote.pro deleted file mode 100644 index 0e100f9f3b..0000000000 --- a/vnote.pro +++ /dev/null @@ -1,11 +0,0 @@ -TEMPLATE = subdirs - -CONFIG += c++14 - -SUBDIRS = \ - libs \ - src \ - tests - -src.depends = libs -tests.depends = libs