ソースを参照

migrate to cmake

Le Tan 1 年間 前
コミット
25b556ae14
44 ファイル変更406 行追加912 行削除
  1. 2 0
      .gitignore
  2. 13 0
      CMakeLists.txt
  3. 2 0
      libs/CMakeLists.txt
  4. 1 1
      libs/QHotkey
  5. 0 5
      libs/libs.pro
  6. 1 1
      libs/vtextedit
  7. 88 0
      src/CMakeLists.txt
  8. 87 0
      src/core/CMakeLists.txt
  9. 0 31
      src/core/buffer/buffer.pri
  10. 0 76
      src/core/core.pri
  11. 0 30
      src/core/notebook/notebook.pri
  12. 0 10
      src/core/notebookbackend/notebookbackend.pri
  13. 0 16
      src/core/notebookconfigmgr/notebookconfigmgr.pri
  14. 0 11
      src/core/versioncontroller/versioncontroller.pri
  15. 1 0
      src/data/core/icons/vnote.rc
  16. 5 0
      src/export/CMakeLists.txt
  17. 0 11
      src/export/export.pri
  18. 8 0
      src/imagehost/CMakeLists.txt
  19. 0 18
      src/imagehost/imagehost.pri
  20. 10 0
      src/search/CMakeLists.txt
  21. 0 20
      src/search/search.pri
  22. 5 0
      src/snippet/CMakeLists.txt
  23. 0 12
      src/snippet/snippet.pri
  24. 0 171
      src/src.pro
  25. 6 0
      src/task/CMakeLists.txt
  26. 0 13
      src/task/task.pri
  27. 11 0
      src/unitedentry/CMakeLists.txt
  28. 0 24
      src/unitedentry/unitedentry.pri
  29. 18 0
      src/utils/CMakeLists.txt
  30. 0 41
      src/utils/utils.pri
  31. 143 0
      src/widgets/CMakeLists.txt
  32. 0 281
      src/widgets/widgets.pri
  33. 3 0
      tests/CMakeLists.txt
  34. 0 10
      tests/common.pri
  35. 0 33
      tests/commonfull.pri
  36. 2 0
      tests/test_core/CMakeLists.txt
  37. 0 5
      tests/test_core/test_core.pro
  38. 0 0
      tests/test_core/test_notebook/CMakeLists.txt
  39. 0 16
      tests/test_core/test_notebook/test_notebook.pro
  40. 0 28
      tests/test_core/test_theme/test_theme.pro
  41. 0 10
      tests/test_task/test_task.pro
  42. 0 21
      tests/test_utils/test_utils.pro
  43. 0 6
      tests/tests.pro
  44. 0 11
      vnote.pro

+ 2 - 0
.gitignore

@@ -11,3 +11,5 @@ GRTAGS
 GTAGS
 aqtinstall.log
 tags
+CMakeLists.txt.user
+build

+ 13 - 0
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)

+ 2 - 0
libs/CMakeLists.txt

@@ -0,0 +1,2 @@
+add_subdirectory(QHotKey)
+add_subdirectory(vtextedit)

+ 1 - 1
libs/QHotkey

@@ -1 +1 @@
-Subproject commit 18ac011008d3ae55abc19233ba94fad1ea9801d8
+Subproject commit 9bf5b15a521ca94070adfef91bde54a975a5298c

+ 0 - 5
libs/libs.pro

@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS += \
-    vtextedit \
-    QHotkey

+ 1 - 1
libs/vtextedit

@@ -1 +1 @@
-Subproject commit b512b5126fe0898a29280204f2959e2dbeb67660
+Subproject commit 70b856b124aedf6b683926d9170b65eda45578cf

+ 88 - 0
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()

+ 87 - 0
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}
+)

+ 0 - 31
src/core/buffer/buffer.pri

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

+ 0 - 76
src/core/core.pri

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

+ 0 - 30
src/core/notebook/notebook.pri

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

+ 0 - 10
src/core/notebookbackend/notebookbackend.pri

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

+ 0 - 16
src/core/notebookconfigmgr/notebookconfigmgr.pri

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

+ 0 - 11
src/core/versioncontroller/versioncontroller.pri

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

+ 1 - 0
src/data/core/icons/vnote.rc

@@ -0,0 +1 @@
+IDI_ICON1               ICON    DISCARDABLE     "vnote.ico"

+ 5 - 0
src/export/CMakeLists.txt

@@ -0,0 +1,5 @@
+target_sources(vnote PRIVATE
+    exportdata.cpp exportdata.h
+    exporter.cpp exporter.h
+    webviewexporter.cpp webviewexporter.h
+)

+ 0 - 11
src/export/export.pri

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

+ 8 - 0
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
+)

+ 0 - 18
src/imagehost/imagehost.pri

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

+ 10 - 0
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
+)

+ 0 - 20
src/search/search.pri

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

+ 5 - 0
src/snippet/CMakeLists.txt

@@ -0,0 +1,5 @@
+target_sources(vnote PRIVATE
+    dynamicsnippet.cpp dynamicsnippet.h
+    snippet.cpp snippet.h
+    snippetmgr.cpp snippetmgr.h
+)

+ 0 - 12
src/snippet/snippet.pri

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

+ 0 - 171
src/src.pro

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

+ 6 - 0
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
+)

+ 0 - 13
src/task/task.pri

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

+ 11 - 0
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
+)

+ 0 - 24
src/unitedentry/unitedentry.pri

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

+ 18 - 0
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
+)

+ 0 - 41
src/utils/utils.pri

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

+ 143 - 0
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
+)

+ 0 - 281
src/widgets/widgets.pri

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

+ 3 - 0
tests/CMakeLists.txt

@@ -0,0 +1,3 @@
+add_subdirectory(test_core)
+add_subdirectory(test_task)
+add_subdirectory(test_utils)

+ 0 - 10
tests/common.pri

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

+ 0 - 33
tests/commonfull.pri

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

+ 2 - 0
tests/test_core/CMakeLists.txt

@@ -0,0 +1,2 @@
+add_subdirectory(test_notebook)
+add_subdirectory(test_theme)

+ 0 - 5
tests/test_core/test_core.pro

@@ -1,5 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS = \
-    test_notebook \
-    test_theme

+ 0 - 0
tests/test_core/test_notebook/CMakeLists.txt


+ 0 - 16
tests/test_core/test_notebook/test_notebook.pro

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

+ 0 - 28
tests/test_core/test_theme/test_theme.pro

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

+ 0 - 10
tests/test_task/test_task.pro

@@ -1,10 +0,0 @@
-include($$PWD/../commonfull.pri)
-
-TARGET = test_task
-TEMPLATE = app
-
-SOURCES += \
-    test_task.cpp
-
-HEADERS += \
-    test_task.h

+ 0 - 21
tests/test_utils/test_utils.pro

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

+ 0 - 6
tests/tests.pro

@@ -1,6 +0,0 @@
-TEMPLATE = subdirs
-
-SUBDIRS = \
-    test_utils \
-    test_core \
-    test_task

+ 0 - 11
vnote.pro

@@ -1,11 +0,0 @@
-TEMPLATE = subdirs
-
-CONFIG += c++14
-
-SUBDIRS = \
-    libs \
-    src \
-    tests
-
-src.depends = libs
-tests.depends = libs