Compare commits
71
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
70092378c2 | ||
|
|
f76c1773ae | ||
|
|
997a0ff1e7 | ||
|
|
f0a143a85e | ||
|
|
7b7c6f4794 | ||
|
|
9ad9fd8980 | ||
|
|
6ad1b1ce52 | ||
|
|
4750791a6a | ||
|
|
6894f9b608 | ||
|
|
c23dbfb9f9 | ||
|
|
47fd6af759 | ||
|
|
351399ee9e | ||
|
|
86b5efbd76 | ||
|
|
b0c43ce94f | ||
|
|
c28260a0fa | ||
|
|
b6a92d0825 | ||
|
|
cd0f4e8fc0 | ||
|
|
146487b760 | ||
|
|
197e127035 | ||
|
|
ecfa1b7920 | ||
|
|
093261232c | ||
|
|
fd05f0fbc5 | ||
|
|
e3c0ed9349 | ||
|
|
ce1d5e8443 | ||
|
|
281dfd7fac | ||
|
|
f18bef7f73 | ||
|
|
2fbe3d68ea | ||
|
|
27262d20b4 | ||
|
|
d0f9056f15 | ||
|
|
a087ef9454 | ||
|
|
989f174678 | ||
|
|
3be856b1f9 | ||
|
|
cf9534d795 | ||
|
|
f70e9ecbc4 | ||
|
|
5cae072a02 | ||
|
|
1a0b564b1e | ||
|
|
efc80fde57 | ||
|
|
fcd2f33304 | ||
|
|
d3873213f1 | ||
|
|
4b6b58de86 | ||
|
|
8990eb320d | ||
|
|
8b8c186697 | ||
|
|
4277bcc47d | ||
|
|
73772365ad | ||
|
|
ad9d8d7930 | ||
|
|
a37681e58b | ||
|
|
3e9fd2306b | ||
|
|
b86e237c0b | ||
|
|
404511603d | ||
|
|
744b8e3186 | ||
|
|
5795114561 | ||
|
|
b54b1a6e02 | ||
|
|
7dd45b586b | ||
|
|
a26679d6d3 | ||
|
|
85329174ba | ||
|
|
d079d1787c | ||
|
|
7d51b7d917 | ||
|
|
f3614a3745 | ||
|
|
8e30c8b633 | ||
|
|
cffdf6b57f | ||
|
|
e946c475c4 | ||
|
|
ca890978ab | ||
|
|
5536613411 | ||
|
|
2dfca2f53d | ||
|
|
aeea6e62d8 | ||
|
|
b0d03d9c8d | ||
|
|
3950da7999 | ||
|
|
7008d2abdd | ||
|
|
27558c42bb | ||
|
|
673e26e290 | ||
|
|
44bd0aad01 |
@@ -26,6 +26,7 @@ build-*
|
||||
.DS_Store
|
||||
.idea
|
||||
.vscode
|
||||
__pycache__
|
||||
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtension/bin
|
||||
/ide_plugins/vs/vs2015/SourcetrailPlugin/SourcetrailExtension/obj
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
[submodule "submodules/SourcetrailPythonIndexer"]
|
||||
path = submodules/SourcetrailPythonIndexer
|
||||
url = https://github.com/CoatiSoftware/SourcetrailPythonIndexer.git
|
||||
@@ -1,5 +1,48 @@
|
||||
### Changelog
|
||||
|
||||
#### 2020.4.35
|
||||
released 2021-01-06
|
||||
|
||||
* Build: Add compatibility layer for Qt versions ([#1118](https://github.com/CoatiSoftware/Sourcetrail/issues/1118))
|
||||
* C/C++: Updated to LLVM/Clang 11.0.0 (issue [#1088](https://github.com/CoatiSoftware/Sourcetrail/issues/1088)) ([#1116](https://github.com/CoatiSoftware/Sourcetrail/issues/1116))
|
||||
* C/C++: fix crash when using codeblocks project (issue [#1109](https://github.com/CoatiSoftware/Sourcetrail/issues/1109)) ([#1110](https://github.com/CoatiSoftware/Sourcetrail/issues/1110))
|
||||
* Graph: add menu action for graph 'save as image' (issue [#426](https://github.com/CoatiSoftware/Sourcetrail/issues/426)) ([#1104](https://github.com/CoatiSoftware/Sourcetrail/issues/1104))
|
||||
* Graph: remember graph zoom level on restart (issue [#801](https://github.com/CoatiSoftware/Sourcetrail/issues/801)) ([#1099](https://github.com/CoatiSoftware/Sourcetrail/issues/1099))
|
||||
* Build: fix compiler issue when CMAKE_CXX_COMPILER_LAUNCHER was set to ccache (issue [#1081](https://github.com/CoatiSoftware/Sourcetrail/issues/1081)) ([#1093](https://github.com/CoatiSoftware/Sourcetrail/issues/1093))
|
||||
* Python: update python indexer to v1.db25.p5 ([#1087](https://github.com/CoatiSoftware/Sourcetrail/issues/1087))
|
||||
* Linux: explicitly add u+w permission when copying initial user data ([#1072](https://github.com/CoatiSoftware/Sourcetrail/issues/1072))
|
||||
* Linux: Fixed duplicating Sourcetrail icon on run ([#1071](https://github.com/CoatiSoftware/Sourcetrail/issues/1071))
|
||||
* Build: Qt 5.12 deprecation fixes ([#1003](https://github.com/CoatiSoftware/Sourcetrail/issues/1003))
|
||||
* Linux: Prevent word splitting within arguments passed to Sourcetrail.sh ([#1057](https://github.com/CoatiSoftware/Sourcetrail/issues/1057))
|
||||
* C/C++: Support linking with LLVM/Clang Dylib instead of individual components ([#1044](https://github.com/CoatiSoftware/Sourcetrail/issues/1044))
|
||||
|
||||
|
||||
#### 2020.2.43
|
||||
released 2020-06-29
|
||||
|
||||
* Docs: Explain Linux Tarball uninstall ([#1047](https://github.com/CoatiSoftware/Sourcetrail/issues/1047))
|
||||
* Graph: Renamed 'aggregation' edge to 'bundled edges' for more clarity ([#1051](https://github.com/CoatiSoftware/Sourcetrail/issues/1051))
|
||||
* Fixed error recording for multi-threaded custom command indexing ([#1049](https://github.com/CoatiSoftware/Sourcetrail/issues/1049))
|
||||
* UI: Fixed crash when changing tabs during animation with focus on a child node ([#1046](https://github.com/CoatiSoftware/Sourcetrail/issues/1046))
|
||||
* C/C++: Improved help message for source file extensions in project settings ([#1039](https://github.com/CoatiSoftware/Sourcetrail/issues/1039))
|
||||
* Python: Updated to SourcetrailPythonIndexer v1.db25.p4 - Record override edges ([#1037](https://github.com/CoatiSoftware/Sourcetrail/issues/1037))
|
||||
* Linux: Migrated Linux '.tar.gz' package creation from CPack to linuxdeployqt ([#1034](https://github.com/CoatiSoftware/Sourcetrail/issues/1034))
|
||||
* UI: Save last filepicker location ([#802](https://github.com/CoatiSoftware/Sourcetrail/issues/802))
|
||||
* C/C++: Updated to LLVM/Clang 10.0.0 ([#965](https://github.com/CoatiSoftware/Sourcetrail/issues/965))
|
||||
* Java: Updated macOS Java Path detector and docs to current JDK file structure ([#1031](https://github.com/CoatiSoftware/Sourcetrail/issues/1031))
|
||||
* Improved performance of excluded files and directories filtering ([#1030](https://github.com/CoatiSoftware/Sourcetrail/issues/1030))
|
||||
* Fix corrupted display of non-ascii characters in about window ([#1013](https://github.com/CoatiSoftware/Sourcetrail/issues/1013))
|
||||
* C/C++: Copy Clang compiler headers from Clang build dir via CMake ([#993](https://github.com/CoatiSoftware/Sourcetrail/issues/993))
|
||||
* Improved error logging if exception occurred while loading project ([#1004](https://github.com/CoatiSoftware/Sourcetrail/issues/1004))
|
||||
* Graph: Add context menu action 'copy to clipboard' ([#999](https://github.com/CoatiSoftware/Sourcetrail/issues/999))
|
||||
* C/C++: Extend Compiler Flags help message ([#974](https://github.com/CoatiSoftware/Sourcetrail/issues/974))
|
||||
* macOS: Create .dmg release package using HFS+ filesystem to be mountable on older macOS versions ([#619](https://github.com/CoatiSoftware/Sourcetrail/issues/619))
|
||||
* Python: Respect "super()" in post processing ([#964](https://github.com/CoatiSoftware/Sourcetrail/issues/964))
|
||||
* Less restrictions for FilePath::isValid check on project location ([#959](https://github.com/CoatiSoftware/Sourcetrail/issues/959))
|
||||
* Refactored recent projects menu ([#956](https://github.com/CoatiSoftware/Sourcetrail/issues/956))
|
||||
* macOs: Updated Info.plist missing values and removed deprecated keys
|
||||
* Python: Respect class qualifier in method call for post processing ([#951](https://github.com/CoatiSoftware/Sourcetrail/issues/951))
|
||||
|
||||
#### 2020.1.117
|
||||
released 2020-03-31
|
||||
|
||||
|
||||
+120
-50
@@ -24,16 +24,16 @@ if (${CMAKE_BINARY_DIR} STREQUAL ${CMAKE_SOURCE_DIR})
|
||||
message(FATAL_ERROR "Please create a separate build directory and call CMake again")
|
||||
endif()
|
||||
|
||||
# speed up recompiling on unix with ccache
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if (CCACHE_PROGRAM)
|
||||
message(STATUS "ccache found")
|
||||
|
||||
# Support Unix Makefiles and Ninja
|
||||
set_property(GLOBAL PROPERTY RULE_LAUNCH_COMPILE "${CCACHE_PROGRAM}")
|
||||
if(NOT DEFINED CMAKE_CXX_COMPILER_LAUNCHER)
|
||||
# speed up recompiling on unix with ccache
|
||||
find_program(CCACHE_PROGRAM ccache)
|
||||
if (CCACHE_PROGRAM)
|
||||
message(STATUS "ccache found")
|
||||
# Support Unix Makefiles and Ninja
|
||||
set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}" CACHE STRING "Compiler launcher for CXX")
|
||||
endif()
|
||||
endif()
|
||||
|
||||
|
||||
# Variables --------------------------------------------------------------------
|
||||
|
||||
set(PROJECT_NAME Sourcetrail)
|
||||
@@ -138,7 +138,17 @@ if (BUILD_CXX_LANGUAGE_PACKAGE)
|
||||
set (CLANG_COMPILER_HEADER_SEARCH_PATH "")
|
||||
foreach(LLVM_CONFIGURATION_TYPE ${LLVM_CONFIGURATION_TYPES})
|
||||
if (CLANG_COMPILER_HEADER_SEARCH_PATH STREQUAL "")
|
||||
set (CLANG_COMPILER_HEADER_SEARCH_PATH "${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib/clang/${LLVM_VERSION}/include")
|
||||
set (_CLANG_HEADERS_SEARCH_LIST
|
||||
"${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib/clang/${LLVM_VERSION}/include"
|
||||
"${LLVM_BINARY_DIR}/${LLVM_CONFIGURATION_TYPE}/lib64/clang/${LLVM_VERSION}/include"
|
||||
)
|
||||
foreach (_CLANG_HEADER_PATH ${_CLANG_HEADERS_SEARCH_LIST})
|
||||
if (EXISTS ${_CLANG_HEADER_PATH})
|
||||
set (CLANG_COMPILER_HEADER_SEARCH_PATH ${_CLANG_HEADER_PATH})
|
||||
break ()
|
||||
endif ()
|
||||
endforeach ()
|
||||
|
||||
message (STATUS "Trying to find Clang compiler headers in '${LLVM_CONFIGURATION_TYPE}' build config in directory '${CLANG_COMPILER_HEADER_SEARCH_PATH}'.")
|
||||
if (EXISTS ${CLANG_COMPILER_HEADER_SEARCH_PATH})
|
||||
message (STATUS "Found headers for '${LLVM_CONFIGURATION_TYPE}' build config.")
|
||||
@@ -170,10 +180,12 @@ find_package(Boost 1.67 COMPONENTS system program_options filesystem date_time R
|
||||
|
||||
# Qt ---------------------------------------------------------------------------
|
||||
|
||||
find_package(Qt5 COMPONENTS Widgets PrintSupport Network Svg REQUIRED)
|
||||
set (QT_MIN_VERSION "5.12.0")
|
||||
set (QT_MIN_VERSION_HEX 0x051200)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS Widgets PrintSupport Network Svg REQUIRED)
|
||||
|
||||
if (WIN32)
|
||||
find_package(Qt5 COMPONENTS WinExtras REQUIRED)
|
||||
find_package(Qt5 ${QT_MIN_VERSION} COMPONENTS WinExtras REQUIRED)
|
||||
endif()
|
||||
|
||||
if(Qt5Widgets_FOUND)
|
||||
@@ -183,6 +195,18 @@ if(Qt5Widgets_FOUND)
|
||||
if (Qt5_POSITION_INDEPENDENT_CODE)
|
||||
SET(CMAKE_POSITION_INDEPENDENT_CODE ON)
|
||||
endif()
|
||||
|
||||
# The following define makes your compiler emit warnings if you use
|
||||
# any feature of Qt which as been marked as deprecated (the exact warnings
|
||||
# depend on your compiler). Please consult the documentation of the
|
||||
# deprecated API in order to know how to port your code away from it.
|
||||
add_definitions (-DQT_DEPRECATED_WARNINGS)
|
||||
|
||||
# You can also make your code fail to compile if you use deprecated APIs.
|
||||
# In order to do so, uncomment the following line.
|
||||
# You can also select to disable deprecated APIs only up to a certain version of Qt.
|
||||
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=${QT_MIN_VERSION_HEX} # disables all the APIs deprecated at or before the specified Qt version
|
||||
add_definitions (-DQT_DISABLE_DEPRECATED_BEFORE=${QT_MIN_VERSION_HEX})
|
||||
endif()
|
||||
|
||||
|
||||
@@ -359,38 +383,46 @@ if (BUILD_CXX_LANGUAGE_PACKAGE)
|
||||
|
||||
link_directories(${LLVM_LIBRARY_DIRS} ${CLANG_LIBRARY_DIRS} ${Boost_LIBRARY_DIRS})
|
||||
|
||||
llvm_map_components_to_libnames(REQ_LLVM_LIBS
|
||||
support core libdriver passes option
|
||||
)
|
||||
foreach(LLVM_TARGET ${LLVM_TARGETS_TO_BUILD})
|
||||
get_property(lib_deps GLOBAL PROPERTY "LLVMBUILD_LIB_DEPS_LLVM${LLVM_TARGET}CodeGen")
|
||||
list(APPEND REQ_LLVM_LIBS "LLVM${LLVM_TARGET}CodeGen")
|
||||
list(APPEND REQ_LLVM_LIBS "${lib_deps}")
|
||||
get_property(lib_deps GLOBAL PROPERTY "LLVMBUILD_LIB_DEPS_LLVM${LLVM_TARGET}AsmParser")
|
||||
if (NOT "${lib_deps}" STREQUAL "")
|
||||
list(APPEND REQ_LLVM_LIBS "LLVM${LLVM_TARGET}AsmParser")
|
||||
list(APPEND REQ_LLVM_LIBS "${lib_deps}")
|
||||
endif()
|
||||
endforeach()
|
||||
if(LLVM_LINK_LLVM_DYLIB)
|
||||
set(REQ_LLVM_LIBS LLVM)
|
||||
else()
|
||||
llvm_map_components_to_libnames(REQ_LLVM_LIBS
|
||||
support core libdriver passes option
|
||||
)
|
||||
foreach(LLVM_TARGET ${LLVM_TARGETS_TO_BUILD})
|
||||
get_property(lib_deps GLOBAL PROPERTY "LLVMBUILD_LIB_DEPS_LLVM${LLVM_TARGET}CodeGen")
|
||||
list(APPEND REQ_LLVM_LIBS "LLVM${LLVM_TARGET}CodeGen")
|
||||
list(APPEND REQ_LLVM_LIBS "${lib_deps}")
|
||||
get_property(lib_deps GLOBAL PROPERTY "LLVMBUILD_LIB_DEPS_LLVM${LLVM_TARGET}AsmParser")
|
||||
if (NOT "${lib_deps}" STREQUAL "")
|
||||
list(APPEND REQ_LLVM_LIBS "LLVM${LLVM_TARGET}AsmParser")
|
||||
list(APPEND REQ_LLVM_LIBS "${lib_deps}")
|
||||
endif()
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
set(CLANG_LIBRARIES
|
||||
clangASTMatchers
|
||||
clangFrontend
|
||||
clangSerialization
|
||||
clangDriver
|
||||
clangTooling
|
||||
clangParse
|
||||
clangSema
|
||||
clangStaticAnalyzerFrontend
|
||||
clangStaticAnalyzerCheckers
|
||||
clangStaticAnalyzerCore
|
||||
clangAnalysis
|
||||
clangRewriteFrontend
|
||||
clangEdit
|
||||
clangAST
|
||||
clangLex
|
||||
clangBasic
|
||||
)
|
||||
if(LLVM_LINK_LLVM_DYLIB) # Should be CLANG_LINK_CLANG_DYLIB in future LLVM release
|
||||
set(CLANG_LIBRARIES clang-cpp)
|
||||
else()
|
||||
set(CLANG_LIBRARIES
|
||||
clangASTMatchers
|
||||
clangFrontend
|
||||
clangSerialization
|
||||
clangDriver
|
||||
clangTooling
|
||||
clangParse
|
||||
clangSema
|
||||
clangStaticAnalyzerFrontend
|
||||
clangStaticAnalyzerCheckers
|
||||
clangStaticAnalyzerCore
|
||||
clangAnalysis
|
||||
clangRewriteFrontend
|
||||
clangEdit
|
||||
clangAST
|
||||
clangLex
|
||||
clangBasic
|
||||
)
|
||||
endif()
|
||||
|
||||
target_link_libraries(${LIB_CXX_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${CLANG_LIBRARIES} ${REQ_LLVM_LIBS})
|
||||
|
||||
@@ -450,10 +482,39 @@ else()
|
||||
endif()
|
||||
|
||||
|
||||
|
||||
string(REGEX REPLACE "/" "\\\\" BACKSLASHED_CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||
string(REGEX REPLACE "/" "\\\\" BACKSLASHED_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||
|
||||
|
||||
# Lib Python ---------------------------------------------------------------------
|
||||
|
||||
if (BUILD_PYTHON_LANGUAGE_PACKAGE)
|
||||
|
||||
file (STRINGS "${CMAKE_SOURCE_DIR}/submodules/SourcetrailPythonIndexer/SourcetrailDB/version.txt" VERSION_STRING)
|
||||
|
||||
string(REGEX REPLACE "v([0-9]+)\\..*" "\\1" INTERFACE_VERSION "${VERSION_STRING}")
|
||||
string(REGEX REPLACE "v[0-9]+\\.db([0-9]+)\\..*" "\\1" DATABASE_VERSION "${VERSION_STRING}")
|
||||
string(REGEX REPLACE "v[0-9]+\\.db[0-9]+\\.p([0-9]+).*" "\\1" PATCH_VERSION "${VERSION_STRING}")
|
||||
set(VERSION_STRING_UNDERSCORE "v${INTERFACE_VERSION}_db${DATABASE_VERSION}_p${PATCH_VERSION}")
|
||||
|
||||
message(STATUS "SourcetrailDB Version: ${VERSION_STRING}")
|
||||
message(STATUS "Interface Version: ${INTERFACE_VERSION}")
|
||||
message(STATUS "Database Version: ${DATABASE_VERSION}")
|
||||
message(STATUS "Patch Version: ${PATCH_VERSION}")
|
||||
|
||||
set(LIB_CORE_TARGET_NAME "SourcetrailDB_core_lib")
|
||||
add_subdirectory(
|
||||
"${CMAKE_SOURCE_DIR}/submodules/SourcetrailPythonIndexer/SourcetrailDB/core"
|
||||
"${CMAKE_BINARY_DIR}/SourcetrailPythonIndexer/SourcetrailDB/core")
|
||||
|
||||
set(PYTHON_BINDING_TARGET_NAME "bindings_python")
|
||||
set(PYTHON_BINDING_OUTPUT_DIR "")
|
||||
add_subdirectory(
|
||||
"${CMAKE_SOURCE_DIR}/submodules/SourcetrailPythonIndexer/SourcetrailDB/bindings_python"
|
||||
"${CMAKE_BINARY_DIR}/SourcetrailPythonIndexer/SourcetrailDB/bindings_python")
|
||||
|
||||
|
||||
add_library(${LIB_PYTHON_PROJECT_NAME} ${LIB_PYTHON_FILES})
|
||||
|
||||
create_source_groups(${LIB_PYTHON_FILES})
|
||||
@@ -470,14 +531,26 @@ if (BUILD_PYTHON_LANGUAGE_PACKAGE)
|
||||
#link_directories(${Boost_LIBRARY_DIRS})
|
||||
|
||||
target_link_libraries(${LIB_PYTHON_PROJECT_NAME} ${LIB_UTILITY_PROJECT_NAME} ${LIB_PROJECT_NAME})
|
||||
|
||||
add_dependencies(${LIB_PYTHON_PROJECT_NAME} _${PYTHON_BINDING_TARGET_NAME})
|
||||
|
||||
string(REGEX REPLACE "\\\\" "/" FORWARDSLASHED_PYTHON_INCLUDE_DIR ${PYTHON_INCLUDE_DIR})
|
||||
set(PYTHON_ENVIRONMENT_DIR "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\data\\python\\environment")
|
||||
set(PYTHON_INDEXER_DIR "${BACKSLASHED_CMAKE_SOURCE_DIR}\\bin\\app\\data\\python\\indexer")
|
||||
|
||||
execute_process(
|
||||
COMMAND "cmd.exe" "/k" "rmdir" "/s" "/q" "${PYTHON_ENVIRONMENT_DIR}" & "${PYTHON_INCLUDE_DIR}/../python.exe" "-m" "venv" "--clear" "--copies" "${PYTHON_ENVIRONMENT_DIR}" & "${PYTHON_ENVIRONMENT_DIR}/Scripts/pip" "install" "-r" "${CMAKE_SOURCE_DIR}/submodules/SourcetrailPythonIndexer/requirements.txt" & exit
|
||||
)
|
||||
execute_process(
|
||||
COMMAND "cmd.exe" "/k" "rmdir" "/s" "/q" "${PYTHON_INDEXER_DIR}" & exit
|
||||
)
|
||||
|
||||
add_custom_command(
|
||||
TARGET ${LIB_PYTHON_PROJECT_NAME}
|
||||
PRE_BUILD
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/script/download_python_indexer.sh
|
||||
COMMENT "download python indexer"
|
||||
COMMAND ${PROJECT_SOURCE_DIR}/script/update_python_indexer.sh
|
||||
COMMENT "updating python indexer scripts"
|
||||
)
|
||||
|
||||
|
||||
else()
|
||||
|
||||
message(STATUS "Building the Python indexer will be skipped. You can enable building this target by setting 'BUILD_PYTHON_LANGUAGE_PACKAGE' to 'ON'.")
|
||||
@@ -663,9 +736,6 @@ if (WIN32)
|
||||
TARGET ${APP_PROJECT_NAME}
|
||||
PROPERTY VS_DEBUGGER_WORKING_DIRECTORY
|
||||
"${CMAKE_SOURCE_DIR}/bin/app")
|
||||
|
||||
string(REGEX REPLACE "/" "\\\\" BACKSLASHED_CMAKE_BINARY_DIR ${CMAKE_BINARY_DIR})
|
||||
string(REGEX REPLACE "/" "\\\\" BACKSLASHED_CMAKE_SOURCE_DIR ${CMAKE_SOURCE_DIR})
|
||||
else ()
|
||||
add_executable(${APP_PROJECT_NAME} ${APP_FILES})
|
||||
endif ()
|
||||
@@ -832,7 +902,7 @@ if (UNIX)
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/bin/app/user" "${CMAKE_BINARY_DIR}/app/user"
|
||||
COMMAND "${CMAKE_COMMAND}" "-E" "create_symlink" "${CMAKE_SOURCE_DIR}/bin/test/data" "${CMAKE_BINARY_DIR}/test/data"
|
||||
)
|
||||
elseif(WIN32)
|
||||
elseif (WIN32)
|
||||
foreach(OUTPUTCONFIG ${CMAKE_CONFIGURATION_TYPES})
|
||||
if (EXISTS "${BACKSLASHED_CMAKE_BINARY_DIR}\\${OUTPUTCONFIG}")
|
||||
execute_process(
|
||||
|
||||
@@ -142,9 +142,9 @@ Building Sourcetrail requires several dependencies to be in place on your machin
|
||||
|
||||
### Required dependencies
|
||||
|
||||
* __LLVM/Clang 10.0.0__
|
||||
* __LLVM/Clang 11.0.0__
|
||||
* __Reason__: Used for running the preprocessor on the indexedes source code, building and traversing an Abstract Syntax Tree and generating error messages.
|
||||
* __Building__: Make sure to check out the correct tag: `git checkout llvmorg-10.0.0`
|
||||
* __Building__: Make sure to check out the correct tag: `git checkout llvmorg-11.0.0`
|
||||
* __Building for Windows__: Follow [these steps](https://clang.llvm.org/get_started.html) to build the project. Run the cmake command exactly as described.
|
||||
* __Building for Unix__: Follow this [installation guide](http://clang.llvm.org/docs/LibASTMatchersTutorial.html) to build the project. Make sure to build with `-DLLVM_ENABLE_RTTI=ON`.
|
||||
|
||||
@@ -188,7 +188,7 @@ Building Sourcetrail requires several dependencies to be in place on your machin
|
||||
|
||||
### Required Tools
|
||||
|
||||
* __WinRAR (required for Windows)__
|
||||
* __7z (required for Windows)__
|
||||
* __REASON__: Used to extract the prebuilt SourcetrailPythonIndexer which is downloaded automatically during build execution.
|
||||
|
||||
### Building
|
||||
|
||||
+13
-9
@@ -11,11 +11,11 @@ Sponsors [via Patreon](https://www.patreon.com/sourcetrail).
|
||||
## Super Coatis
|
||||
|
||||
* Alexis Jeandet
|
||||
* Anthony Marchini
|
||||
* Anshu Mathur
|
||||
* Chris Morley
|
||||
* Konstantin Kirenko
|
||||
* Louis St-Amour
|
||||
* Mario Lioni
|
||||
* Simon Pintarelli
|
||||
* William Wold
|
||||
|
||||
## Regular Coatis
|
||||
|
||||
@@ -24,19 +24,25 @@ Sponsors [via Patreon](https://www.patreon.com/sourcetrail).
|
||||
* Anton
|
||||
* Bicakci, Inc.
|
||||
* BJ
|
||||
* Dio Lee
|
||||
* Ferenc Fejes
|
||||
* Frederic Simonis
|
||||
* Friedrich Hunstock
|
||||
* Graydon Hoare
|
||||
* IndustrialRobot
|
||||
* Jason Stevens
|
||||
* John Borland
|
||||
* kale
|
||||
* Kikuchi Takanori
|
||||
* MangerDesPates
|
||||
* Matěj Týč
|
||||
* Max Bruckner
|
||||
* Michael F. Schönitzer
|
||||
* Nakul Dhotre
|
||||
* Nathan
|
||||
* Nathan Loofbourrow
|
||||
* Neil Horlock
|
||||
* Nick Moore
|
||||
* Nils Moehrle
|
||||
* Pierre Fransson
|
||||
* Rémi Cohen-Scali
|
||||
* Rui Pires
|
||||
* Ryo Koyama
|
||||
* Simon
|
||||
@@ -44,12 +50,10 @@ Sponsors [via Patreon](https://www.patreon.com/sourcetrail).
|
||||
* Stephan Roslen
|
||||
* Thorsten Dahlheimer
|
||||
* Tomi Joki-Korpela
|
||||
* Tony Hong
|
||||
* Traxes
|
||||
* Werner de Groot
|
||||
* X. Xu
|
||||
* Yacob Cohen-Arazi
|
||||
* Yang, Wenbo
|
||||
* 勇男 金子
|
||||
* 郝晨煜
|
||||
|
||||
_Note: This file will be updated at the beginning of each month._
|
||||
|
||||
+24
-19
@@ -2,26 +2,27 @@ version: 0.0.0.{build}
|
||||
image: Visual Studio 2017
|
||||
|
||||
install:
|
||||
############################################################################
|
||||
# Install Ninja
|
||||
############################################################################
|
||||
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip"
|
||||
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
|
||||
- 7z x ninja.zip -oC:\projects\deps\ninja > nul
|
||||
- set PATH=C:\projects\deps\ninja;%PATH%
|
||||
- ninja --version
|
||||
############################################################################
|
||||
# Install Ninja
|
||||
############################################################################
|
||||
- set NINJA_URL="https://github.com/ninja-build/ninja/releases/download/v1.9.0/ninja-win.zip"
|
||||
- appveyor DownloadFile %NINJA_URL% -FileName ninja.zip
|
||||
- 7z x ninja.zip -oC:\projects\deps\ninja > nul
|
||||
- set PATH=C:\projects\deps\ninja;%PATH%
|
||||
- ninja --version
|
||||
# Install SWIG by Choco
|
||||
- ps: choco install -y --no-progress swig --version 4.0.1
|
||||
|
||||
before_build:
|
||||
- choco install winrar -y
|
||||
- SET "PATH=%PATH%;C:\Program Files\WinRAR"
|
||||
- git submodule init
|
||||
- git submodule update
|
||||
- cd submodules/SourcetrailPythonIndexer
|
||||
- git submodule init
|
||||
- git submodule update
|
||||
- cd ../..
|
||||
- mkdir build
|
||||
- cd build
|
||||
- mkdir temp
|
||||
- cd ../
|
||||
- cd script
|
||||
- cmd: "\"C:/Program Files/Git/usr/bin/bash.exe\" download_python_indexer.sh"
|
||||
- cd ../
|
||||
- cd build
|
||||
- mkdir win64
|
||||
- cd win64
|
||||
- call "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvarsall.bat" amd64
|
||||
@@ -33,7 +34,11 @@ build_script:
|
||||
- ninja
|
||||
- cd ../../
|
||||
|
||||
test_script:
|
||||
- cd bin/test
|
||||
- ..\..\build\win64\Release\test\Sourcetrail_test.exe
|
||||
- cd ../../
|
||||
artifacts:
|
||||
- path: bin
|
||||
name: bin
|
||||
type: zip
|
||||
- path: build
|
||||
name: build
|
||||
type: zip
|
||||
|
||||
@@ -234,7 +234,7 @@
|
||||
<include></include>
|
||||
<macro_use></macro_use>
|
||||
|
||||
<aggregation></aggregation>
|
||||
<bundled_edges></bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -499,7 +499,7 @@
|
||||
<macro_use>#4E82F6</macro_use>
|
||||
<annotation_use>#4E82F6</annotation_use>
|
||||
|
||||
<aggregation>#666666</aggregation>
|
||||
<bundled_edges>#666666</bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -467,7 +467,7 @@
|
||||
<macro_use>#719660</macro_use>
|
||||
<annotation_use>#719660</annotation_use>
|
||||
|
||||
<aggregation>#CCC</aggregation>
|
||||
<bundled_edges>#CCC</bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
@@ -470,7 +470,7 @@
|
||||
<macro_use>#247368</macro_use>
|
||||
<annotation_use>#247368</annotation_use>
|
||||
|
||||
<aggregation>#4D4D4D</aggregation>
|
||||
<bundled_edges>#4D4D4D</bundled_edges>
|
||||
</edge>
|
||||
</graph>
|
||||
|
||||
|
||||
+15
-6
@@ -1,6 +1,15 @@
|
||||
SourceFilePath: "src/a.txt"
|
||||
Custom Command: "echo "Hello World""
|
||||
SourceFilePath: "src/b.txt"
|
||||
Custom Command: "echo "Hello World""
|
||||
SourceFilePath: "src/included/a.txt"
|
||||
Custom Command: "echo "Hello World""
|
||||
IndexerCommandCustom
|
||||
SourceFilePath: "src/a.txt"
|
||||
Custom Command: "echo"
|
||||
Arguments:
|
||||
"Hello World"
|
||||
IndexerCommandCustom
|
||||
SourceFilePath: "src/b.txt"
|
||||
Custom Command: "echo"
|
||||
Arguments:
|
||||
"Hello World"
|
||||
IndexerCommandCustom
|
||||
SourceFilePath: "src/included/a.txt"
|
||||
Custom Command: "echo"
|
||||
Arguments:
|
||||
"Hello World"
|
||||
|
||||
@@ -2,6 +2,8 @@ SourceFilePath: "src/Test.c"
|
||||
IndexedPath: "src"
|
||||
CompilerFlag: "--target=test_arch-test_vendor-test_sys-test_abi"
|
||||
CompilerFlag: "-std=c11"
|
||||
CompilerFlag: "-x"
|
||||
CompilerFlag: "c"
|
||||
CompilerFlag: "-isystem"
|
||||
CompilerFlag: "src"
|
||||
CompilerFlag: "-isystem"
|
||||
|
||||
@@ -2,6 +2,8 @@ SourceFilePath: "src/Test.c"
|
||||
IndexedPath: "src"
|
||||
CompilerFlag: "--target=test_arch-test_vendor-test_sys-test_abi"
|
||||
CompilerFlag: "-std=c11"
|
||||
CompilerFlag: "-x"
|
||||
CompilerFlag: "c"
|
||||
CompilerFlag: "-isystem"
|
||||
CompilerFlag: "data/cxx/include/"
|
||||
CompilerFlag: "-isystem"
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -18,7 +18,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
<dependency>
|
||||
<groupId>junit</groupId>
|
||||
<artifactId>junit</artifactId>
|
||||
<version>3.8.1</version>
|
||||
<version>4.13.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
@@ -55,7 +55,7 @@ make -j8 && \
|
||||
make -j8 install && rm -Rf /qt
|
||||
|
||||
# LLVM/Clang
|
||||
ARG LLVM_VERSION=10.0.0
|
||||
ARG LLVM_VERSION=11.0.0
|
||||
RUN mkdir -p /llvm && cd /llvm && \
|
||||
wget https://github.com/llvm/llvm-project/releases/download/llvmorg-${LLVM_VERSION}/llvm-project-${LLVM_VERSION}.tar.xz && \
|
||||
tar xvf llvm-project-${LLVM_VERSION}.tar.xz && \
|
||||
|
||||
@@ -6,7 +6,7 @@ based on our gcc Docker images
|
||||
Software
|
||||
--------
|
||||
|
||||
* Qt 5.9.1
|
||||
* LLVM/Clang 5.0.0
|
||||
* Boost 1.64.0
|
||||
* Qt 5.12.6
|
||||
* LLVM/Clang 10.0.0
|
||||
* Boost 1.67.0
|
||||
* Ninja
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Base 64 bit Image for Sourcetrail
|
||||
=================================
|
||||
|
||||
Based on centos:6
|
||||
Based on centos:7
|
||||
|
||||
Software
|
||||
--------
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<config>
|
||||
<application>
|
||||
<window_base_width>500</window_base_width>
|
||||
<window_base_height>500</window_base_height>
|
||||
</application>
|
||||
<indexing>
|
||||
<java>
|
||||
<java_path>/usr/lib/jvm/java-1.8.0-openjdk-1.8.0.272.b10-1.el7_9.x86_64/jre/lib/amd64/server/libjvm.so</java_path>
|
||||
</java>
|
||||
<indexer_thread_count>0</indexer_thread_count>
|
||||
</indexing>
|
||||
<user>
|
||||
<recent_projects>
|
||||
<recent_project>./projects/tutorial/tutorial.srctrlprj</recent_project>
|
||||
<recent_project>./projects/tictactoe_cpp/tictactoe_cpp.srctrlprj</recent_project>
|
||||
<recent_project>./projects/tictactoe_py/tictactoe_py.srctrlprj</recent_project>
|
||||
<recent_project>./projects/javaparser/javaparser.srctrlprj</recent_project>
|
||||
</recent_projects>
|
||||
</user>
|
||||
<version>8</version>
|
||||
</config>
|
||||
@@ -1,4 +1,12 @@
|
||||
FROM coatisoftware/centos7_64_qt_llvm:qt5126-llvm1000
|
||||
FROM coatisoftware/centos7_64_qt_llvm:qt5126-llvm1100
|
||||
|
||||
WORKDIR /home/builder
|
||||
|
||||
RUN mkdir .config && \
|
||||
cd .config && \
|
||||
mkdir sourcetrail
|
||||
|
||||
COPY ApplicationSettings.xml /home/builder/.config/sourcetrail/ApplicationSettings.xml
|
||||
|
||||
COPY entrypoint.sh /entrypoint.sh
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ VERSION_STRING="${VERSION_STRING//_/.}"
|
||||
VERSION_STRING="${VERSION_STRING:2}"
|
||||
echo "installer version is $VERSION_STRING"
|
||||
|
||||
PRODUCT_GUID=$(cmd.exe /c "uuidgen")
|
||||
PRODUCT_GUID=$("uuidgen")
|
||||
if [ -z "$PRODUCT_GUID" ]; then
|
||||
echo "Unable to generate GUID. Make sure to run this script from the Visual Studio command propmt. Aborting now."
|
||||
exit 1
|
||||
|
||||
|
Before Width: | Height: | Size: 12 KiB After Width: | Height: | Size: 12 KiB |
@@ -76,7 +76,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" style="text-align:center; margin-top: 10px;">
|
||||
<p>Documentation for version 2020.1</p>
|
||||
<p>Documentation for version 2020.2</p>
|
||||
</div>
|
||||
|
||||
<div class="row" style="height:20px;"></div>
|
||||
@@ -100,21 +100,21 @@
|
||||
<li><strong>Code:</strong> The Code view displays all source locations of the currently selected symbol in a list of code snippets. Clicking on a different source location allows you to change the selection and dig deeper.</li>
|
||||
</ul>
|
||||
|
||||
<p>Note: Sourcetrail currently supports the languages C/C++ and Java. Much of the UI design is therefore based on these languages and might change as soon as other languages are supported. For more information have a look at <a href="#SupportedLanguages">supported languages</a>.</p>
|
||||
<p>Note: Sourcetrail currently supports the languages C/C++, Java and Python. Much of the UI design is therefore based on these languages and might change as soon as other languages are supported. For more information have a look at <a href="#SupportedLanguages">supported languages</a>.</p>
|
||||
|
||||
|
||||
<h2>Supported Languages</h2>
|
||||
<h3>C</h3>
|
||||
<p>C support is powered by <a href="https://clang.llvm.org/" target="_blank">Clang 8.0.1</a>. For issues loading C code, please have a look at <a href="https://clang.llvm.org/compatibility.html" target="_blank">Clang language compatibility</a> or report a bug in our <a href="https://github.com/CoatiSoftware/SourcetrailBugTracker">bug tracker</a>.</p>
|
||||
<p>C support is powered by <a href="https://clang.llvm.org/" target="_blank">Clang 11.0.0</a>. For issues loading C code, please have a look at <a href="https://clang.llvm.org/compatibility.html" target="_blank">Clang language compatibility</a> or report a bug in our <a href="https://github.com/CoatiSoftware/SourcetrailBugTracker">bug tracker</a>.</p>
|
||||
|
||||
<h3>C++</h3>
|
||||
<p>C++ support is powered by <a href="https://clang.llvm.org/" target="_blank">Clang 8.0.1</a>. For more Information please visit <a href="https://clang.llvm.org/cxx_status.html" target="_blank">Clang C++ Status</a>. For issues loading C++ code, please have a look at <a href="https://clang.llvm.org/compatibility.html" target="_blank">Clang language compatibility</a> or report a bug in our <a href="https://github.com/CoatiSoftware/SourcetrailBugTracker">bug tracker</a>.</p>
|
||||
<p>C++ support is powered by <a href="https://clang.llvm.org/" target="_blank">Clang 11.0.0</a>. For more Information please visit <a href="https://clang.llvm.org/cxx_status.html" target="_blank">Clang C++ Status</a>. For issues loading C++ code, please have a look at <a href="https://clang.llvm.org/compatibility.html" target="_blank">Clang language compatibility</a> or report a bug in our <a href="https://github.com/CoatiSoftware/SourcetrailBugTracker">bug tracker</a>.</p>
|
||||
|
||||
<h3>Java</h3>
|
||||
<p>Sourcetrail includes support for Java 10 and lower which is powered by <a href="https://github.com/eclipse/eclipse.jdt.core" target="_blank">Eclipse JDT</a>. If you encounter any issues while using Sourcetrail on a Java project, please let us know by providing a minimal example in our <a href="https://github.com/CoatiSoftware/SourcetrailBugTracker">bug tracker</a>.</p>
|
||||
<p>Sourcetrail includes support for Java 12 and lower which is powered by <a href="https://github.com/eclipse/eclipse.jdt.core" target="_blank">Eclipse JDT</a>. If you encounter any issues while using Sourcetrail on a Java project, please let us know by providing a minimal example in our <a href="https://github.com/CoatiSoftware/SourcetrailBugTracker">bug tracker</a>.</p>
|
||||
|
||||
<h3>Python</h3>
|
||||
<p>Sourcetrail includes beta support for Python 2 and Python 3 which is powered by our open-source <a href="https://github.com/CoatiSoftware/SourcetrailPythonIndexer" target="_blank">SourcetrailPythonIndexer</a>. If you encounter any issues while using Sourcetrail on a Python project, please let us know by providing a minimal example in our <a href="https://github.com/CoatiSoftware/SourcetrailPythonIndexer/issues">bug tracker</a>.</p>
|
||||
<p>Sourcetrail includes support for Python 2 and Python 3 which is powered by our open-source <a href="https://github.com/CoatiSoftware/SourcetrailPythonIndexer" target="_blank">SourcetrailPythonIndexer</a>. If you encounter any issues while using Sourcetrail on a Python project, please let us know by providing a minimal example in our <a href="https://github.com/CoatiSoftware/SourcetrailPythonIndexer/issues">bug tracker</a>.</p>
|
||||
|
||||
|
||||
<div class="row" style="height:80px;"></div>
|
||||
@@ -354,7 +354,7 @@
|
||||
|
||||
<ul>
|
||||
<li><strong>Nodes:</strong> All named symbols in your source code will be displayed as different <a href="#Nodes">nodes</a>, such as <var>functions</var>, <var>classes</var> or <var>files</var>. Nodes with members (like <var>classes</var>) can be expanded to show all their contents, the number at the expansion arrow shows how many members are hidden. Clicking a node will activate it and update all the views to the new selection. Dragging a node can be used to change its position.</li>
|
||||
<li><strong>Edges:</strong> The relationships between the symbols are displayed as different <a href="#Edges">edges</a>, such as <var>type use</var>, <var>function call</var> or <var>file include</var>. Sometimes edges get bundled together and are displayed as an <var>aggregation</var> edge that shows a number of how many edges it contains. Clicking an edge will highlight its source location in the code view.</li>
|
||||
<li><strong>Edges:</strong> The relationships between the symbols are displayed as different <a href="#Edges">edges</a>, such as <var>type use</var>, <var>function call</var> or <var>file include</var>. Sometimes edges get bundled together and are displayed as <var>bundled edges</var> that show a number of how many edges are contained. Clicking an edge will highlight its source location in the code view.</li>
|
||||
</ul>
|
||||
|
||||
<div class="row">
|
||||
@@ -462,7 +462,11 @@
|
||||
<h3>Tarball</h3>
|
||||
<p>Download the <code>.tar.gz</code> file and extract it. To start Sourcetrail run the <code>Sourcetrail.sh</code> script. Sourcetrail creates a folder <code>~/.config/sourcetrail</code> at the first run, this is the folder for Sourcetrail settings.</p>
|
||||
|
||||
<p>To Install Sourcetrail run the <code>install.sh</code> script with <code>sudo</code>, it will install Sourcetrail to <code>/opt/sourcetrail</code> and create <code>/usr/bin/sourcetrail</code> symlink.</p>
|
||||
<h4>Install</h4>
|
||||
<p>To install Sourcetrail run the <code>install.sh</code> script with <code>sudo</code>. It will install Sourcetrail to <code>/opt/sourcetrail</code> and create the <code>/usr/bin/sourcetrail</code> symlink.</p>
|
||||
|
||||
<h4>Uninstall</h4>
|
||||
<p>To uninstall Sourcetrail run the <code>/opt/sourcetrail/uninstall.sh</code> script with <code>sudo</code>.</p>
|
||||
|
||||
<h3>AppImage</h3>
|
||||
<p>Download the <code>.AppImage</code> file. Give it permission to execute with <code>chmod a+x</code> or via the context menu. To start Sourcetrail double click it or execute it from the Terminal. Sourcetrail creates a folder <code>~/.config/sourcetrail</code> at the first run, this is the folder for Sourcetrail settings.</p>
|
||||
@@ -1509,13 +1513,18 @@
|
||||
|
||||
<strong>Context Menu:</strong>
|
||||
<ul>
|
||||
<li><b>Save As Image:</b> Export current graph as image file. Possible formats are <code>PNG</code>, <code>JPEG</code>, <code>BMP</code> and <code>SVG</code>.</li>
|
||||
<li><b>Open in New Tab:</b> Opens a new Tab with the node under the mouse cursor as active symbol.</li>
|
||||
<li><b>Back:</b> Go back in history.</li>
|
||||
<li><b>Forward:</b> Go forward in history.</li>
|
||||
<li><b>Show Definition:</b> Show the definition of the node under the mouse cursor in the <a href="#CodeView">Code View</a>.</li>
|
||||
<li><b>Show Definition in IDE:</b> Show the definition of the node under the mouse cursor using the connected <a href="#CodeEditorPlugins">Code Editor Plugin</a>.</li>
|
||||
<li><b>Expand Node:</b> Expand node under mouse cursor.</li>
|
||||
<li><b>Collapse Node:</b> Collapse node under mouse cursor.</li>
|
||||
<li><b>Show Definition:</b> Show the definition of the node under the mouse cursor in the <a href="#CodeView">Code View</a>.</li>
|
||||
<li><b>Hide Node:</b> Hide node under mouse cursor.</li>
|
||||
<li><b>Hide Edge:</b> Hide edge under mouse cursor.</li>
|
||||
<li><b>Bookmark Node:</b> Create a bookmark for node under mouse cursor.</li>
|
||||
<li><b>Save As Image:</b> Export current graph as image file. Possible formats are <code>PNG</code>, <code>JPEG</code>, <code>BMP</code> and <code>SVG</code>.</li>
|
||||
<li><b>Save To Clipboard:</b> Save current graph as <code>PNG</code> image to clipboard.</li>
|
||||
<li><b>Copy Name:</b> Copy name for node under mouse cursor to clipboard.</li>
|
||||
<li><b>Copy Full Path:</b> Copy file path for file node under mouse cursor to clipboard.</li>
|
||||
<li><b>Open Containing Folder:</b> Show the file in your file explorer for file node under mouse cursor.</li>
|
||||
@@ -1565,13 +1574,13 @@
|
||||
<tr> <th scope="row">Method Override</th> <td><img src="img/edge_override.png" style="height:240px;"></td> </tr>
|
||||
<tr> <th scope="row">Template Specialization & Template Argument Use</th> <td><img src="img/edge_template_param.png" style="height:100px;"></td> </tr>
|
||||
<tr> <th scope="row">Template Member Specialization</th> <td><img src="img/edge_template_member_specialization.png" style="height:160px;"></td> </tr>
|
||||
<tr> <th scope="row">Aggregation: <span style="font-weight:normal">Bundles multiple edges between the child nodes of the 2 nodes. The thickness gives an impression of how many edges are bundled. Hover the edge to get the number of bundled edges.</span></th> <td><img src="img/edge_aggregation.png" style="height:50px;"></td> </tr>
|
||||
<tr> <th scope="row">Bundled Edges: <span style="font-weight:normal">Bundles multiple edges between the child nodes of the 2 nodes. The thickness gives an impression of how many edges are bundled. Hover the edge to get the number of bundled edges.</span></th> <td><img src="img/edge_bundled_edges.png" style="height:50px;"></td> </tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<strong>Interactions:</strong>
|
||||
<ul>
|
||||
<li>Click an edge to see its location in the <a href="#CodeView">Code View</a>.</li>
|
||||
<li>Click an aggregation edge to activate all its corresponding edges.</li>
|
||||
<li>Click a bundled edges to activate all its corresponding edges.</li>
|
||||
<li>Hover an edge to see a tooltip that displays the edge’s type.</li>
|
||||
</ul>
|
||||
|
||||
@@ -2628,7 +2637,7 @@
|
||||
<li>CLion</li>
|
||||
<li>Eclipse</li>
|
||||
<li>Emacs</li>
|
||||
<li>IntelliJ IDEA</li>
|
||||
<li>IntelliJ IDEA (PyCharm, CLion, etc.)</li>
|
||||
<li>Qt Creator</li>
|
||||
<li>Sublime Text 2</li>
|
||||
<li>Sublime Text 3</li>
|
||||
|
||||
@@ -59,13 +59,8 @@ DOTTED_VERSION_STRING="${VERSION_STRING//_/.}"
|
||||
|
||||
|
||||
if [ $RUN_CODE_SIGNING = true ]; then
|
||||
echo -e "$INFO Code signing is enabled. provide the key file path >"
|
||||
read CODE_SIGNING_KEY_FILE
|
||||
fi
|
||||
|
||||
if [ $RUN_CODE_SIGNING = true ]; then
|
||||
echo -e "$INFO Code signing is enabled. Please enter your password >"
|
||||
read CODE_SIGNING_PASSWORD
|
||||
echo -e "$INFO Code signing is enabled. provide the key's sh1 thumbprint >"
|
||||
read CODE_SIGNING_THUMBPRINT
|
||||
fi
|
||||
|
||||
|
||||
@@ -94,13 +89,13 @@ echo -e "$INFO Building the project"
|
||||
|
||||
if [ $RUN_CODE_SIGNING = true ]; then
|
||||
echo -e "$INFO Signing the app"
|
||||
signtool.exe sign //f $CODE_SIGNING_KEY_FILE //p $CODE_SIGNING_PASSWORD //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail ${DOTTED_VERSION_STRING}" //du "https://www.sourcetrail.com/" //v build/Release/app/Sourcetrail.exe
|
||||
signtool.exe sign //sha1 $CODE_SIGNING_THUMBPRINT //fd sha256 //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail ${DOTTED_VERSION_STRING}" //du "https://www.sourcetrail.com/" //v build/Release/app/Sourcetrail.exe
|
||||
|
||||
echo -e "$INFO Signing the indexer"
|
||||
signtool.exe sign //f $CODE_SIGNING_KEY_FILE //p $CODE_SIGNING_PASSWORD //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail Indexer ${DOTTED_VERSION_STRING}" //du "https://www.sourcetrail.com/" //v build/Release/app/sourcetrail_indexer.exe
|
||||
signtool.exe sign //sha1 $CODE_SIGNING_THUMBPRINT //fd sha256 //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail Indexer ${DOTTED_VERSION_STRING}" //du "https://www.sourcetrail.com/" //v build/Release/app/sourcetrail_indexer.exe
|
||||
|
||||
echo -e "$INFO Signing the Python indexer"
|
||||
signtool.exe sign //f $CODE_SIGNING_KEY_FILE //p $CODE_SIGNING_PASSWORD //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail Python Indexer" //du "https://github.com/CoatiSoftware/SourcetrailPythonIndexer" //v bin/app/data/python/SourcetrailPythonIndexer.exe
|
||||
signtool.exe sign //sha1 $CODE_SIGNING_THUMBPRINT //fd sha256 //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail Python Indexer" //du "https://github.com/CoatiSoftware/SourcetrailPythonIndexer" //v bin/app/data/python/SourcetrailPythonIndexer.exe
|
||||
fi
|
||||
|
||||
|
||||
@@ -156,7 +151,7 @@ cd ../../..
|
||||
|
||||
if [ $RUN_CODE_SIGNING = true ]; then
|
||||
echo -e "$INFO Signing the 64 bit windows installer"
|
||||
signtool.exe sign //f $CODE_SIGNING_KEY_FILE //p $CODE_SIGNING_PASSWORD //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail ${DOTTED_VERSION_STRING} Installer" //du "https://www.sourcetrail.com/" //v deployment/windows/wixSetup/bin/sourcetrail.msi
|
||||
signtool.exe sign //sha1 $CODE_SIGNING_THUMBPRINT //fd sha256 //t "http://timestamp.verisign.com/scripts/timstamp.dll" //d "Sourcetrail ${DOTTED_VERSION_STRING} Installer" //du "https://www.sourcetrail.com/" //v deployment/windows/wixSetup/bin/sourcetrail.msi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
@@ -1,101 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
SOURCETRAIL_PYTHON_INDEXER_VERSION="v1_db25_p4"
|
||||
|
||||
# Determine current platform
|
||||
PLATFORM='unknown'
|
||||
if [ "$(uname)" == "Darwin" ]; then
|
||||
PLATFORM='osx'
|
||||
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||
PLATFORM='linux'
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
||||
PLATFORM='windows'
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
||||
PLATFORM='windows'
|
||||
elif [ "$OSTYPE" == "msys" ]; then
|
||||
PLATFORM='windows'
|
||||
fi
|
||||
|
||||
PACKAGE_NAME="SourcetrailPythonIndexer_${SOURCETRAIL_PYTHON_INDEXER_VERSION}-${PLATFORM}"
|
||||
PACKAGE_FILE_NAME="${PACKAGE_NAME}.zip"
|
||||
PACKAGE_URL="https://github.com/CoatiSoftware/SourcetrailPythonIndexer/releases/download/${SOURCETRAIL_PYTHON_INDEXER_VERSION}/${PACKAGE_FILE_NAME}"
|
||||
TEMP_PATH="build/temp"
|
||||
TARGET_PATH="bin/app/data/python"
|
||||
|
||||
|
||||
ABORT="\033[31mAbort:\033[00m"
|
||||
SUCCESS="\033[32mSuccess:\033[00m"
|
||||
INFO="\033[33mInfo:\033[00m"
|
||||
|
||||
if [ $PLATFORM == "windows" ]; then
|
||||
SCRIPT=`realpath $0`
|
||||
if [ "$SCRIPT" == "" ]; then
|
||||
|
||||
ORIGINAL_PATH_TO_SCRIPT="${0}"
|
||||
CLEANED_PATH_TO_SCRIPT="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
|
||||
SCRIPT_DIR=${CLEANED_PATH_TO_SCRIPT%/*}
|
||||
else
|
||||
ORIGINAL_PATH_TO_SCRIPT=`dirname $SCRIPT`
|
||||
SCRIPT_DIR="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
|
||||
fi
|
||||
else
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
fi
|
||||
|
||||
echo "This script is running in: $SCRIPT_DIR"
|
||||
|
||||
|
||||
# Enter main directory
|
||||
cd $SCRIPT_DIR/
|
||||
cd ..
|
||||
|
||||
BINARY_PATH="$TARGET_PATH/SourcetrailPythonIndexer"
|
||||
if [ $PLATFORM == "windows" ]; then
|
||||
BINARY_PATH="${BINARY_PATH}.exe"
|
||||
fi
|
||||
|
||||
if [ -e "${BINARY_PATH}" ]; then
|
||||
echo -e $INFO "SourcetrailPythonIndexer already exists, checking version..."
|
||||
|
||||
INSTALLED_VERSION="$(${BINARY_PATH} --version)"
|
||||
INSTALLED_VERSION=${INSTALLED_VERSION#* }
|
||||
INSTALLED_VERSION="${INSTALLED_VERSION//./$'_'}"
|
||||
|
||||
if [ "$INSTALLED_VERSION" == "$SOURCETRAIL_PYTHON_INDEXER_VERSION" ]; then
|
||||
echo -e $INFO "Nothing to update. Target version of SourcetrailPythonIndexer is already installed."
|
||||
exit
|
||||
fi
|
||||
fi
|
||||
|
||||
mkdir -p $TEMP_PATH
|
||||
|
||||
echo -e $INFO "starting to download $PACKAGE_FILE_NAME"
|
||||
|
||||
if [ $PLATFORM == "linux" ]; then
|
||||
wget -O $TEMP_PATH/$PACKAGE_FILE_NAME $PACKAGE_URL
|
||||
elif [ $PLATFORM == "osx" ]; then
|
||||
wget -O $TEMP_PATH/$PACKAGE_FILE_NAME $PACKAGE_URL
|
||||
elif [ $PLATFORM == "windows" ]; then
|
||||
certutil.exe -urlcache -split -f $PACKAGE_URL $TEMP_PATH/$PACKAGE_FILE_NAME
|
||||
fi
|
||||
|
||||
echo -e $INFO "finished downloading $PACKAGE_FILE_NAME"
|
||||
|
||||
|
||||
if [ $PLATFORM == "linux" ]; then
|
||||
unzip -d $TEMP_PATH $TEMP_PATH/$PACKAGE_FILE_NAME
|
||||
elif [ $PLATFORM == "osx" ]; then
|
||||
unzip -d $TEMP_PATH $TEMP_PATH/$PACKAGE_FILE_NAME
|
||||
elif [ $PLATFORM == "windows" ]; then
|
||||
winrar x $TEMP_PATH/$PACKAGE_FILE_NAME $TEMP_PATH
|
||||
fi
|
||||
|
||||
|
||||
echo -e $INFO "clearing $TARGET_PATH"
|
||||
rm -rf $TARGET_PATH
|
||||
mkdir -p $TARGET_PATH
|
||||
cp -r $TEMP_PATH/$PACKAGE_NAME/* $TARGET_PATH
|
||||
|
||||
|
||||
echo -e $INFO "clearing temporary data at $TEMP_PATH"
|
||||
rm -rf $TEMP_PATH
|
||||
@@ -0,0 +1,70 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Determine current platform
|
||||
PLATFORM='unknown'
|
||||
if [ "$(uname)" == "Darwin" ]; then
|
||||
PLATFORM='osx'
|
||||
elif [ "$(expr substr $(uname -s) 1 5)" == "Linux" ]; then
|
||||
PLATFORM='linux'
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW32_NT" ]; then
|
||||
PLATFORM='windows'
|
||||
elif [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
|
||||
PLATFORM='windows'
|
||||
elif [ "$OSTYPE" == "msys" ]; then
|
||||
PLATFORM='windows'
|
||||
fi
|
||||
|
||||
INPUT_DIR="submodules/SourcetrailPythonIndexer"
|
||||
OUTPUT_DIR="bin/app/data/python/indexer"
|
||||
|
||||
ABORT="\033[31mAbort:\033[00m"
|
||||
SUCCESS="\033[32mSuccess:\033[00m"
|
||||
INFO="\033[33mInfo:\033[00m"
|
||||
|
||||
if [ $PLATFORM == "windows" ]; then
|
||||
SCRIPT=`realpath $0`
|
||||
if [ "$SCRIPT" == "" ]; then
|
||||
|
||||
ORIGINAL_PATH_TO_SCRIPT="${0}"
|
||||
CLEANED_PATH_TO_SCRIPT="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
|
||||
SCRIPT_DIR=${CLEANED_PATH_TO_SCRIPT%/*}
|
||||
else
|
||||
ORIGINAL_PATH_TO_SCRIPT=`dirname $SCRIPT`
|
||||
SCRIPT_DIR="${ORIGINAL_PATH_TO_SCRIPT//\\//}"
|
||||
fi
|
||||
else
|
||||
SCRIPT_DIR="$( cd "$( dirname "$0" )" && pwd )"
|
||||
fi
|
||||
|
||||
echo "This script is running in: $SCRIPT_DIR"
|
||||
|
||||
# Enter main directory
|
||||
cd $SCRIPT_DIR/
|
||||
cd ..
|
||||
|
||||
echo "create $OUTPUT_DIR"
|
||||
if [ $PLATFORM == "windows" ]; then
|
||||
mkdir "$OUTPUT_DIR"
|
||||
dir
|
||||
mkdir bin
|
||||
cd bin
|
||||
mkdir app
|
||||
cd app
|
||||
mkdir data
|
||||
cd data
|
||||
mkdir python
|
||||
cd python
|
||||
dir
|
||||
mkdir indexer
|
||||
cd ../../../../
|
||||
else
|
||||
mkdir -p $OUTPUT_DIR
|
||||
fi
|
||||
|
||||
echo "Copy python indexer files to $OUTPUT_DIR"
|
||||
cp $INPUT_DIR/_version.py $OUTPUT_DIR
|
||||
cp $INPUT_DIR/run.py $OUTPUT_DIR
|
||||
cp $INPUT_DIR/indexer.py $OUTPUT_DIR
|
||||
cp $INPUT_DIR/shallow_indexer.py $OUTPUT_DIR
|
||||
|
||||
echo "Done updating Python indexer"
|
||||
@@ -19,4 +19,4 @@ export QT_QPA_FONTDIR="$SOURCETRAIL_PATH/data/fonts:$QT_QPA_FONTDIR"
|
||||
export SOURCETRAIL_VIA_SCRIPT=1
|
||||
export OPENSSL_CONF=/etc/ssl/
|
||||
|
||||
exec "$SOURCETRAIL_PATH/bin/sourcetrail" $@
|
||||
exec "$SOURCETRAIL_PATH/bin/sourcetrail" "$@"
|
||||
|
||||
@@ -10,3 +10,4 @@ Type=Application
|
||||
MimeType=application/x-sourcetrail;
|
||||
Categories=Development;
|
||||
StartupNotify=true
|
||||
StartupWMClass=Sourcetrail
|
||||
|
||||
@@ -147,8 +147,8 @@ add_files(
|
||||
data/graph/token_component/TokenComponentAbstraction.h
|
||||
data/graph/token_component/TokenComponentAccess.cpp
|
||||
data/graph/token_component/TokenComponentAccess.h
|
||||
data/graph/token_component/TokenComponentAggregation.cpp
|
||||
data/graph/token_component/TokenComponentAggregation.h
|
||||
data/graph/token_component/TokenComponentBundledEdges.cpp
|
||||
data/graph/token_component/TokenComponentBundledEdges.h
|
||||
data/graph/token_component/TokenComponentConst.cpp
|
||||
data/graph/token_component/TokenComponentConst.h
|
||||
data/graph/token_component/TokenComponentFilePath.cpp
|
||||
@@ -489,6 +489,7 @@ add_files(
|
||||
utility/messaging/type/graph/MessageGraphNodeHide.h
|
||||
utility/messaging/type/graph/MessageGraphNodeMove.h
|
||||
utility/messaging/type/graph/MessageScrollGraph.h
|
||||
utility/messaging/type/graph/MessageSaveAsImage.h
|
||||
|
||||
utility/messaging/type/history/MessageHistoryToPosition.h
|
||||
utility/messaging/type/history/MessageHistoryRedo.h
|
||||
|
||||
@@ -37,12 +37,22 @@ FilePath ResourcePaths::getJavaPath()
|
||||
return AppPath::getSharedDataPath().concatenate(L"data/java/");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getPythonPath()
|
||||
FilePath ResourcePaths::getPythonEnvironmentFilePath()
|
||||
{
|
||||
return AppPath::getSharedDataPath().concatenate(L"data/python/");
|
||||
return ResourcePaths::getPythonPath().concatenate(L"environment/Scripts/python");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getPythonIndexerFilePath()
|
||||
{
|
||||
return ResourcePaths::getPythonPath().concatenate(L"indexer/run.py");
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getCxxCompilerHeaderPath()
|
||||
{
|
||||
return AppPath::getSharedDataPath().concatenate(L"data/cxx/include/").getCanonical();
|
||||
}
|
||||
|
||||
FilePath ResourcePaths::getPythonPath()
|
||||
{
|
||||
return AppPath::getSharedDataPath().concatenate(L"data/python/");
|
||||
}
|
||||
|
||||
@@ -15,8 +15,12 @@ public:
|
||||
static FilePath getGuiPath();
|
||||
static FilePath getLicensePath();
|
||||
static FilePath getJavaPath();
|
||||
static FilePath getPythonPath();
|
||||
static FilePath getPythonEnvironmentFilePath();
|
||||
static FilePath getPythonIndexerFilePath();
|
||||
static FilePath getCxxCompilerHeaderPath();
|
||||
|
||||
private:
|
||||
static FilePath getPythonPath();
|
||||
};
|
||||
|
||||
#endif // RESOURCE_PATHS_H
|
||||
|
||||
@@ -24,12 +24,12 @@ void ActivationController::clear() {}
|
||||
|
||||
void ActivationController::handleMessage(MessageActivateEdge* message)
|
||||
{
|
||||
if (message->isAggregation())
|
||||
if (message->isBundledEdges())
|
||||
{
|
||||
MessageActivateTokens m(message);
|
||||
m.tokenIds = message->aggregationIds;
|
||||
m.tokenIds = message->bundledEdgesIds;
|
||||
m.setKeepContent(false);
|
||||
m.isAggregation = true;
|
||||
m.isBundledEdges = true;
|
||||
m.dispatchImmediately();
|
||||
}
|
||||
else
|
||||
|
||||
@@ -209,10 +209,10 @@ void BookmarkController::activateBookmark(const std::shared_ptr<Bookmark> bookma
|
||||
else
|
||||
{
|
||||
MessageActivateEdge activateEdge(
|
||||
0, Edge::EdgeType::EDGE_AGGREGATION, sourceName, targetName);
|
||||
for (const Id aggregatedEdgeId: edgeBookmark->getEdgeIds())
|
||||
0, Edge::EdgeType::EDGE_BUNDLED_EDGES, sourceName, targetName);
|
||||
for (const Id bundledEdgeId: edgeBookmark->getEdgeIds())
|
||||
{
|
||||
activateEdge.aggregationIds.push_back(aggregatedEdgeId);
|
||||
activateEdge.bundledEdgesIds.push_back(bundledEdgeId);
|
||||
}
|
||||
activateEdge.dispatch();
|
||||
}
|
||||
@@ -318,7 +318,7 @@ void BookmarkController::handleMessage(MessageActivateTokens* message)
|
||||
Id tabId = message->getSchedulerId();
|
||||
m_activeEdgeIds[tabId].clear();
|
||||
|
||||
if (message->isEdge || message->isAggregation)
|
||||
if (message->isEdge || message->isBundledEdges)
|
||||
{
|
||||
m_activeEdgeIds[tabId] = message->tokenIds;
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ void CodeController::handleMessage(MessageActivateTokens* message)
|
||||
params.clearSnippets = true;
|
||||
|
||||
Id declarationId = 0; // 0 means that no token is found.
|
||||
if (!message->isAggregation)
|
||||
if (!message->isBundledEdges)
|
||||
{
|
||||
std::vector<Id> activeTokenIds;
|
||||
for (Id tokenId: params.activeTokenIds)
|
||||
|
||||
@@ -98,7 +98,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
if (message->isEdge || message->keepContent())
|
||||
{
|
||||
m_activeEdgeIds = message->tokenIds;
|
||||
if (message->isAggregation) // only on redo
|
||||
if (message->isBundledEdges) // only on redo
|
||||
{
|
||||
m_activeEdgeIds.clear();
|
||||
}
|
||||
@@ -119,7 +119,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
getView()->activateEdge(edgeId);
|
||||
return;
|
||||
}
|
||||
else if (message->isAggregation)
|
||||
else if (message->isBundledEdges)
|
||||
{
|
||||
m_activeNodeIds.clear();
|
||||
m_activeEdgeIds = message->tokenIds;
|
||||
@@ -166,7 +166,7 @@ void GraphController::handleMessage(MessageActivateTokens* message)
|
||||
{
|
||||
bundleNodes();
|
||||
}
|
||||
else if (message->isAggregation)
|
||||
else if (message->isBundledEdges)
|
||||
{
|
||||
bool isInheritanceChain = true;
|
||||
for (const auto& edge: m_dummyEdges)
|
||||
@@ -489,22 +489,22 @@ void GraphController::handleMessage(MessageGraphNodeExpand* message)
|
||||
{
|
||||
std::shared_ptr<DummyEdge> edge = m_dummyEdges[i];
|
||||
|
||||
if (edge && edge->data && edge->data->isType(Edge::EDGE_AGGREGATION) &&
|
||||
if (edge && edge->data && edge->data->isType(Edge::EDGE_BUNDLED_EDGES) &&
|
||||
(edge->targetId == dummyNode->tokenId || edge->ownerId == dummyNode->tokenId))
|
||||
{
|
||||
std::vector<Id> aggregationIds = utility::toVector<Id>(
|
||||
edge->data->getComponent<TokenComponentAggregation>()->getAggregationIds());
|
||||
std::vector<Id> bundledEdgesIds = utility::toVector<Id>(
|
||||
edge->data->getComponent<TokenComponentBundledEdges>()->getBundledEdgesIds());
|
||||
|
||||
if (m_graph->getEdgeById(aggregationIds[0]) != nullptr)
|
||||
if (m_graph->getEdgeById(bundledEdgesIds[0]) != nullptr)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
std::shared_ptr<Graph> aggregationGraph =
|
||||
std::shared_ptr<Graph> bundledEdgesGraph =
|
||||
m_storageAccess->getGraphForActiveTokenIds(
|
||||
aggregationIds, std::vector<Id>());
|
||||
bundledEdgesIds, std::vector<Id>());
|
||||
|
||||
aggregationGraph->forEachEdge([this](Edge* e) {
|
||||
bundledEdgesGraph->forEachEdge([this](Edge* e) {
|
||||
if (!e->isType(Edge::EDGE_MEMBER))
|
||||
{
|
||||
m_dummyEdges.push_back(std::make_shared<DummyEdge>(
|
||||
@@ -1085,25 +1085,25 @@ void GraphController::bundleNodes()
|
||||
bundleInfo->isReferencing = false;
|
||||
}
|
||||
|
||||
if (e->isType(Edge::EDGE_AGGREGATION))
|
||||
if (e->isType(Edge::EDGE_BUNDLED_EDGES))
|
||||
{
|
||||
TokenComponentAggregation::Direction dir =
|
||||
e->getComponent<TokenComponentAggregation>()->getDirection();
|
||||
TokenComponentBundledEdges::Direction dir =
|
||||
e->getComponent<TokenComponentBundledEdges>()->getDirection();
|
||||
|
||||
if (dir == TokenComponentAggregation::DIRECTION_NONE)
|
||||
if (dir == TokenComponentBundledEdges::DIRECTION_NONE)
|
||||
{
|
||||
bundleInfo->isReferenced = true;
|
||||
bundleInfo->isReferencing = true;
|
||||
}
|
||||
else if (
|
||||
(dir == TokenComponentAggregation::DIRECTION_FORWARD && e->getFrom() == n) ||
|
||||
(dir == TokenComponentAggregation::DIRECTION_BACKWARD && e->getTo() == n))
|
||||
(dir == TokenComponentBundledEdges::DIRECTION_FORWARD && e->getFrom() == n) ||
|
||||
(dir == TokenComponentBundledEdges::DIRECTION_BACKWARD && e->getTo() == n))
|
||||
{
|
||||
bundleInfo->isReferencing = true;
|
||||
}
|
||||
else if (
|
||||
(dir == TokenComponentAggregation::DIRECTION_FORWARD && e->getTo() == n) ||
|
||||
(dir == TokenComponentAggregation::DIRECTION_BACKWARD && e->getFrom() == n))
|
||||
(dir == TokenComponentBundledEdges::DIRECTION_FORWARD && e->getTo() == n) ||
|
||||
(dir == TokenComponentBundledEdges::DIRECTION_BACKWARD && e->getFrom() == n))
|
||||
{
|
||||
bundleInfo->isReferenced = true;
|
||||
}
|
||||
@@ -2041,7 +2041,7 @@ Vec4i GraphController::layoutNestingRecursive(DummyNode* node, int relayoutAcces
|
||||
break;
|
||||
|
||||
case GroupLayout::BUCKET:
|
||||
if (node->hasActiveSubNode() || !m_activeNodeIds.size() /* aggregations */)
|
||||
if (node->hasActiveSubNode() || !m_activeNodeIds.size() /* bundled edges */)
|
||||
{
|
||||
BucketLayouter grid(viewSize);
|
||||
grid.createBuckets(node->subNodes, m_dummyEdges);
|
||||
@@ -2446,25 +2446,25 @@ void GraphController::createLegendGraph()
|
||||
addEdge(Edge::EDGE_INHERITANCE, derived, main);
|
||||
|
||||
{
|
||||
Edge* edge = addEdge(Edge::EDGE_AGGREGATION, user, main);
|
||||
std::shared_ptr<TokenComponentAggregation> aggregationComp =
|
||||
std::make_shared<TokenComponentAggregation>();
|
||||
Edge* edge = addEdge(Edge::EDGE_BUNDLED_EDGES, user, main);
|
||||
std::shared_ptr<TokenComponentBundledEdges> bundledEdgesComp =
|
||||
std::make_shared<TokenComponentBundledEdges>();
|
||||
for (size_t i = 0; i < 10; i++)
|
||||
{
|
||||
aggregationComp->addAggregationId(++id, true);
|
||||
bundledEdgesComp->addBundledEdgesId(++id, true);
|
||||
}
|
||||
edge->addComponent(aggregationComp);
|
||||
edge->addComponent(bundledEdgesComp);
|
||||
}
|
||||
|
||||
{
|
||||
Edge* edge = addEdge(Edge::EDGE_AGGREGATION, main, usee);
|
||||
std::shared_ptr<TokenComponentAggregation> aggregationComp =
|
||||
std::make_shared<TokenComponentAggregation>();
|
||||
Edge* edge = addEdge(Edge::EDGE_BUNDLED_EDGES, main, usee);
|
||||
std::shared_ptr<TokenComponentBundledEdges> bundledEdgesComp =
|
||||
std::make_shared<TokenComponentBundledEdges>();
|
||||
for (size_t i = 0; i < 10; i++)
|
||||
{
|
||||
aggregationComp->addAggregationId(++id, true);
|
||||
bundledEdgesComp->addBundledEdgesId(++id, true);
|
||||
}
|
||||
edge->addComponent(aggregationComp);
|
||||
edge->addComponent(bundledEdgesComp);
|
||||
}
|
||||
|
||||
Node* publicMethod = addNode(NODE_METHOD, L"public method", Vec2i());
|
||||
@@ -2622,17 +2622,17 @@ void GraphController::createLegendGraph()
|
||||
}
|
||||
|
||||
{
|
||||
addText(L"aggregation", 0, Vec2i(x, y + dy * ++i));
|
||||
addText(L"bundled edges", 0, Vec2i(x, y + dy * ++i));
|
||||
Node* typeA = addNode(NODE_TYPE, L"Type A", Vec2i(x, y + dy * ++i));
|
||||
Node* typeB = addNode(NODE_TYPE, L"Type B", Vec2i(x + dx, y + dy * i));
|
||||
Edge* edge = addEdge(Edge::EDGE_AGGREGATION, typeA, typeB);
|
||||
std::shared_ptr<TokenComponentAggregation> aggregationComp =
|
||||
std::make_shared<TokenComponentAggregation>();
|
||||
Edge* edge = addEdge(Edge::EDGE_BUNDLED_EDGES, typeA, typeB);
|
||||
std::shared_ptr<TokenComponentBundledEdges> bundledEdgesComp =
|
||||
std::make_shared<TokenComponentBundledEdges>();
|
||||
for (size_t i = 0; i < 10; i++)
|
||||
{
|
||||
aggregationComp->addAggregationId(++id, true);
|
||||
bundledEdgesComp->addBundledEdgesId(++id, true);
|
||||
}
|
||||
edge->addComponent(aggregationComp);
|
||||
edge->addComponent(bundledEdgesComp);
|
||||
}
|
||||
|
||||
{
|
||||
|
||||
@@ -349,7 +349,7 @@ void UndoRedoController::handleMessage(MessageIndexingFinished* message)
|
||||
MessageActivateTokens* msg = dynamic_cast<MessageActivateTokens*>(command.message.get());
|
||||
if (msg)
|
||||
{
|
||||
if (msg->isAggregation)
|
||||
if (msg->isBundledEdges)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
@@ -498,7 +498,7 @@ void UndoRedoController::replayCommand(std::list<Command>::iterator it)
|
||||
{
|
||||
MessageActivateTokens* msg = dynamic_cast<MessageActivateTokens*>(m.get());
|
||||
|
||||
if (!msg->isEdge && !msg->isAggregation)
|
||||
if (!msg->isEdge && !msg->isBundledEdges)
|
||||
{
|
||||
std::vector<SearchMatch> matches = msg->getSearchMatches();
|
||||
msg->searchMatches.clear();
|
||||
|
||||
@@ -310,9 +310,9 @@ void BucketLayouter::createBuckets(
|
||||
}
|
||||
}
|
||||
else if (
|
||||
edge->getDirection() == TokenComponentAggregation::DIRECTION_BACKWARD ||
|
||||
edge->getDirection() == TokenComponentBundledEdges::DIRECTION_BACKWARD ||
|
||||
// put nodes with bidirectional edges on the left
|
||||
(edge->getDirection() == TokenComponentAggregation::DIRECTION_NONE &&
|
||||
(edge->getDirection() == TokenComponentBundledEdges::DIRECTION_NONE &&
|
||||
!target->bundleInfo.isReferencing && !target->bundleInfo.isReferenced))
|
||||
{
|
||||
std::swap(owner, target);
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
#include "types.h"
|
||||
|
||||
#include "Edge.h"
|
||||
#include "TokenComponentAggregation.h"
|
||||
#include "TokenComponentBundledEdges.h"
|
||||
|
||||
class Edge;
|
||||
|
||||
@@ -21,7 +21,7 @@ struct DummyEdge
|
||||
, active(false)
|
||||
, layoutHorizontal(true)
|
||||
, weight(0)
|
||||
, direction(TokenComponentAggregation::DIRECTION_INVALID)
|
||||
, direction(TokenComponentBundledEdges::DIRECTION_INVALID)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ struct DummyEdge
|
||||
, active(false)
|
||||
, layoutHorizontal(true)
|
||||
, weight(0)
|
||||
, direction(TokenComponentAggregation::DIRECTION_INVALID)
|
||||
, direction(TokenComponentBundledEdges::DIRECTION_INVALID)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -44,43 +44,43 @@ struct DummyEdge
|
||||
{
|
||||
return weight;
|
||||
}
|
||||
else if (data->isType(Edge::EDGE_AGGREGATION))
|
||||
else if (data->isType(Edge::EDGE_BUNDLED_EDGES))
|
||||
{
|
||||
return data->getComponent<TokenComponentAggregation>()->getAggregationCount();
|
||||
return data->getComponent<TokenComponentBundledEdges>()->getBundledEdgesCount();
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
void updateDirection(TokenComponentAggregation::Direction dir, bool invert)
|
||||
void updateDirection(TokenComponentBundledEdges::Direction dir, bool invert)
|
||||
{
|
||||
if (invert)
|
||||
{
|
||||
dir = TokenComponentAggregation::opposite(dir);
|
||||
dir = TokenComponentBundledEdges::opposite(dir);
|
||||
}
|
||||
|
||||
if (direction == TokenComponentAggregation::DIRECTION_INVALID)
|
||||
if (direction == TokenComponentBundledEdges::DIRECTION_INVALID)
|
||||
{
|
||||
direction = dir;
|
||||
}
|
||||
else if (direction != dir)
|
||||
{
|
||||
direction = TokenComponentAggregation::DIRECTION_NONE;
|
||||
direction = TokenComponentBundledEdges::DIRECTION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
TokenComponentAggregation::Direction getDirection() const
|
||||
TokenComponentBundledEdges::Direction getDirection() const
|
||||
{
|
||||
if (!data)
|
||||
{
|
||||
return direction;
|
||||
}
|
||||
else if (data->isType(Edge::EDGE_AGGREGATION))
|
||||
else if (data->isType(Edge::EDGE_BUNDLED_EDGES))
|
||||
{
|
||||
return data->getComponent<TokenComponentAggregation>()->getDirection();
|
||||
return data->getComponent<TokenComponentBundledEdges>()->getDirection();
|
||||
}
|
||||
|
||||
return TokenComponentAggregation::DIRECTION_FORWARD;
|
||||
return TokenComponentBundledEdges::DIRECTION_FORWARD;
|
||||
}
|
||||
|
||||
Id ownerId;
|
||||
@@ -98,7 +98,7 @@ struct DummyEdge
|
||||
|
||||
// BundleEdge
|
||||
int weight;
|
||||
TokenComponentAggregation::Direction direction;
|
||||
TokenComponentBundledEdges::Direction direction;
|
||||
};
|
||||
|
||||
#endif // DUMMY_EDGE_H
|
||||
|
||||
@@ -671,7 +671,7 @@ GraphViewStyle::EdgeStyle GraphViewStyle::getStyleForEdgeType(
|
||||
|
||||
switch (type)
|
||||
{
|
||||
case Edge::EDGE_AGGREGATION:
|
||||
case Edge::EDGE_BUNDLED_EDGES:
|
||||
style.width = 3;
|
||||
style.arrowLength = 7;
|
||||
style.arrowWidth = 10;
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <sstream>
|
||||
|
||||
#include "Node.h"
|
||||
#include "TokenComponentAggregation.h"
|
||||
#include "TokenComponentBundledEdges.h"
|
||||
#include "logging.h"
|
||||
#include "utilityString.h"
|
||||
|
||||
@@ -36,8 +36,8 @@ Edge::EdgeType Edge::intToType(int value)
|
||||
return EDGE_INCLUDE;
|
||||
case EDGE_IMPORT:
|
||||
return EDGE_IMPORT;
|
||||
case EDGE_AGGREGATION:
|
||||
return EDGE_AGGREGATION;
|
||||
case EDGE_BUNDLED_EDGES:
|
||||
return EDGE_BUNDLED_EDGES;
|
||||
case EDGE_MACRO_USAGE:
|
||||
return EDGE_MACRO_USAGE;
|
||||
case EDGE_ANNOTATION_USAGE:
|
||||
@@ -139,8 +139,8 @@ std::wstring Edge::getReadableTypeString(EdgeType type)
|
||||
return L"include";
|
||||
case EDGE_IMPORT:
|
||||
return L"import";
|
||||
case EDGE_AGGREGATION:
|
||||
return L"aggregation";
|
||||
case EDGE_BUNDLED_EDGES:
|
||||
return L"bundled edges";
|
||||
case EDGE_MACRO_USAGE:
|
||||
return L"macro use";
|
||||
case EDGE_ANNOTATION_USAGE:
|
||||
@@ -175,10 +175,10 @@ std::wstring Edge::getAsString() const
|
||||
str << L"[" << getId() << L"] " << getReadableTypeString();
|
||||
str << L": \"" << m_from->getName() << L"\" -> \"" + m_to->getName() << L"\"";
|
||||
|
||||
TokenComponentAggregation* aggregation = getComponent<TokenComponentAggregation>();
|
||||
if (aggregation)
|
||||
TokenComponentBundledEdges* bundledEdges = getComponent<TokenComponentBundledEdges>();
|
||||
if (bundledEdges)
|
||||
{
|
||||
str << L" " << aggregation->getAggregationCount();
|
||||
str << L" " << bundledEdges->getBundledEdgesCount();
|
||||
}
|
||||
|
||||
return str.str();
|
||||
|
||||
@@ -25,7 +25,7 @@ public:
|
||||
EDGE_TEMPLATE_SPECIALIZATION = 1 << 7,
|
||||
EDGE_INCLUDE = 1 << 8,
|
||||
EDGE_IMPORT = 1 << 9,
|
||||
EDGE_AGGREGATION = 1 << 10,
|
||||
EDGE_BUNDLED_EDGES = 1 << 10,
|
||||
EDGE_MACRO_USAGE = 1 << 11,
|
||||
EDGE_ANNOTATION_USAGE = 1 << 12,
|
||||
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
#ifndef TOKEN_COMPONENT_AGGREGATION_H
|
||||
#define TOKEN_COMPONENT_AGGREGATION_H
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "TokenComponent.h"
|
||||
|
||||
class TokenComponentAggregation: public TokenComponent
|
||||
{
|
||||
public:
|
||||
enum Direction
|
||||
{
|
||||
DIRECTION_NONE,
|
||||
DIRECTION_FORWARD,
|
||||
DIRECTION_BACKWARD,
|
||||
DIRECTION_INVALID
|
||||
};
|
||||
|
||||
static Direction opposite(Direction direction);
|
||||
|
||||
TokenComponentAggregation();
|
||||
virtual ~TokenComponentAggregation();
|
||||
|
||||
virtual std::shared_ptr<TokenComponent> copy() const;
|
||||
|
||||
int getAggregationCount() const;
|
||||
std::set<Id> getAggregationIds() const;
|
||||
|
||||
void addAggregationId(Id id, bool forward);
|
||||
void removeAggregationId(Id id);
|
||||
|
||||
Direction getDirection();
|
||||
|
||||
private:
|
||||
std::map<Id, Direction> m_ids;
|
||||
Direction m_direction;
|
||||
};
|
||||
|
||||
#endif // TOKEN_COMPONENT_AGGREGATION_H
|
||||
+11
-11
@@ -1,6 +1,6 @@
|
||||
#include "TokenComponentAggregation.h"
|
||||
#include "TokenComponentBundledEdges.h"
|
||||
|
||||
TokenComponentAggregation::Direction TokenComponentAggregation::opposite(Direction direction)
|
||||
TokenComponentBundledEdges::Direction TokenComponentBundledEdges::opposite(Direction direction)
|
||||
{
|
||||
if (direction == DIRECTION_FORWARD)
|
||||
{
|
||||
@@ -14,21 +14,21 @@ TokenComponentAggregation::Direction TokenComponentAggregation::opposite(Directi
|
||||
return direction;
|
||||
}
|
||||
|
||||
TokenComponentAggregation::TokenComponentAggregation(): m_direction(DIRECTION_INVALID) {}
|
||||
TokenComponentBundledEdges::TokenComponentBundledEdges(): m_direction(DIRECTION_INVALID) {}
|
||||
|
||||
TokenComponentAggregation::~TokenComponentAggregation() {}
|
||||
TokenComponentBundledEdges::~TokenComponentBundledEdges() {}
|
||||
|
||||
std::shared_ptr<TokenComponent> TokenComponentAggregation::copy() const
|
||||
std::shared_ptr<TokenComponent> TokenComponentBundledEdges::copy() const
|
||||
{
|
||||
return std::make_shared<TokenComponentAggregation>(*this);
|
||||
return std::make_shared<TokenComponentBundledEdges>(*this);
|
||||
}
|
||||
|
||||
int TokenComponentAggregation::getAggregationCount() const
|
||||
int TokenComponentBundledEdges::getBundledEdgesCount() const
|
||||
{
|
||||
return static_cast<int>(m_ids.size());
|
||||
}
|
||||
|
||||
std::set<Id> TokenComponentAggregation::getAggregationIds() const
|
||||
std::set<Id> TokenComponentBundledEdges::getBundledEdgesIds() const
|
||||
{
|
||||
std::set<Id> ids;
|
||||
|
||||
@@ -40,21 +40,21 @@ std::set<Id> TokenComponentAggregation::getAggregationIds() const
|
||||
return ids;
|
||||
}
|
||||
|
||||
void TokenComponentAggregation::addAggregationId(Id id, bool forward)
|
||||
void TokenComponentBundledEdges::addBundledEdgesId(Id id, bool forward)
|
||||
{
|
||||
m_ids.emplace(id, forward ? DIRECTION_FORWARD : DIRECTION_BACKWARD);
|
||||
|
||||
m_direction = DIRECTION_INVALID;
|
||||
}
|
||||
|
||||
void TokenComponentAggregation::removeAggregationId(Id id)
|
||||
void TokenComponentBundledEdges::removeBundledEdgesId(Id id)
|
||||
{
|
||||
m_ids.erase(id);
|
||||
|
||||
m_direction = DIRECTION_INVALID;
|
||||
}
|
||||
|
||||
TokenComponentAggregation::Direction TokenComponentAggregation::getDirection()
|
||||
TokenComponentBundledEdges::Direction TokenComponentBundledEdges::getDirection()
|
||||
{
|
||||
if (m_direction != DIRECTION_INVALID)
|
||||
{
|
||||
@@ -0,0 +1,42 @@
|
||||
#ifndef TOKEN_COMPONENT_BUNDLED_EDGES_H
|
||||
#define TOKEN_COMPONENT_BUNDLED_EDGES_H
|
||||
|
||||
#include <map>
|
||||
#include <set>
|
||||
|
||||
#include "types.h"
|
||||
|
||||
#include "TokenComponent.h"
|
||||
|
||||
class TokenComponentBundledEdges: public TokenComponent
|
||||
{
|
||||
public:
|
||||
enum Direction
|
||||
{
|
||||
DIRECTION_NONE,
|
||||
DIRECTION_FORWARD,
|
||||
DIRECTION_BACKWARD,
|
||||
DIRECTION_INVALID
|
||||
};
|
||||
|
||||
static Direction opposite(Direction direction);
|
||||
|
||||
TokenComponentBundledEdges();
|
||||
virtual ~TokenComponentBundledEdges();
|
||||
|
||||
virtual std::shared_ptr<TokenComponent> copy() const;
|
||||
|
||||
int getBundledEdgesCount() const;
|
||||
std::set<Id> getBundledEdgesIds() const;
|
||||
|
||||
void addBundledEdgesId(Id id, bool forward);
|
||||
void removeBundledEdgesId(Id id);
|
||||
|
||||
Direction getDirection();
|
||||
|
||||
private:
|
||||
std::map<Id, Direction> m_ids;
|
||||
Direction m_direction;
|
||||
};
|
||||
|
||||
#endif // TOKEN_COMPONENT_BUNDLED_EDGES_H
|
||||
@@ -11,7 +11,8 @@ IndexerCommandType IndexerCommandCustom::getStaticIndexerCommandType()
|
||||
}
|
||||
|
||||
IndexerCommandCustom::IndexerCommandCustom(
|
||||
const std::wstring& customCommand,
|
||||
const std::wstring& command,
|
||||
const std::vector<std::wstring>& arguments,
|
||||
const FilePath& projectFilePath,
|
||||
const FilePath& databaseFilePath,
|
||||
const std::wstring& databaseVersion,
|
||||
@@ -19,7 +20,8 @@ IndexerCommandCustom::IndexerCommandCustom(
|
||||
bool runInParallel)
|
||||
: IndexerCommand(sourceFilePath)
|
||||
, m_type(getStaticIndexerCommandType())
|
||||
, m_customCommand(customCommand)
|
||||
, m_command(command)
|
||||
, m_arguments(arguments)
|
||||
, m_projectFilePath(projectFilePath)
|
||||
, m_databaseFilePath(databaseFilePath)
|
||||
, m_databaseVersion(databaseVersion)
|
||||
@@ -29,7 +31,8 @@ IndexerCommandCustom::IndexerCommandCustom(
|
||||
|
||||
IndexerCommandCustom::IndexerCommandCustom(
|
||||
IndexerCommandType type,
|
||||
const std::wstring& customCommand,
|
||||
const std::wstring& command,
|
||||
const std::vector<std::wstring>& arguments,
|
||||
const FilePath& projectFilePath,
|
||||
const FilePath& databaseFilePath,
|
||||
const std::wstring& databaseVersion,
|
||||
@@ -37,7 +40,8 @@ IndexerCommandCustom::IndexerCommandCustom(
|
||||
bool runInParallel)
|
||||
: IndexerCommand(sourceFilePath)
|
||||
, m_type(type)
|
||||
, m_customCommand(customCommand)
|
||||
, m_command(command)
|
||||
, m_arguments(arguments)
|
||||
, m_projectFilePath(projectFilePath)
|
||||
, m_databaseFilePath(databaseFilePath)
|
||||
, m_databaseVersion(databaseVersion)
|
||||
@@ -67,19 +71,19 @@ void IndexerCommandCustom::setDatabaseFilePath(const FilePath& databaseFilePath)
|
||||
m_databaseFilePath = databaseFilePath;
|
||||
}
|
||||
|
||||
std::wstring IndexerCommandCustom::getCustomCommand() const
|
||||
std::wstring IndexerCommandCustom::getCommand() const
|
||||
{
|
||||
std::wstring command = m_customCommand;
|
||||
return replaceVariables(m_command);
|
||||
}
|
||||
|
||||
command = utility::replace(
|
||||
command, L"%{PROJECT_FILE_PATH}", L'\"' + m_projectFilePath.wstr() + L'\"');
|
||||
command = utility::replace(
|
||||
command, L"%{DATABASE_FILE_PATH}", L'\"' + m_databaseFilePath.wstr() + L'\"');
|
||||
command = utility::replace(command, L"%{DATABASE_VERSION}", L'\"' + m_databaseVersion + L'\"');
|
||||
command = utility::replace(
|
||||
command, L"%{SOURCE_FILE_PATH}", L'\"' + getSourceFilePath().wstr() + L'\"');
|
||||
|
||||
return command;
|
||||
std::vector<std::wstring> IndexerCommandCustom::getArguments() const
|
||||
{
|
||||
std::vector<std::wstring> args;
|
||||
for (const std::wstring& argument: m_arguments)
|
||||
{
|
||||
args.push_back(replaceVariables(argument));
|
||||
}
|
||||
return args;
|
||||
}
|
||||
|
||||
bool IndexerCommandCustom::getRunInParallel() const
|
||||
@@ -92,7 +96,15 @@ QJsonObject IndexerCommandCustom::doSerialize() const
|
||||
QJsonObject jsonObject = IndexerCommand::doSerialize();
|
||||
|
||||
{
|
||||
jsonObject["custom_command"] = QString::fromStdWString(m_customCommand);
|
||||
jsonObject["command"] = QString::fromStdWString(m_command);
|
||||
}
|
||||
{
|
||||
QJsonArray argumentsArray;
|
||||
for (const std::wstring& argument: m_arguments)
|
||||
{
|
||||
argumentsArray.append(QString::fromStdWString(argument));
|
||||
}
|
||||
jsonObject["arguments"] = argumentsArray;
|
||||
}
|
||||
{
|
||||
jsonObject["run_in_parallel"] = m_runInParallel;
|
||||
@@ -100,3 +112,12 @@ QJsonObject IndexerCommandCustom::doSerialize() const
|
||||
|
||||
return jsonObject;
|
||||
}
|
||||
|
||||
std::wstring IndexerCommandCustom::replaceVariables(std::wstring s) const
|
||||
{
|
||||
s = utility::replace(s, L"%{PROJECT_FILE_PATH}", m_projectFilePath.wstr());
|
||||
s = utility::replace(s, L"%{DATABASE_FILE_PATH}", m_databaseFilePath.wstr());
|
||||
s = utility::replace(s, L"%{DATABASE_VERSION}", m_databaseVersion);
|
||||
s = utility::replace(s, L"%{SOURCE_FILE_PATH}", getSourceFilePath().wstr());
|
||||
return s;
|
||||
}
|
||||
|
||||
@@ -12,7 +12,8 @@ public:
|
||||
static IndexerCommandType getStaticIndexerCommandType();
|
||||
|
||||
IndexerCommandCustom(
|
||||
const std::wstring& customCommand,
|
||||
const std::wstring& command,
|
||||
const std::vector<std::wstring>& arguments,
|
||||
const FilePath& projectFilePath,
|
||||
const FilePath& databaseFilePath,
|
||||
const std::wstring& databaseVersion,
|
||||
@@ -21,7 +22,8 @@ public:
|
||||
|
||||
IndexerCommandCustom(
|
||||
IndexerCommandType type,
|
||||
const std::wstring& customCommand,
|
||||
const std::wstring& command,
|
||||
const std::vector<std::wstring>& arguments,
|
||||
const FilePath& projectFilePath,
|
||||
const FilePath& databaseFilePath,
|
||||
const std::wstring& databaseVersion,
|
||||
@@ -34,15 +36,19 @@ public:
|
||||
FilePath getDatabaseFilePath() const;
|
||||
void setDatabaseFilePath(const FilePath& databaseFilePath);
|
||||
|
||||
std::wstring getCustomCommand() const;
|
||||
std::wstring getCommand() const;
|
||||
std::vector<std::wstring> getArguments() const;
|
||||
bool getRunInParallel() const;
|
||||
|
||||
protected:
|
||||
QJsonObject doSerialize() const override;
|
||||
|
||||
private:
|
||||
std::wstring replaceVariables(std::wstring s) const;
|
||||
|
||||
IndexerCommandType m_type;
|
||||
std::wstring m_customCommand;
|
||||
std::wstring m_command;
|
||||
std::vector<std::wstring> m_arguments;
|
||||
FilePath m_projectFilePath;
|
||||
FilePath m_databaseFilePath;
|
||||
std::wstring m_databaseVersion;
|
||||
|
||||
@@ -188,16 +188,16 @@ void TaskBuildIndex::runIndexerProcess(int processId, const std::wstring& logFil
|
||||
return;
|
||||
}
|
||||
|
||||
const std::wstring commandPath = L"\"" + indexerProcessPath.wstr() + L"\"";
|
||||
const std::wstring commandPath = indexerProcessPath.wstr();
|
||||
std::vector<std::wstring> commandArguments;
|
||||
commandArguments.push_back(std::to_wstring(processId));
|
||||
commandArguments.push_back(utility::decodeFromUtf8(m_appUUID));
|
||||
commandArguments.push_back(L"\"" + AppPath::getSharedDataPath().getAbsolute().wstr() + L"\"");
|
||||
commandArguments.push_back(L"\"" + UserPaths::getUserDataPath().getAbsolute().wstr() + L"\"");
|
||||
commandArguments.push_back(AppPath::getSharedDataPath().getAbsolute().wstr());
|
||||
commandArguments.push_back(UserPaths::getUserDataPath().getAbsolute().wstr());
|
||||
|
||||
if (!logFilePath.empty())
|
||||
{
|
||||
commandArguments.push_back(L"\"" + logFilePath + L"\"");
|
||||
commandArguments.push_back(logFilePath);
|
||||
}
|
||||
|
||||
int result = 1;
|
||||
|
||||
@@ -7,6 +7,8 @@
|
||||
#include "FileSystem.h"
|
||||
#include "IndexerCommandCustom.h"
|
||||
#include "IndexerCommandProvider.h"
|
||||
#include "MessageErrorCountClear.h"
|
||||
#include "MessageErrorCountUpdate.h"
|
||||
#include "MessageIndexingStatus.h"
|
||||
#include "MessageShowStatus.h"
|
||||
#include "MessageStatus.h"
|
||||
@@ -320,7 +322,7 @@ Task::TaskState TaskExecuteCustomCommands::doUpdate(std::shared_ptr<Blackboard>
|
||||
{
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand = m_serialCommands.back();
|
||||
m_serialCommands.pop_back();
|
||||
runIndexerCommand(indexerCommand, blackboard);
|
||||
runIndexerCommand(indexerCommand, blackboard, m_storage);
|
||||
}
|
||||
|
||||
executeParallelIndexerCommands(0, blackboard);
|
||||
@@ -331,6 +333,9 @@ Task::TaskState TaskExecuteCustomCommands::doUpdate(std::shared_ptr<Blackboard>
|
||||
}
|
||||
indexerThreads.clear();
|
||||
|
||||
// clear errors here, because otherwise injecting into the main storage will show them twice
|
||||
MessageErrorCountClear().dispatch();
|
||||
|
||||
{
|
||||
PersistentStorage targetStorage(m_targetDatabaseFilePath, FilePath());
|
||||
targetStorage.setup();
|
||||
@@ -386,6 +391,7 @@ void TaskExecuteCustomCommands::handleMessage(MessageIndexingInterrupted* messag
|
||||
void TaskExecuteCustomCommands::executeParallelIndexerCommands(
|
||||
int threadId, std::shared_ptr<Blackboard> blackboard)
|
||||
{
|
||||
std::shared_ptr<PersistentStorage> storage;
|
||||
while (!m_interrupted)
|
||||
{
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand;
|
||||
@@ -399,7 +405,11 @@ void TaskExecuteCustomCommands::executeParallelIndexerCommands(
|
||||
m_parallelCommands.pop_back();
|
||||
}
|
||||
|
||||
if (threadId != 0)
|
||||
if (threadId == 0)
|
||||
{
|
||||
storage = m_storage;
|
||||
}
|
||||
else
|
||||
{
|
||||
FilePath databaseFilePath = indexerCommand->getDatabaseFilePath();
|
||||
databaseFilePath = databaseFilePath.getParentDirectory().concatenate(
|
||||
@@ -426,21 +436,23 @@ void TaskExecuteCustomCommands::executeParallelIndexerCommands(
|
||||
L"conflicts.");
|
||||
FileSystem::remove(databaseFilePath);
|
||||
}
|
||||
PersistentStorage sourceStorage(databaseFilePath, FilePath());
|
||||
sourceStorage.setup();
|
||||
sourceStorage.setMode(SqliteIndexStorage::STORAGE_MODE_WRITE);
|
||||
sourceStorage.buildCaches();
|
||||
storage = std::make_shared<PersistentStorage>(databaseFilePath, FilePath());
|
||||
storage->setup();
|
||||
storage->setMode(SqliteIndexStorage::STORAGE_MODE_WRITE);
|
||||
storage->buildCaches();
|
||||
}
|
||||
|
||||
indexerCommand->setDatabaseFilePath(databaseFilePath);
|
||||
}
|
||||
|
||||
runIndexerCommand(indexerCommand, blackboard);
|
||||
runIndexerCommand(indexerCommand, blackboard, storage);
|
||||
}
|
||||
}
|
||||
|
||||
void TaskExecuteCustomCommands::runIndexerCommand(
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand, std::shared_ptr<Blackboard> blackboard)
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand,
|
||||
std::shared_ptr<Blackboard> blackboard,
|
||||
std::shared_ptr<PersistentStorage> storage)
|
||||
{
|
||||
if (indexerCommand)
|
||||
{
|
||||
@@ -453,17 +465,44 @@ void TaskExecuteCustomCommands::runIndexerCommand(
|
||||
indexedSourceFileCount + 1, indexedSourceFileCount, m_indexerCommandCount, {sourcePath});
|
||||
MessageIndexingStatus(true, indexedSourceFileCount * 100 / m_indexerCommandCount).dispatch();
|
||||
|
||||
const std::wstring command = indexerCommand->getCustomCommand();
|
||||
const std::wstring command = indexerCommand->getCommand();
|
||||
const std::vector<std::wstring> arguments = indexerCommand->getArguments();
|
||||
|
||||
LOG_INFO_STREAM(<< "Execute command \"" << utility::encodeToUtf8(command) << "\"");
|
||||
LOG_INFO(
|
||||
"Start processing command \"" +
|
||||
utility::encodeToUtf8(command + L" " + utility::join(arguments, L" ")) + "\"");
|
||||
|
||||
m_storage->beforeErrorRecording();
|
||||
const ErrorCountInfo previousErrorCount = storage ? storage->getErrorCount()
|
||||
: ErrorCountInfo();
|
||||
|
||||
LOG_INFO("Starting to index");
|
||||
std::wstring errorMessage;
|
||||
const int result = utility::executeProcessAndGetExitCode(
|
||||
command, {}, m_projectDirectory, -1, true, &errorMessage);
|
||||
command, arguments, m_projectDirectory, -1, true, &errorMessage);
|
||||
LOG_INFO("Finished indexing");
|
||||
|
||||
m_storage->afterErrorRecording();
|
||||
if (storage)
|
||||
{
|
||||
std::vector<ErrorInfo> errors = storage->getErrorInfos();
|
||||
const ErrorCountInfo currentErrorCount(errors);
|
||||
if (currentErrorCount.total > previousErrorCount.total)
|
||||
{
|
||||
const ErrorCountInfo diff(
|
||||
currentErrorCount.total - previousErrorCount.total,
|
||||
currentErrorCount.fatal - previousErrorCount.fatal);
|
||||
|
||||
ErrorCountInfo errorCount; // local copy to release lock early
|
||||
{
|
||||
std::lock_guard<std::mutex> lock(m_errorCountMutex);
|
||||
m_errorCount.total += diff.total;
|
||||
m_errorCount.fatal += diff.fatal;
|
||||
errorCount = m_errorCount;
|
||||
}
|
||||
|
||||
errors.erase(errors.begin(), errors.begin() + previousErrorCount.total);
|
||||
MessageErrorCountUpdate(errorCount, errors).dispatch();
|
||||
}
|
||||
}
|
||||
|
||||
if (result == 0 && errorMessage.empty())
|
||||
{
|
||||
@@ -472,8 +511,9 @@ void TaskExecuteCustomCommands::runIndexerCommand(
|
||||
}
|
||||
else
|
||||
{
|
||||
std::wstring statusText = L"command \"" + indexerCommand->getCustomCommand() +
|
||||
L"\" returned";
|
||||
std::wstring statusText = L"command \"" + indexerCommand->getCommand() + L" " +
|
||||
utility::join(arguments, L" ") + L"\" returned";
|
||||
|
||||
if (result != 0)
|
||||
{
|
||||
statusText += L" code \"" + std::to_wstring(result) + L"\"";
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <set>
|
||||
#include <vector>
|
||||
|
||||
#include "ErrorCountInfo.h"
|
||||
#include "FilePath.h"
|
||||
#include "MessageIndexingInterrupted.h"
|
||||
#include "MessageListener.h"
|
||||
@@ -39,7 +40,9 @@ private:
|
||||
|
||||
void executeParallelIndexerCommands(int threadId, std::shared_ptr<Blackboard> blackboard);
|
||||
void runIndexerCommand(
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand, std::shared_ptr<Blackboard> blackboard);
|
||||
std::shared_ptr<IndexerCommandCustom> indexerCommand,
|
||||
std::shared_ptr<Blackboard> blackboard,
|
||||
std::shared_ptr<PersistentStorage> storage);
|
||||
|
||||
std::unique_ptr<IndexerCommandProvider> m_indexerCommandProvider;
|
||||
std::shared_ptr<PersistentStorage> m_storage;
|
||||
@@ -53,6 +56,8 @@ private:
|
||||
std::vector<std::shared_ptr<IndexerCommandCustom>> m_serialCommands;
|
||||
std::vector<std::shared_ptr<IndexerCommandCustom>> m_parallelCommands;
|
||||
std::mutex m_parallelCommandsMutex;
|
||||
ErrorCountInfo m_errorCount;
|
||||
std::mutex m_errorCountMutex;
|
||||
FilePath m_targetDatabaseFilePath;
|
||||
bool m_hasPythonCommands;
|
||||
std::set<FilePath> m_sourceDatabaseFilePaths;
|
||||
|
||||
@@ -19,7 +19,7 @@
|
||||
#include "TextCodec.h"
|
||||
#include "TimeStamp.h"
|
||||
#include "TokenComponentAccess.h"
|
||||
#include "TokenComponentAggregation.h"
|
||||
#include "TokenComponentBundledEdges.h"
|
||||
#include "TokenComponentFilePath.h"
|
||||
#include "TokenComponentInheritanceChain.h"
|
||||
#include "TokenComponentIsAmbiguous.h"
|
||||
@@ -260,6 +260,11 @@ void PersistentStorage::rollbackInjection()
|
||||
afterErrorRecording();
|
||||
}
|
||||
|
||||
const std::vector<ErrorInfo> PersistentStorage::getErrorInfos() const
|
||||
{
|
||||
return m_sqliteIndexStorage.getAllErrorInfos();
|
||||
}
|
||||
|
||||
void PersistentStorage::beforeErrorRecording()
|
||||
{
|
||||
m_preInjectionErrorCount = m_sqliteIndexStorage.getErrorCount();
|
||||
@@ -273,7 +278,7 @@ void PersistentStorage::beforeErrorRecording()
|
||||
|
||||
void PersistentStorage::afterErrorRecording()
|
||||
{
|
||||
std::vector<ErrorInfo> errors = m_sqliteIndexStorage.getAllErrorInfos();
|
||||
std::vector<ErrorInfo> errors = getErrorInfos();
|
||||
if (m_preInjectionErrorCount < errors.size())
|
||||
{
|
||||
ErrorCountInfo errorCount(errors);
|
||||
@@ -1097,8 +1102,8 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
std::vector<Id> nodeIds;
|
||||
std::vector<Id> edgeIds;
|
||||
|
||||
bool addAggregations = false;
|
||||
std::vector<StorageEdge> edgesToAggregate;
|
||||
bool addBundledEdges = false;
|
||||
std::vector<StorageEdge> edgesToBundle;
|
||||
|
||||
bool addFileContents = false;
|
||||
|
||||
@@ -1145,7 +1150,7 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
(m_hierarchyCache.getLastVisibleParentNodeId(edge.targetNodeId) !=
|
||||
m_hierarchyCache.getLastVisibleParentNodeId(edge.sourceNodeId)))
|
||||
{
|
||||
edgesToAggregate.push_back(edge);
|
||||
edgesToBundle.push_back(edge);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1159,7 +1164,7 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
}
|
||||
else
|
||||
{
|
||||
addAggregations = true;
|
||||
addBundledEdges = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1216,9 +1221,9 @@ std::shared_ptr<Graph> PersistentStorage::getGraphForActiveTokenIds(
|
||||
addNodesWithParentsAndEdgesToGraph(nodeIds, edgeIds, graph, true);
|
||||
}
|
||||
|
||||
if (addAggregations)
|
||||
if (addBundledEdges)
|
||||
{
|
||||
addAggregationEdgesToGraph(tokenIds[0], edgesToAggregate, graph);
|
||||
addBundledEdgesToGraph(tokenIds[0], edgesToBundle, graph);
|
||||
}
|
||||
else if (addFileContents)
|
||||
{
|
||||
@@ -2963,8 +2968,8 @@ void PersistentStorage::addNodesWithParentsAndEdgesToGraph(
|
||||
addEdgesToGraph(utility::toVector(allEdgeIds), graph);
|
||||
}
|
||||
|
||||
void PersistentStorage::addAggregationEdgesToGraph(
|
||||
Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const
|
||||
void PersistentStorage::addBundledEdgesToGraph(
|
||||
Id nodeId, const std::vector<StorageEdge>& edgesToBundle, Graph* graph) const
|
||||
{
|
||||
TRACE();
|
||||
|
||||
@@ -2974,19 +2979,19 @@ void PersistentStorage::addAggregationEdgesToGraph(
|
||||
bool forward;
|
||||
};
|
||||
|
||||
// build aggregation edges:
|
||||
// build bundled edges:
|
||||
// get all children of the active node
|
||||
std::set<Id> childNodeIdsSet, edgeIdsSet;
|
||||
m_hierarchyCache.addAllChildIdsForNodeId(nodeId, &childNodeIdsSet, &edgeIdsSet);
|
||||
const std::vector<Id> childNodeIds = utility::toVector(childNodeIdsSet);
|
||||
if (childNodeIds.size() == 0 && edgesToAggregate.size() == 0)
|
||||
if (childNodeIds.size() == 0 && edgesToBundle.size() == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// get all edges of the children
|
||||
std::map<Id, std::vector<EdgeInfo>> connectedNodeIds;
|
||||
for (const StorageEdge& edge: edgesToAggregate)
|
||||
for (const StorageEdge& edge: edgesToBundle)
|
||||
{
|
||||
bool isSource = nodeId == edge.sourceNodeId;
|
||||
EdgeInfo edgeInfo;
|
||||
@@ -3033,38 +3038,38 @@ void PersistentStorage::addAggregationEdgesToGraph(
|
||||
std::vector<Id> nodeIdsToAdd;
|
||||
for (const std::pair<Id, std::vector<EdgeInfo>>& p: connectedParentNodeIds)
|
||||
{
|
||||
const Id aggregationTargetNodeId = p.first;
|
||||
if (!graph->getNodeById(aggregationTargetNodeId))
|
||||
const Id bundledEdgesTargetNodeId = p.first;
|
||||
if (!graph->getNodeById(bundledEdgesTargetNodeId))
|
||||
{
|
||||
nodeIdsToAdd.push_back(aggregationTargetNodeId);
|
||||
nodeIdsToAdd.push_back(bundledEdgesTargetNodeId);
|
||||
}
|
||||
}
|
||||
addNodesWithParentsAndEdgesToGraph(nodeIdsToAdd, std::vector<Id>(), graph, true);
|
||||
|
||||
// create aggregation edges between parents and active node
|
||||
// create bundled edges between parents and active node
|
||||
Node* sourceNode = graph->getNodeById(nodeId);
|
||||
for (const std::pair<Id, std::vector<EdgeInfo>>& p: connectedParentNodeIds)
|
||||
{
|
||||
const Id aggregationTargetNodeId = p.first;
|
||||
const Id bundledEdgesTargetNodeId = p.first;
|
||||
|
||||
Node* targetNode = graph->getNodeById(aggregationTargetNodeId);
|
||||
Node* targetNode = graph->getNodeById(bundledEdgesTargetNodeId);
|
||||
if (!targetNode)
|
||||
{
|
||||
LOG_ERROR("Aggregation target node not present.");
|
||||
LOG_ERROR("Bundled edges target node not present.");
|
||||
}
|
||||
|
||||
std::shared_ptr<TokenComponentAggregation> componentAggregation =
|
||||
std::make_shared<TokenComponentAggregation>();
|
||||
std::shared_ptr<TokenComponentBundledEdges> componentBundledEdges =
|
||||
std::make_shared<TokenComponentBundledEdges>();
|
||||
for (const EdgeInfo& edgeInfo: p.second)
|
||||
{
|
||||
componentAggregation->addAggregationId(edgeInfo.edgeId, edgeInfo.forward);
|
||||
componentBundledEdges->addBundledEdgesId(edgeInfo.edgeId, edgeInfo.forward);
|
||||
}
|
||||
|
||||
// Set first bit to 1 to avoid collisions
|
||||
const Id aggregationId = ~(~Id(0) >> 1) + *componentAggregation->getAggregationIds().begin();
|
||||
const Id bundledEdgesId = ~(~Id(0) >> 1) + *componentBundledEdges->getBundledEdgesIds().begin();
|
||||
|
||||
Edge* edge = graph->createEdge(aggregationId, Edge::EDGE_AGGREGATION, sourceNode, targetNode);
|
||||
edge->addComponent(componentAggregation);
|
||||
Edge* edge = graph->createEdge(bundledEdgesId, Edge::EDGE_BUNDLED_EDGES, sourceNode, targetNode);
|
||||
edge->addComponent(componentBundledEdges);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -59,6 +59,8 @@ public:
|
||||
void finishInjection() override;
|
||||
void rollbackInjection();
|
||||
|
||||
const std::vector<ErrorInfo> getErrorInfos() const;
|
||||
|
||||
void beforeErrorRecording();
|
||||
void afterErrorRecording();
|
||||
|
||||
@@ -244,8 +246,8 @@ private:
|
||||
inline void addFileNodeToGraph(const StorageNode& storageNode, Graph* const graph) const;
|
||||
void addNodeToGraph(
|
||||
const StorageNode& newNode, const NodeType& type, Graph* graph, bool addChildCount) const;
|
||||
void addAggregationEdgesToGraph(
|
||||
Id nodeId, const std::vector<StorageEdge>& edgesToAggregate, Graph* graph) const;
|
||||
void addBundledEdgesToGraph(
|
||||
Id nodeId, const std::vector<StorageEdge>& edgesToBundle, Graph* graph) const;
|
||||
void addFileContentsToGraph(Id fileId, Graph* graph) const;
|
||||
void addComponentAccessToGraph(Graph* graph) const;
|
||||
void addComponentIsAmbiguousToGraph(Graph* graph) const;
|
||||
|
||||
@@ -42,7 +42,67 @@ std::set<FilePath> SourceGroupCustomCommand::getAllSourceFilePaths() const
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCustomCommand::getIndexerCommands(
|
||||
const RefreshInfo& info) const
|
||||
{
|
||||
const std::wstring customCommand = m_settings->getCustomCommand();
|
||||
std::vector<std::wstring> parts;
|
||||
{
|
||||
const std::wstring customCommand = m_settings->getCustomCommand();
|
||||
|
||||
std::wstring tmp;
|
||||
int quoteCount = 0;
|
||||
bool inQuote = false;
|
||||
// handle quoting. tokens can be surrounded by double quotes
|
||||
// "hello world". three consecutive double quotes represent
|
||||
// the quote character itself.
|
||||
for (int i = 0; i < customCommand.size(); ++i)
|
||||
{
|
||||
if (customCommand.at(i) == L'"')
|
||||
{
|
||||
++quoteCount;
|
||||
if (quoteCount == 3) // third consecutive quote
|
||||
{
|
||||
quoteCount = 0;
|
||||
tmp += customCommand.at(i);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (quoteCount)
|
||||
{
|
||||
if (quoteCount == 1)
|
||||
{
|
||||
inQuote = !inQuote;
|
||||
}
|
||||
quoteCount = 0;
|
||||
}
|
||||
if (!inQuote && customCommand.at(i) == L' ')
|
||||
{
|
||||
if (!tmp.empty())
|
||||
{
|
||||
parts.push_back(tmp);
|
||||
tmp.clear();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tmp += customCommand.at(i);
|
||||
}
|
||||
}
|
||||
if (!tmp.empty())
|
||||
{
|
||||
parts.push_back(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
if (parts.empty())
|
||||
{
|
||||
return {};
|
||||
}
|
||||
|
||||
const std::wstring command = parts.front();
|
||||
std::vector<std::wstring> args;
|
||||
for (size_t i = 1; i < parts.size(); i++)
|
||||
{
|
||||
args.push_back(parts[i]);
|
||||
}
|
||||
|
||||
const bool runInParallel = m_settings->getRunInParallel();
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
|
||||
@@ -51,7 +111,8 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCustomCommand::getIndexe
|
||||
if (info.filesToIndex.find(sourcePath) != info.filesToIndex.end())
|
||||
{
|
||||
indexerCommands.push_back(std::make_shared<IndexerCommandCustom>(
|
||||
customCommand,
|
||||
command,
|
||||
args,
|
||||
m_settings->getProjectSettings()->getProjectFilePath(),
|
||||
m_settings->getProjectSettings()->getTempDBFilePath(),
|
||||
std::to_wstring(SqliteIndexStorage::getStorageVersion()),
|
||||
|
||||
@@ -678,6 +678,16 @@ void ApplicationSettings::setLastFilepickerLocation(const FilePath& path)
|
||||
setValue<std::wstring>("user/last_filepicker_location", path.wstr());
|
||||
}
|
||||
|
||||
float ApplicationSettings::getGraphZoomLevel() const
|
||||
{
|
||||
return getValue<float>("user/graph_zoom_level", 1.0f);
|
||||
}
|
||||
|
||||
void ApplicationSettings::setGraphZoomLevel(float zoomLevel)
|
||||
{
|
||||
setValue<float>("user/graph_zoom_level", zoomLevel);
|
||||
}
|
||||
|
||||
int ApplicationSettings::getPluginPort() const
|
||||
{
|
||||
return getValue<int>("network/plugin_port", 6666);
|
||||
|
||||
@@ -181,6 +181,9 @@ public:
|
||||
FilePath getLastFilepickerLocation() const;
|
||||
void setLastFilepickerLocation(const FilePath& path);
|
||||
|
||||
float getGraphZoomLevel() const;
|
||||
void setGraphZoomLevel(float zoomLevel);
|
||||
|
||||
// network
|
||||
int getPluginPort() const;
|
||||
void setPluginPort(const int pluginPort);
|
||||
|
||||
@@ -426,16 +426,6 @@ std::wstring FilePath::wstr() const
|
||||
return m_path->generic_wstring();
|
||||
}
|
||||
|
||||
std::string FilePath::getBackslashedString() const
|
||||
{
|
||||
return utility::replace(str(), "/", "\\");
|
||||
}
|
||||
|
||||
std::wstring FilePath::getBackslashedWString() const
|
||||
{
|
||||
return utility::replace(wstr(), L"/", L"\\");
|
||||
}
|
||||
|
||||
std::wstring FilePath::fileName() const
|
||||
{
|
||||
return m_path->filename().generic_wstring();
|
||||
|
||||
@@ -52,8 +52,6 @@ public:
|
||||
|
||||
std::string str() const;
|
||||
std::wstring wstr() const;
|
||||
std::string getBackslashedString() const;
|
||||
std::wstring getBackslashedWString() const;
|
||||
std::wstring fileName() const;
|
||||
|
||||
std::wstring extension() const;
|
||||
|
||||
@@ -18,7 +18,7 @@ public:
|
||||
}
|
||||
|
||||
MessageActivateTokens(const MessageBase* other)
|
||||
: isEdge(false), isAggregation(false), isFromSearch(false)
|
||||
: isEdge(false), isBundledEdges(false), isFromSearch(false)
|
||||
{
|
||||
setIsParallel(true);
|
||||
setKeepContent(other->keepContent());
|
||||
@@ -43,10 +43,10 @@ public:
|
||||
|
||||
std::vector<SearchMatch> getSearchMatches() const override
|
||||
{
|
||||
if (isAggregation)
|
||||
if (isBundledEdges)
|
||||
{
|
||||
SearchMatch match;
|
||||
match.name = match.text = L"aggregation"; // TODO: show aggregation source and target
|
||||
match.name = match.text = L"bundled edges"; // TODO: show bundled edges source and target
|
||||
match.searchType = SearchMatch::SEARCH_TOKEN;
|
||||
match.nodeType = NodeType(NODE_TYPE);
|
||||
return {match};
|
||||
@@ -59,7 +59,7 @@ public:
|
||||
std::vector<SearchMatch> searchMatches;
|
||||
|
||||
bool isEdge;
|
||||
bool isAggregation;
|
||||
bool isBundledEdges;
|
||||
bool isFromSearch;
|
||||
};
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ public:
|
||||
, sourceNameHierarchy(sourceNameHierarchy)
|
||||
, targetNameHierarchy(targetNameHierarchy)
|
||||
{
|
||||
if (!isAggregation())
|
||||
if (!isBundledEdges())
|
||||
{
|
||||
setKeepContent(true);
|
||||
}
|
||||
@@ -35,9 +35,9 @@ public:
|
||||
return "MessageActivateEdge";
|
||||
}
|
||||
|
||||
bool isAggregation() const
|
||||
bool isBundledEdges() const
|
||||
{
|
||||
return type == Edge::EDGE_AGGREGATION;
|
||||
return type == Edge::EDGE_BUNDLED_EDGES;
|
||||
}
|
||||
|
||||
std::wstring getFullName() const
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
const NameHierarchy sourceNameHierarchy;
|
||||
const NameHierarchy targetNameHierarchy;
|
||||
|
||||
std::vector<Id> aggregationIds;
|
||||
std::vector<Id> bundledEdgesIds;
|
||||
};
|
||||
|
||||
#endif // MESSAGE_ACTIVATE_EDGE_H
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
#ifndef MESSAGE_SAVE_AS_IMAGE_H
|
||||
#define MESSAGE_SAVE_AS_IMAGE_H
|
||||
|
||||
#include "Message.h"
|
||||
|
||||
|
||||
class MessageSaveAsImage: public Message<MessageSaveAsImage>
|
||||
{
|
||||
public:
|
||||
MessageSaveAsImage(QString path) : path(path) {}
|
||||
|
||||
static const std::string getStaticType()
|
||||
{
|
||||
return "MessageSaveAsImage";
|
||||
}
|
||||
|
||||
QString path;
|
||||
};
|
||||
|
||||
#endif /* MESSAGE_SAVE_AS_IMAGE_H */
|
||||
@@ -1,6 +1,7 @@
|
||||
#ifndef UTILITY_LIBRARY_H
|
||||
#define UTILITY_LIBRARY_H
|
||||
|
||||
#include <QDir>
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
@@ -23,8 +24,8 @@ std::function<Ret(Args...)> loadFunctionFromLibrary(
|
||||
const FilePath& libraryPath, const std::string& functionName, std::string& errorString)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
const std::string libraryPathString = libraryPath.getBackslashedString();
|
||||
HINSTANCE handle = LoadLibrary(libraryPathString.c_str());
|
||||
QString libraryPathString = QDir::toNativeSeparators(QString::fromStdWString(libraryPath.wstr()));
|
||||
HINSTANCE handle = LoadLibrary(libraryPathString.toStdString().c_str());
|
||||
if (handle == nullptr)
|
||||
{
|
||||
DWORD errorCode = GetLastError();
|
||||
@@ -53,8 +54,8 @@ std::function<Ret(Args...)> loadFunctionFromLibrary(
|
||||
|
||||
LocalFree(messageBuffer);
|
||||
|
||||
errorString = "Could not load library \"" + libraryPathString + "\" because of " +
|
||||
errorReasonString;
|
||||
errorString = "Could not load library \"" + libraryPathString.toStdString() +
|
||||
"\" because of " + errorReasonString;
|
||||
return std::function<Ret(Args...)>();
|
||||
}
|
||||
|
||||
@@ -63,7 +64,7 @@ std::function<Ret(Args...)> loadFunctionFromLibrary(
|
||||
if (!functionId)
|
||||
{
|
||||
errorString = "Could not locate the function \"" + functionName + "\" in library\"" +
|
||||
libraryPathString + "\"";
|
||||
libraryPathString.toStdString() + "\"";
|
||||
return std::function<Ret(Args...)>();
|
||||
}
|
||||
#else
|
||||
|
||||
@@ -320,7 +320,9 @@ void CxxAstVisitorComponentIndexer::visitFieldDecl(clang::FieldDecl* d)
|
||||
{
|
||||
for (clang::FieldDecl* templateFieldDecl: declaringRecordTemplateDecl->fields())
|
||||
{
|
||||
if (d->getName() == templateFieldDecl->getName())
|
||||
if (d->getDeclName().isIdentifier() &&
|
||||
templateFieldDecl->getDeclName().isIdentifier() &&
|
||||
d->getName() == templateFieldDecl->getName())
|
||||
{
|
||||
Id templateFieldId = getOrCreateSymbolId(templateFieldDecl);
|
||||
m_client->recordSymbolKind(templateFieldId, SYMBOL_FIELD);
|
||||
@@ -377,9 +379,12 @@ void CxxAstVisitorComponentIndexer::visitFunctionDecl(clang::FunctionDecl* d)
|
||||
clang::dyn_cast_or_null<clang::FunctionTemplateDecl>(
|
||||
templateMethodDecl))
|
||||
{
|
||||
if (d->getName() == functionTemplateDecl->getName())
|
||||
if (d->getDeclName().isIdentifier() &&
|
||||
functionTemplateDecl->getDeclName().isIdentifier() &&
|
||||
d->getName() == functionTemplateDecl->getName())
|
||||
{
|
||||
Id templateMethodId = getOrCreateSymbolId(functionTemplateDecl);
|
||||
const Id templateMethodId = getOrCreateSymbolId(
|
||||
functionTemplateDecl);
|
||||
m_client->recordSymbolKind(templateMethodId, SYMBOL_METHOD);
|
||||
m_client->recordReference(
|
||||
REFERENCE_TEMPLATE_SPECIALIZATION,
|
||||
@@ -567,7 +572,7 @@ void CxxAstVisitorComponentIndexer::visitUsingDecl(clang::UsingDecl* d)
|
||||
|
||||
void CxxAstVisitorComponentIndexer::visitNonTypeTemplateParmDecl(clang::NonTypeTemplateParmDecl* d)
|
||||
{
|
||||
if (getAstVisitor()->shouldVisitDecl(d) &&
|
||||
if (getAstVisitor()->shouldVisitDecl(d) && d->getDeclName().isIdentifier() &&
|
||||
!d->getName().empty()) // We don't create symbols for unnamed template parameters.
|
||||
{
|
||||
m_client->recordLocalSymbol(
|
||||
@@ -577,7 +582,7 @@ void CxxAstVisitorComponentIndexer::visitNonTypeTemplateParmDecl(clang::NonTypeT
|
||||
|
||||
void CxxAstVisitorComponentIndexer::visitTemplateTypeParmDecl(clang::TemplateTypeParmDecl* d)
|
||||
{
|
||||
if (getAstVisitor()->shouldVisitDecl(d) &&
|
||||
if (getAstVisitor()->shouldVisitDecl(d) && d->getDeclName().isIdentifier() &&
|
||||
!d->getName().empty()) // We don't create symbols for unnamed template parameters.
|
||||
{
|
||||
m_client->recordLocalSymbol(
|
||||
@@ -587,7 +592,7 @@ void CxxAstVisitorComponentIndexer::visitTemplateTypeParmDecl(clang::TemplateTyp
|
||||
|
||||
void CxxAstVisitorComponentIndexer::visitTemplateTemplateParmDecl(clang::TemplateTemplateParmDecl* d)
|
||||
{
|
||||
if (getAstVisitor()->shouldVisitDecl(d) &&
|
||||
if (getAstVisitor()->shouldVisitDecl(d) && d->getDeclName().isIdentifier() &&
|
||||
!d->getName().empty()) // We don't create symbols for unnamed template parameters.
|
||||
{
|
||||
m_client->recordLocalSymbol(
|
||||
|
||||
@@ -225,32 +225,32 @@ std::vector<std::shared_ptr<IndexerCommandCxx>> Project::getIndexerCommands(
|
||||
sourceGroupSettings->getFrameworkSearchPathsExpandedAndAbsolute(),
|
||||
appSettings->getFrameworkSearchPathsExpanded());
|
||||
|
||||
OrderedCache<std::wstring, std::vector<std::wstring>> optionsCache(
|
||||
[&](const std::wstring& targetName) {
|
||||
std::vector<std::wstring> compilerFlags;
|
||||
for (std::shared_ptr<Target> target: m_targets)
|
||||
OrderedCache<std::wstring, std::vector<std::wstring>> optionsCache([&](const std::wstring& targetName) {
|
||||
std::vector<std::wstring> compilerFlags;
|
||||
for (std::shared_ptr<Target> target: m_targets)
|
||||
{
|
||||
if (target && target->getTitle() == targetName)
|
||||
{
|
||||
if (target->getTitle() == targetName)
|
||||
if (std::shared_ptr<const Compiler> compiler = target->getCompiler())
|
||||
{
|
||||
compilerFlags = utility::concat(
|
||||
IndexerCommandCxx::getCompilerFlagsForSystemHeaderSearchPaths(
|
||||
utility::convert<std::wstring, FilePath>(
|
||||
target->getCompiler()->getDirectories())),
|
||||
target->getCompiler()->getOptions());
|
||||
utility::convert<std::wstring, FilePath>(compiler->getDirectories())),
|
||||
compiler->getOptions());
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
utility::append(
|
||||
compilerFlags,
|
||||
IndexerCommandCxx::getCompilerFlagsForSystemHeaderSearchPaths(
|
||||
systemHeaderSearchPaths));
|
||||
utility::append(
|
||||
compilerFlags,
|
||||
IndexerCommandCxx::getCompilerFlagsForFrameworkSearchPaths(frameworkSearchPaths));
|
||||
utility::append(compilerFlags, sourceGroupSettings->getCompilerFlags());
|
||||
return compilerFlags;
|
||||
});
|
||||
utility::append(
|
||||
compilerFlags,
|
||||
IndexerCommandCxx::getCompilerFlagsForSystemHeaderSearchPaths(systemHeaderSearchPaths));
|
||||
utility::append(
|
||||
compilerFlags,
|
||||
IndexerCommandCxx::getCompilerFlagsForFrameworkSearchPaths(frameworkSearchPaths));
|
||||
utility::append(compilerFlags, sourceGroupSettings->getCompilerFlags());
|
||||
return compilerFlags;
|
||||
});
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommandCxx>> indexerCommands;
|
||||
std::vector<std::shared_ptr<IndexerCommandCxx>> nonTargetIndexerCommands;
|
||||
|
||||
@@ -58,7 +58,12 @@ std::shared_ptr<Target> Target::create(const TiXmlElement* element)
|
||||
{
|
||||
const TiXmlElement* compilerElement = element->FirstChildElement(
|
||||
Compiler::getXmlElementName().c_str());
|
||||
target->m_compiler = Compiler::create(compilerElement);
|
||||
std::shared_ptr<Compiler> compiler = Compiler::create(compilerElement);
|
||||
if (!compiler)
|
||||
{
|
||||
return std::shared_ptr<Target>();
|
||||
}
|
||||
target->m_compiler = compiler;
|
||||
}
|
||||
|
||||
return target;
|
||||
|
||||
@@ -186,6 +186,8 @@ add_files(
|
||||
qt/project_wizard/QtProjectWizardWindow.cpp
|
||||
qt/project_wizard/QtProjectWizardWindow.h
|
||||
|
||||
qt/utility/compatibilityQt.cpp
|
||||
qt/utility/compatibilityQt.h
|
||||
qt/utility/QtContextMenu.cpp
|
||||
qt/utility/QtContextMenu.h
|
||||
qt/utility/QtDeviceScaledPixmap.cpp
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
|
||||
#include <QCoreApplication>
|
||||
#include <QDir>
|
||||
#include <QDirIterator>
|
||||
|
||||
#include "AppPath.h"
|
||||
#include "FilePath.h"
|
||||
@@ -70,6 +71,13 @@ void setupApp(int argc, char* argv[])
|
||||
utility::copyNewFilesFromDirectory(
|
||||
QString::fromStdWString(AppPath::getSharedDataPath().concatenate(L"user/").wstr()),
|
||||
userDataPath);
|
||||
|
||||
// Add u+w permissions because the source files may be marked read-only in some distros
|
||||
QDirIterator it(userDataPath, QDir::Files, QDirIterator::Subdirectories);
|
||||
while (it.hasNext()) {
|
||||
QFile f(it.next());
|
||||
f.setPermissions(f.permissions() | QFile::WriteOwner);
|
||||
}
|
||||
}
|
||||
|
||||
#endif // INCLUDES_DEFAULT_H
|
||||
|
||||
@@ -134,7 +134,7 @@ void QtStatusBar::setErrorCount(ErrorCountInfo errorCount)
|
||||
: QLatin1String("")));
|
||||
|
||||
m_errorButton.setMinimumWidth(
|
||||
m_errorButton.fontMetrics().width(QString(m_errorButton.text().size(), 'a')));
|
||||
m_errorButton.fontMetrics().boundingRect(QString(m_errorButton.text().size(), 'a')).width());
|
||||
|
||||
if (errorCount.fatal > 0)
|
||||
{
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "QtContextMenu.h"
|
||||
#include "SourceLocationFile.h"
|
||||
#include "TextCodec.h"
|
||||
#include "compatibilityQt.h"
|
||||
#include "utility.h"
|
||||
#include "utilityApp.h"
|
||||
#include "utilityString.h"
|
||||
@@ -40,7 +41,8 @@ bool MouseWheelOverScrollbarFilter::eventFilter(QObject* obj, QEvent* event)
|
||||
if (event->type() == QEvent::Wheel && scrollbar)
|
||||
{
|
||||
QRect scrollbarArea(scrollbar->pos(), scrollbar->size());
|
||||
QPoint globalMousePos = dynamic_cast<QWheelEvent*>(event)->globalPos();
|
||||
QPoint globalMousePos = utility::compatibility::QWheelEvent_globalPos(
|
||||
*dynamic_cast<QWheelEvent*>(event));
|
||||
QPoint localMousePos = scrollbar->mapFromGlobal(globalMousePos);
|
||||
|
||||
// instead of "scrollbar->underMouse()" we need this check implemented here because
|
||||
@@ -294,7 +296,7 @@ int QtCodeArea::lineNumberAreaWidth() const
|
||||
{
|
||||
if (m_showLineNumbers)
|
||||
{
|
||||
return fontMetrics().width(QLatin1Char('9')) * m_digits + 30;
|
||||
return fontMetrics().boundingRect(QLatin1Char('9')).width() * m_digits + 30;
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -643,7 +645,8 @@ bool QtCodeArea::moveFocusToLine(int lineNumber, int targetColumn, bool up)
|
||||
{
|
||||
while (true)
|
||||
{
|
||||
if (lineNumber < getStartLineNumber() || lineNumber > getEndLineNumber())
|
||||
if (static_cast<size_t>(lineNumber) < getStartLineNumber() ||
|
||||
static_cast<size_t>(lineNumber) > getEndLineNumber())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ QtCodeField::QtCodeField(
|
||||
QFont font(appSettings->getFontName().c_str());
|
||||
font.setPixelSize(appSettings->getFontSize());
|
||||
setFont(font);
|
||||
setTabStopWidth(appSettings->getCodeTabWidth() * fontMetrics().width('9'));
|
||||
setTabStopDistance(appSettings->getCodeTabWidth() * fontMetrics().boundingRect('9').width());
|
||||
|
||||
m_openInTabAction = new QAction(
|
||||
QStringLiteral("Open in New Tab (Ctrl + Shift + Left Click)"), this);
|
||||
@@ -123,15 +123,15 @@ QSize QtCodeField::sizeHint() const
|
||||
QRectF rect = blockBoundingGeometry(block);
|
||||
height += rect.height();
|
||||
|
||||
int blockWidth = fm.boundingRect(
|
||||
0,
|
||||
0,
|
||||
1000000,
|
||||
1000000,
|
||||
Qt::AlignLeft | Qt::AlignTop | Qt::TextExpandTabs,
|
||||
block.text(),
|
||||
tabStopWidth())
|
||||
.width();
|
||||
const int blockWidth = fm.boundingRect(
|
||||
0,
|
||||
0,
|
||||
1000000,
|
||||
1000000,
|
||||
Qt::AlignLeft | Qt::AlignTop | Qt::TextExpandTabs,
|
||||
block.text(),
|
||||
static_cast<int>(tabStopDistance()))
|
||||
.width();
|
||||
|
||||
width = std::max(blockWidth, width);
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ QtCodeFile::QtCodeFile(const FilePath& filePath, QtCodeNavigator* navigator, boo
|
||||
setSizePolicy(QSizePolicy::Ignored, QSizePolicy::Fixed);
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
layout->setAlignment(Qt::AlignTop);
|
||||
setLayout(layout);
|
||||
|
||||
@@ -36,7 +36,7 @@ QtCodeFileSingle::QtCodeFileSingle(QtCodeNavigator* navigator, QWidget* parent)
|
||||
m_areaWrapper->setSizePolicy(
|
||||
m_areaWrapper->sizePolicy().horizontalPolicy(), QSizePolicy::Expanding);
|
||||
m_areaWrapper->setLayout(new QVBoxLayout());
|
||||
m_areaWrapper->layout()->setMargin(0);
|
||||
m_areaWrapper->layout()->setContentsMargins(0, 0, 0, 0);
|
||||
m_areaWrapper->layout()->setSpacing(0);
|
||||
layout()->addWidget(m_areaWrapper);
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ QtCodeFileTitleBar::QtCodeFileTitleBar(QWidget* parent, bool isHovering, bool is
|
||||
}
|
||||
|
||||
QHBoxLayout* titleLayout = new QHBoxLayout();
|
||||
titleLayout->setMargin(0);
|
||||
titleLayout->setContentsMargins(0, 0, 0, 0);
|
||||
titleLayout->setSpacing(0);
|
||||
titleLayout->setAlignment(Qt::AlignLeft);
|
||||
setLayout(titleLayout);
|
||||
|
||||
@@ -219,8 +219,8 @@ void QtCodeNavigator::updateReferenceCount(
|
||||
}
|
||||
|
||||
m_refLabel->setMinimumWidth(
|
||||
m_refLabel->fontMetrics().width(
|
||||
QString(QString::number(referenceCount).size() * 2, 'a') + "/ references") +
|
||||
m_refLabel->fontMetrics().boundingRect(
|
||||
QString(QString::number(referenceCount).size() * 2, 'a') + "/ references").width() +
|
||||
30);
|
||||
|
||||
m_prevReferenceButton->setEnabled(referenceCount > 1);
|
||||
@@ -239,8 +239,8 @@ void QtCodeNavigator::updateReferenceCount(
|
||||
}
|
||||
|
||||
m_localRefLabel->setMinimumWidth(
|
||||
m_localRefLabel->fontMetrics().width(
|
||||
QString(QString::number(localReferenceCount).size() * 2, 'a') + "/ local references") +
|
||||
m_localRefLabel->fontMetrics().boundingRect(
|
||||
QString(QString::number(localReferenceCount).size() * 2, 'a') + "/ local references").width() +
|
||||
30);
|
||||
|
||||
m_nextLocalReferenceButton->setVisible(localReferenceCount > 1);
|
||||
|
||||
@@ -24,7 +24,7 @@ QtCodeSnippet::QtCodeSnippet(const CodeSnippetParams& params, QtCodeNavigator* n
|
||||
setObjectName(QStringLiteral("code_snippet"));
|
||||
|
||||
QVBoxLayout* layout = new QVBoxLayout(this);
|
||||
layout->setMargin(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
layout->setAlignment(Qt::AlignTop);
|
||||
setLayout(layout);
|
||||
@@ -268,7 +268,7 @@ void QtCodeSnippet::clickedFooter()
|
||||
QtHoverButton* QtCodeSnippet::createScopeLine(QBoxLayout* layout)
|
||||
{
|
||||
QHBoxLayout* lineLayout = new QHBoxLayout();
|
||||
lineLayout->setMargin(0);
|
||||
lineLayout->setContentsMargins(0, 0, 0, 0);
|
||||
lineLayout->setSpacing(0);
|
||||
lineLayout->setAlignment(Qt::AlignLeft);
|
||||
layout->addLayout(lineLayout);
|
||||
|
||||
@@ -22,7 +22,7 @@ QtNewsWidget::QtNewsWidget(QWidget* parent): QWidget(parent)
|
||||
m_text = new QtTextEdit();
|
||||
m_text->setObjectName(QStringLiteral("textField"));
|
||||
m_text->setReadOnly(true);
|
||||
m_text->setTabStopWidth(8 * m_text->fontMetrics().width('9'));
|
||||
m_text->setTabStopDistance(8 * m_text->fontMetrics().boundingRect('9').width());
|
||||
m_text->setViewportMargins(6, 4, 16, 4);
|
||||
m_text->setOpenExternalLinks(true);
|
||||
layout->addWidget(m_text);
|
||||
|
||||
@@ -80,7 +80,8 @@ QtHistoryItem::QtHistoryItem(const SearchMatch& match, size_t index, bool isCurr
|
||||
QSize QtHistoryItem::getSizeHint() const
|
||||
{
|
||||
return QSize(
|
||||
m_name->fontMetrics().width(m_name->text()) + 40, m_name->fontMetrics().height() + 8);
|
||||
m_name->fontMetrics().boundingRect(m_name->text()).width() + 40,
|
||||
m_name->fontMetrics().height() + 8);
|
||||
}
|
||||
|
||||
const SearchMatch& QtHistoryItem::getMatch() const
|
||||
|
||||
@@ -336,7 +336,7 @@ void QtAutocompletionDelegate::calculateCharSizes(QFont font)
|
||||
m_font1 = font;
|
||||
|
||||
QFontMetrics metrics1(font);
|
||||
m_charWidth1 = metrics1.width(QStringLiteral(
|
||||
m_charWidth1 = metrics1.boundingRect(QStringLiteral(
|
||||
"---------------------------------------------------------------------------"
|
||||
"-------------------------"
|
||||
"---------------------------------------------------------------------------"
|
||||
@@ -346,7 +346,8 @@ void QtAutocompletionDelegate::calculateCharSizes(QFont font)
|
||||
"---------------------------------------------------------------------------"
|
||||
"-------------------------"
|
||||
"---------------------------------------------------------------------------"
|
||||
"-------------------------")) /
|
||||
"-------------------------"))
|
||||
.width() /
|
||||
500.0f;
|
||||
m_charHeight1 = static_cast<float>(metrics1.height());
|
||||
|
||||
@@ -354,7 +355,7 @@ void QtAutocompletionDelegate::calculateCharSizes(QFont font)
|
||||
m_font2 = font;
|
||||
|
||||
QFontMetrics metrics2(font);
|
||||
m_charWidth2 = metrics2.width(QStringLiteral(
|
||||
m_charWidth2 = metrics2.boundingRect(QStringLiteral(
|
||||
"---------------------------------------------------------------------------"
|
||||
"-------------------------"
|
||||
"---------------------------------------------------------------------------"
|
||||
@@ -364,7 +365,8 @@ void QtAutocompletionDelegate::calculateCharSizes(QFont font)
|
||||
"---------------------------------------------------------------------------"
|
||||
"-------------------------"
|
||||
"---------------------------------------------------------------------------"
|
||||
"-------------------------")) /
|
||||
"-------------------------"))
|
||||
.width() /
|
||||
500.0f;
|
||||
m_charHeight2 = static_cast<float>(metrics2.height());
|
||||
|
||||
|
||||
@@ -901,7 +901,7 @@ void QtSmartSearchBox::layoutElements()
|
||||
if (!hasSelected && i == m_cursorIndex)
|
||||
{
|
||||
editX = x - 5;
|
||||
x += fontMetrics().width(text());
|
||||
x += fontMetrics().horizontalAdvance(text());
|
||||
}
|
||||
|
||||
if (i < m_elements.size())
|
||||
@@ -923,7 +923,7 @@ void QtSmartSearchBox::layoutElements()
|
||||
}
|
||||
}
|
||||
|
||||
int cursorX = fontMetrics().width(text().left(cursorPosition()));
|
||||
int cursorX = fontMetrics().horizontalAdvance(text().left(cursorPosition()));
|
||||
int offsetX = m_oldLayoutOffset;
|
||||
|
||||
if (x < width())
|
||||
|
||||
@@ -91,19 +91,21 @@ void GraphFocusHandler::focusTokenId(
|
||||
void GraphFocusHandler::refocusNode(
|
||||
const std::list<QtGraphNode*>& newNodes, Id oldActiveTokenId, Id newActiveTokenId)
|
||||
{
|
||||
const Id lastFocusId = m_lastFocusId;
|
||||
clear();
|
||||
|
||||
if (lastFocusId && (lastFocusId == newActiveTokenId || oldActiveTokenId == newActiveTokenId))
|
||||
if (m_lastFocusId && (m_lastFocusId == newActiveTokenId || oldActiveTokenId == newActiveTokenId))
|
||||
{
|
||||
QtGraphNode* nodeToFocus = QtGraphNode::findNodeRecursive(newNodes, lastFocusId);
|
||||
QtGraphNode* nodeToFocus = QtGraphNode::findNodeRecursive(newNodes, m_lastFocusId);
|
||||
if (nodeToFocus)
|
||||
{
|
||||
m_focusNode = nodeToFocus;
|
||||
m_lastFocusId = lastFocusId;
|
||||
nodeToFocus->setIsFocused(true);
|
||||
if (m_focusNode != nodeToFocus)
|
||||
{
|
||||
m_focusNode = nodeToFocus;
|
||||
nodeToFocus->setIsFocused(true);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
clear();
|
||||
}
|
||||
|
||||
void GraphFocusHandler::focusNext(Direction direction, bool navigateEdges)
|
||||
@@ -180,6 +182,11 @@ void GraphFocusHandler::focusNode(QtGraphNode* node)
|
||||
|
||||
void GraphFocusHandler::defocusNode(QtGraphNode* node)
|
||||
{
|
||||
if (node != m_focusNode)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
QtGraphNode* parent = node->getParent();
|
||||
while (parent && !parent->isFocusable())
|
||||
{
|
||||
@@ -399,7 +406,7 @@ QtGraphEdge* GraphFocusHandler::findNextEdge(QPointF pos, Direction direction, Q
|
||||
qreal distXMult = vertical ? 2.0 : 1.0;
|
||||
qreal distYMult = vertical ? 1.0 : 2.0;
|
||||
|
||||
// only use one dimension for distance calculation in aggregation graphs to not miss
|
||||
// only use one dimension for distance calculation in bundled edges graphs to not miss
|
||||
// certain edges
|
||||
if (edge->isBezierEdge() && m_client->getGraphNodes().size() == 2)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@
|
||||
QtGraphicsView::QtGraphicsView(GraphFocusHandler* focusHandler, QWidget* parent)
|
||||
: QGraphicsView(parent)
|
||||
, m_focusHandler(focusHandler)
|
||||
, m_zoomFactor(1.0f)
|
||||
, m_zoomFactor(ApplicationSettings::getInstance()->getGraphZoomLevel())
|
||||
, m_appZoomFactor(1.0f)
|
||||
, m_zoomInButtonSpeed(20.0f)
|
||||
, m_zoomOutButtonSpeed(-20.0f)
|
||||
@@ -166,6 +166,8 @@ QtGraphicsView::QtGraphicsView(GraphFocusHandler* focusHandler, QWidget* parent)
|
||||
m_legendButton->setObjectName(QStringLiteral("legend_button"));
|
||||
m_legendButton->setToolTip(QStringLiteral("show legend"));
|
||||
connect(m_legendButton, &QPushButton::clicked, this, &QtGraphicsView::legendClicked);
|
||||
|
||||
m_tabId = TabId::currentTab();
|
||||
}
|
||||
|
||||
float QtGraphicsView::getZoomFactor() const
|
||||
@@ -183,6 +185,8 @@ void QtGraphicsView::setSceneRect(const QRectF& rect)
|
||||
{
|
||||
QGraphicsView::setSceneRect(rect);
|
||||
scene()->setSceneRect(rect);
|
||||
m_imageCached = toQImage();
|
||||
m_tabId = TabId::currentTab();
|
||||
}
|
||||
|
||||
QtGraphNode* QtGraphicsView::getNodeAtCursorPosition() const
|
||||
@@ -473,9 +477,9 @@ void QtGraphicsView::wheelEvent(QWheelEvent* event)
|
||||
|
||||
if (zoomDefault != (shiftPressed | ctrlPressed))
|
||||
{
|
||||
if (event->delta() != 0.0f)
|
||||
if (event->angleDelta().y() != 0.0f)
|
||||
{
|
||||
updateZoom(static_cast<float>(event->delta()));
|
||||
updateZoom(static_cast<float>(event->angleDelta().y()));
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -724,7 +728,6 @@ void QtGraphicsView::exportGraph()
|
||||
QStringLiteral("PNG (*.png);;JPEG (*.JPEG);;BMP Files (*.bmp);;SVG (*.svg)"))
|
||||
.toStdWString());
|
||||
|
||||
|
||||
if (filePath.extension() == L".svg")
|
||||
{
|
||||
QSvgGenerator svgGen;
|
||||
@@ -835,6 +838,10 @@ void QtGraphicsView::setZoomFactor(float zoomFactor)
|
||||
{
|
||||
m_zoomFactor = zoomFactor;
|
||||
|
||||
std::shared_ptr<ApplicationSettings> settings = ApplicationSettings::getInstance();
|
||||
settings->setGraphZoomLevel(zoomFactor);
|
||||
settings->save();
|
||||
|
||||
m_zoomState->setText(QString::number(int(m_zoomFactor * 100)) + "%");
|
||||
updateTransform();
|
||||
|
||||
@@ -848,3 +855,11 @@ void QtGraphicsView::updateTransform()
|
||||
float zoomFactor = m_appZoomFactor * m_zoomFactor;
|
||||
setTransform(QTransform(zoomFactor, 0, 0, zoomFactor, 0, 0));
|
||||
}
|
||||
|
||||
void QtGraphicsView::handleMessage(MessageSaveAsImage* message)
|
||||
{
|
||||
if ( (message->getSchedulerId() == getSchedulerId()) && !m_imageCached.isNull() )
|
||||
{
|
||||
m_imageCached.save(message->path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,9 @@
|
||||
#include <QGraphicsView>
|
||||
|
||||
#include "types.h"
|
||||
#include "MessageListener.h"
|
||||
#include "MessageSaveAsImage.h"
|
||||
|
||||
|
||||
class GraphFocusHandler;
|
||||
class QPushButton;
|
||||
@@ -14,7 +17,7 @@ class QtGraphEdge;
|
||||
class QtGraphNode;
|
||||
class QtSelfRefreshIconButton;
|
||||
|
||||
class QtGraphicsView: public QGraphicsView
|
||||
class QtGraphicsView: public QGraphicsView, public MessageListener<MessageSaveAsImage>
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -33,6 +36,11 @@ public:
|
||||
|
||||
void updateZoom(float delta);
|
||||
|
||||
Id getSchedulerId() const override
|
||||
{
|
||||
return m_tabId;
|
||||
}
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent* event);
|
||||
|
||||
@@ -90,6 +98,8 @@ private:
|
||||
void setZoomFactor(float zoomFactor);
|
||||
void updateTransform();
|
||||
|
||||
void handleMessage(MessageSaveAsImage* message) override;
|
||||
|
||||
GraphFocusHandler* m_focusHandler;
|
||||
|
||||
QPoint m_last;
|
||||
@@ -141,6 +151,9 @@ private:
|
||||
|
||||
float m_zoomInButtonSpeed;
|
||||
float m_zoomOutButtonSpeed;
|
||||
|
||||
QImage m_imageCached;
|
||||
Id m_tabId;
|
||||
};
|
||||
|
||||
#endif // QT_GRAPHICS_VIEW_H
|
||||
|
||||
@@ -24,7 +24,7 @@ QtCountCircleItem::~QtCountCircleItem() {}
|
||||
|
||||
void QtCountCircleItem::setPosition(const Vec2f& pos)
|
||||
{
|
||||
qreal width = QFontMetrics(m_number->font()).width(m_number->text());
|
||||
qreal width = QFontMetrics(m_number->font()).boundingRect(m_number->text()).width();
|
||||
qreal height = QFontMetrics(m_number->font()).height();
|
||||
|
||||
this->setRadius(height / 2 + 1);
|
||||
|
||||
@@ -19,7 +19,6 @@
|
||||
#include "QtLineItemAngled.h"
|
||||
#include "QtLineItemBezier.h"
|
||||
#include "QtLineItemStraight.h"
|
||||
#include "TokenComponentAggregation.h"
|
||||
#include "TokenComponentInheritanceChain.h"
|
||||
#include "TokenComponentIsAmbiguous.h"
|
||||
#include "utility.h"
|
||||
@@ -51,7 +50,7 @@ QtGraphEdge::QtGraphEdge(
|
||||
bool isActive,
|
||||
bool isInteractive,
|
||||
bool horizontal,
|
||||
TokenComponentAggregation::Direction direction)
|
||||
TokenComponentBundledEdges::Direction direction)
|
||||
: m_focusHandler(focusHandler)
|
||||
, m_data(data)
|
||||
, m_owner(owner)
|
||||
@@ -64,7 +63,7 @@ QtGraphEdge::QtGraphEdge(
|
||||
{
|
||||
this->setCursor(Qt::PointingHandCursor);
|
||||
|
||||
if (m_direction == TokenComponentAggregation::DIRECTION_BACKWARD)
|
||||
if (m_direction == TokenComponentBundledEdges::DIRECTION_BACKWARD)
|
||||
{
|
||||
QtGraphNode* temp = m_owner;
|
||||
m_owner = m_target;
|
||||
@@ -104,7 +103,7 @@ void QtGraphEdge::updateLine()
|
||||
const QtGraphNode* owner = m_owner;
|
||||
const QtGraphNode* target = m_target;
|
||||
|
||||
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_AGGREGATION);
|
||||
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_BUNDLED_EDGES);
|
||||
GraphViewStyle::EdgeStyle style = GraphViewStyle::getStyleForEdgeType(
|
||||
type, m_isActive | m_isCoFocused, m_isFocused, m_isTrailEdge, isAmbiguous());
|
||||
|
||||
@@ -171,7 +170,7 @@ void QtGraphEdge::updateLine()
|
||||
ownerParentRect = rect;
|
||||
}
|
||||
|
||||
bool showArrow = m_direction != TokenComponentAggregation::DIRECTION_NONE;
|
||||
bool showArrow = m_direction != TokenComponentBundledEdges::DIRECTION_NONE;
|
||||
|
||||
QtLineItemBezier* bezier = new QtLineItemBezier(this);
|
||||
m_child = bezier;
|
||||
@@ -260,7 +259,7 @@ void QtGraphEdge::updateLine()
|
||||
child->setEarlyBend(true);
|
||||
}
|
||||
}
|
||||
else if (type != Edge::EDGE_AGGREGATION || owner != ownerNonGroupParent || target != targetNonGroupParent)
|
||||
else if (type != Edge::EDGE_BUNDLED_EDGES || owner != ownerNonGroupParent || target != targetNonGroupParent)
|
||||
{
|
||||
route = QtLineItemBase::ROUTE_HORIZONTAL;
|
||||
}
|
||||
@@ -268,9 +267,9 @@ void QtGraphEdge::updateLine()
|
||||
child->setRoute(route);
|
||||
|
||||
bool showArrow = true;
|
||||
if (type == Edge::EDGE_AGGREGATION)
|
||||
if (type == Edge::EDGE_BUNDLED_EDGES)
|
||||
{
|
||||
showArrow = m_direction != TokenComponentAggregation::DIRECTION_NONE;
|
||||
showArrow = m_direction != TokenComponentBundledEdges::DIRECTION_NONE;
|
||||
}
|
||||
|
||||
if (getData())
|
||||
@@ -332,7 +331,7 @@ void QtGraphEdge::onClick()
|
||||
if (isExpandable())
|
||||
{
|
||||
QtGraphNode* node =
|
||||
(m_direction == TokenComponentAggregation::DIRECTION_BACKWARD ? m_owner : m_target);
|
||||
(m_direction == TokenComponentBundledEdges::DIRECTION_BACKWARD ? m_owner : m_target);
|
||||
if (m_owner->isGroupNode())
|
||||
{
|
||||
node = m_owner;
|
||||
@@ -360,18 +359,18 @@ void QtGraphEdge::onClick()
|
||||
|
||||
MessageActivateEdge msg(
|
||||
getData()->getId(),
|
||||
componentInheritance ? Edge::EDGE_AGGREGATION : getData()->getType(),
|
||||
componentInheritance ? Edge::EDGE_BUNDLED_EDGES : getData()->getType(),
|
||||
getData()->getFrom()->getNameHierarchy(),
|
||||
getData()->getTo()->getNameHierarchy());
|
||||
|
||||
if (getData()->getType() == Edge::EDGE_AGGREGATION)
|
||||
if (getData()->getType() == Edge::EDGE_BUNDLED_EDGES)
|
||||
{
|
||||
msg.aggregationIds = utility::toVector<Id>(
|
||||
getData()->getComponent<TokenComponentAggregation>()->getAggregationIds());
|
||||
msg.bundledEdgesIds = utility::toVector<Id>(
|
||||
getData()->getComponent<TokenComponentBundledEdges>()->getBundledEdgesIds());
|
||||
}
|
||||
else if (componentInheritance)
|
||||
{
|
||||
msg.aggregationIds = componentInheritance->inheritanceEdgeIds;
|
||||
msg.bundledEdgesIds = componentInheritance->inheritanceEdgeIds;
|
||||
}
|
||||
|
||||
msg.dispatch();
|
||||
@@ -397,7 +396,7 @@ void QtGraphEdge::coFocusIn()
|
||||
|
||||
if (s_focusedEdge == this)
|
||||
{
|
||||
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_AGGREGATION);
|
||||
Edge::EdgeType type = (getData() ? getData()->getType() : Edge::EDGE_BUNDLED_EDGES);
|
||||
|
||||
TooltipInfo info;
|
||||
info.title = Edge::getReadableTypeString(type);
|
||||
@@ -407,13 +406,13 @@ void QtGraphEdge::coFocusIn()
|
||||
info.title = L"ambiguous " + info.title;
|
||||
}
|
||||
|
||||
if (type == Edge::EDGE_AGGREGATION &&
|
||||
m_direction == TokenComponentAggregation::DIRECTION_NONE)
|
||||
if (type == Edge::EDGE_BUNDLED_EDGES &&
|
||||
m_direction == TokenComponentBundledEdges::DIRECTION_NONE)
|
||||
{
|
||||
info.title = L"bidirectional " + info.title;
|
||||
}
|
||||
|
||||
if (type == Edge::EDGE_AGGREGATION)
|
||||
if (type == Edge::EDGE_BUNDLED_EDGES)
|
||||
{
|
||||
info.count = static_cast<int>(m_weight);
|
||||
info.countText = "edge";
|
||||
@@ -526,7 +525,7 @@ void QtGraphEdge::hoverLeaveEvent(QGraphicsSceneHoverEvent* event)
|
||||
s_focusedEdge = nullptr;
|
||||
}
|
||||
|
||||
void QtGraphEdge::setDirection(TokenComponentAggregation::Direction direction)
|
||||
void QtGraphEdge::setDirection(TokenComponentBundledEdges::Direction direction)
|
||||
{
|
||||
if (m_direction != direction)
|
||||
{
|
||||
|
||||
@@ -5,11 +5,10 @@
|
||||
|
||||
#include <QGraphicsItem>
|
||||
|
||||
#include "TokenComponentBundledEdges.h"
|
||||
#include "Vector2.h"
|
||||
#include "Vector4.h"
|
||||
|
||||
#include "TokenComponentAggregation.h"
|
||||
|
||||
class Edge;
|
||||
class GraphFocusHandler;
|
||||
class QtGraphNode;
|
||||
@@ -34,7 +33,7 @@ public:
|
||||
bool isActive,
|
||||
bool isInteractive,
|
||||
bool horizontal,
|
||||
TokenComponentAggregation::Direction direction);
|
||||
TokenComponentBundledEdges::Direction direction);
|
||||
virtual ~QtGraphEdge();
|
||||
|
||||
const Edge* getData() const;
|
||||
@@ -60,7 +59,7 @@ public:
|
||||
void coFocusIn();
|
||||
void coFocusOut();
|
||||
|
||||
void setDirection(TokenComponentAggregation::Direction direction);
|
||||
void setDirection(TokenComponentBundledEdges::Direction direction);
|
||||
|
||||
bool isHorizontal() const;
|
||||
bool isExpandable() const;
|
||||
@@ -108,7 +107,7 @@ private:
|
||||
bool m_isHorizontal = false;
|
||||
size_t m_weight = 0;
|
||||
|
||||
TokenComponentAggregation::Direction m_direction;
|
||||
TokenComponentBundledEdges::Direction m_direction;
|
||||
|
||||
bool m_isTrailEdge = false;
|
||||
std::vector<Vec4i> m_path;
|
||||
|
||||
@@ -693,7 +693,7 @@ void QtGraphNode::setStyle(const GraphViewStyle::NodeStyle& style)
|
||||
static_cast<qreal>(style.textOffset.y));
|
||||
|
||||
const float charWidth =
|
||||
QFontMetrics(font).width(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) / 37.0f;
|
||||
QFontMetrics(font).boundingRect(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")).width() / 37.0f;
|
||||
const float charHeight = static_cast<float>(QFontMetrics(font).height());
|
||||
m_matchRect->setRect(
|
||||
static_cast<qreal>(
|
||||
|
||||
@@ -69,7 +69,7 @@ void QtGraphNodeExpandToggle::updateStyle()
|
||||
setStyle(style);
|
||||
|
||||
float textX = static_cast<float>(
|
||||
(m_rect->rect().width() / 2) - (QFontMetrics(m_text->font()).width(m_text->text()) / 2));
|
||||
(m_rect->rect().width() / 2) - (QFontMetrics(m_text->font()).boundingRect(m_text->text()).width() / 2));
|
||||
const float textY = static_cast<float>(
|
||||
m_rect->rect().height() / 2 - QFontMetrics(m_text->font()).height() / 1.8f);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ bool QtGraphNodeQualifier::isQualifierNode() const
|
||||
|
||||
bool QtGraphNodeQualifier::setPosition(const Vec2i& pos)
|
||||
{
|
||||
const int width = QFontMetrics(m_name->font()).width(m_name->text()) + 10;
|
||||
const int width = QFontMetrics(m_name->font()).boundingRect(m_name->text()).width() + 10;
|
||||
const int height = QFontMetrics(m_name->font()).height() + 2;
|
||||
const int arrowWidth = static_cast<int>(height * 0.85);
|
||||
|
||||
@@ -109,7 +109,7 @@ void QtGraphNodeQualifier::updateStyle()
|
||||
|
||||
void QtGraphNodeQualifier::hoverEnterEvent(QGraphicsSceneHoverEvent* event)
|
||||
{
|
||||
const int width = QFontMetrics(m_name->font()).width(m_name->text()) + 10;
|
||||
const int width = QFontMetrics(m_name->font()).boundingRect(m_name->text()).width() + 10;
|
||||
const int height = QFontMetrics(m_name->font()).height() + 2;
|
||||
const int arrowWidth = static_cast<int>(height * 0.85);
|
||||
const float smallFactor = 0.5f;
|
||||
|
||||
@@ -425,16 +425,13 @@ void QtProjectWizardContentPreferences::populate(QGridLayout* layout, int& row)
|
||||
// maven path
|
||||
m_mavenPath = new QtLocationPicker(this);
|
||||
|
||||
if (QSysInfo::windowsVersion() != QSysInfo::WV_None)
|
||||
{
|
||||
m_mavenPath->setFileFilter(QStringLiteral("Maven command (mvn.cmd)"));
|
||||
m_mavenPath->setPlaceholderText(QStringLiteral("<maven_path>/bin/mvn.cmd"));
|
||||
}
|
||||
else
|
||||
{
|
||||
m_mavenPath->setFileFilter(QStringLiteral("Maven command (mvn)"));
|
||||
m_mavenPath->setPlaceholderText(QStringLiteral("<binarypath>/mvn"));
|
||||
}
|
||||
#ifdef WIN32
|
||||
m_mavenPath->setFileFilter(QStringLiteral("Maven command (mvn.cmd)"));
|
||||
m_mavenPath->setPlaceholderText(QStringLiteral("<maven_path>/bin/mvn.cmd"));
|
||||
#else
|
||||
m_mavenPath->setFileFilter(QStringLiteral("Maven command (mvn)"));
|
||||
m_mavenPath->setPlaceholderText(QStringLiteral("<binarypath>/mvn"));
|
||||
#endif
|
||||
|
||||
addLabelAndWidget(QStringLiteral("Maven Path"), m_mavenPath, layout, row);
|
||||
|
||||
|
||||
@@ -25,8 +25,9 @@ void QtProjectWizardContentSelect::populate(QGridLayout* layout, int& row)
|
||||
std::string pythonIndexerVersion = " ";
|
||||
{
|
||||
std::string str = utility::executeProcess(
|
||||
"\"" + ResourcePaths::getPythonPath().str() +
|
||||
"SourcetrailPythonIndexer\" --version",
|
||||
ResourcePaths::getPythonEnvironmentFilePath().wstr(),
|
||||
std::vector<std::wstring> {
|
||||
ResourcePaths::getPythonIndexerFilePath().wstr(), L"--version"},
|
||||
FilePath(),
|
||||
5000)
|
||||
.second;
|
||||
|
||||
+8
-6
@@ -63,12 +63,14 @@ void QtProjectWizardContentPathPythonEnvironment::onTextChanged(const QString& t
|
||||
m_resultLabel->setText("Checking validity of Python environment...");
|
||||
std::thread([=]() {
|
||||
std::pair<int, std::string> out = utility::executeProcess(
|
||||
"\"" + ResourcePaths::getPythonPath().str() +
|
||||
"SourcetrailPythonIndexer\" check-environment " + "--environment-path \"" +
|
||||
utility::getExpandedAndAbsolutePath(
|
||||
FilePath(text.toStdWString()), m_settings->getProjectDirectoryPath())
|
||||
.str() +
|
||||
"\"",
|
||||
ResourcePaths::getPythonEnvironmentFilePath().wstr(),
|
||||
std::vector<std::wstring> {
|
||||
ResourcePaths::getPythonIndexerFilePath().wstr(),
|
||||
L"check-environment",
|
||||
L"--environment-path " +
|
||||
utility::getExpandedAndAbsolutePath(
|
||||
FilePath(text.toStdWString()), m_settings->getProjectDirectoryPath())
|
||||
.wstr()},
|
||||
FilePath(),
|
||||
5000);
|
||||
m_onQtThread([=]() {
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <QClipboard>
|
||||
#include <QContextMenuEvent>
|
||||
#include <QDesktopServices>
|
||||
#include <QDir>
|
||||
#include <QUrl>
|
||||
|
||||
#include "MessageHistoryRedo.h"
|
||||
@@ -118,10 +119,8 @@ void QtContextMenu::redoActionTriggered()
|
||||
|
||||
void QtContextMenu::copyFullPathActionTriggered()
|
||||
{
|
||||
const std::wstring pathString = (QSysInfo::windowsVersion() != QSysInfo::WV_None)
|
||||
? s_filePath.getBackslashedWString()
|
||||
: s_filePath.wstr();
|
||||
QApplication::clipboard()->setText(QString::fromStdWString(pathString));
|
||||
QApplication::clipboard()->setText(
|
||||
QDir::toNativeSeparators(QString::fromStdWString(s_filePath.wstr())));
|
||||
}
|
||||
|
||||
void QtContextMenu::openContainingFolderActionTriggered()
|
||||
|
||||
@@ -76,7 +76,7 @@ QLayoutItem* QtFlowLayout::takeAt(int index)
|
||||
|
||||
Qt::Orientations QtFlowLayout::expandingDirections() const
|
||||
{
|
||||
return 0;
|
||||
return Qt::Orientation::Horizontal | Qt::Orientation::Vertical;
|
||||
}
|
||||
|
||||
bool QtFlowLayout::hasHeightForWidth() const
|
||||
@@ -110,7 +110,10 @@ QSize QtFlowLayout::minimumSize() const
|
||||
size = size.expandedTo(item->minimumSize());
|
||||
}
|
||||
|
||||
size += QSize(2 * margin(), 2 * margin());
|
||||
int left, top, right, bottom;
|
||||
getContentsMargins(&left, &top, &right, &bottom);
|
||||
|
||||
size += QSize(left + right, top + bottom);
|
||||
return size;
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
#include "compatibilityQt.h"
|
||||
|
||||
#include <QtGlobal>
|
||||
|
||||
namespace utility
|
||||
{
|
||||
namespace compatibility
|
||||
{
|
||||
QPoint QWheelEvent_globalPos(const QWheelEvent& event)
|
||||
{
|
||||
#if (QT_VERSION >= QT_VERSION_CHECK(5, 14, 0))
|
||||
return event.globalPosition().toPoint();
|
||||
#else
|
||||
return event.globalPos();
|
||||
#endif
|
||||
}
|
||||
} // namespace compatibility
|
||||
} // namespace utility
|
||||
@@ -0,0 +1,17 @@
|
||||
#ifndef COMPATIBILITY_QT_H
|
||||
#define COMPATIBILITY_QT_H
|
||||
|
||||
#include <QWheelEvent>
|
||||
|
||||
namespace utility
|
||||
{
|
||||
namespace compatibility
|
||||
{
|
||||
// Extracts the global position from a QWheelEvent.
|
||||
// This compatibility wrapper bridges Qt 5.12 and Qt 5.14
|
||||
QPoint QWheelEvent_globalPos(const QWheelEvent& event);
|
||||
|
||||
} // namespace compatibility
|
||||
} // namespace utility
|
||||
|
||||
#endif // COMPATIBILITY_QT_H
|
||||
@@ -243,7 +243,7 @@ QtCustomTrailView::QtCustomTrailView(ViewLayout* viewLayout)
|
||||
Edge::EDGE_TYPE_ARGUMENT,
|
||||
Edge::EDGE_INCLUDE,
|
||||
Edge::EDGE_IMPORT,
|
||||
// Edge::EDGE_AGGREGATION,
|
||||
// Edge::EDGE_BUNDLED_EDGES,
|
||||
Edge::EDGE_MACRO_USAGE,
|
||||
Edge::EDGE_ANNOTATION_USAGE
|
||||
// Edge::EDGE_MEMBER // has separate checkbox
|
||||
|
||||
@@ -390,7 +390,7 @@ void QtGraphView::rebuildGraph(
|
||||
std::set<Id> visibleEdgeIds;
|
||||
for (const std::shared_ptr<DummyEdge>& edge: edges)
|
||||
{
|
||||
if (!edge->data || !edge->data->isType(Edge::EDGE_AGGREGATION))
|
||||
if (!edge->data || !edge->data->isType(Edge::EDGE_BUNDLED_EDGES))
|
||||
{
|
||||
createEdge(
|
||||
view,
|
||||
@@ -404,9 +404,9 @@ void QtGraphView::rebuildGraph(
|
||||
}
|
||||
for (const std::shared_ptr<DummyEdge>& edge: edges)
|
||||
{
|
||||
if (edge->data && edge->data->isType(Edge::EDGE_AGGREGATION))
|
||||
if (edge->data && edge->data->isType(Edge::EDGE_BUNDLED_EDGES))
|
||||
{
|
||||
createAggregationEdge(view, edge.get(), &visibleEdgeIds, !params.disableInteraction);
|
||||
createBundledEdgesEdge(view, edge.get(), &visibleEdgeIds, !params.disableInteraction);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -937,6 +937,8 @@ void QtGraphView::updateTrailButtons()
|
||||
|
||||
void QtGraphView::switchToNewGraphData()
|
||||
{
|
||||
m_focusHandler.refocusNode(m_nodes, 0, 0);
|
||||
|
||||
m_oldGraph = m_graph;
|
||||
|
||||
for (QtGraphNode* node: m_oldNodes)
|
||||
@@ -1201,7 +1203,7 @@ QtGraphEdge* QtGraphView::createEdge(
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
QtGraphEdge* QtGraphView::createAggregationEdge(
|
||||
QtGraphEdge* QtGraphView::createBundledEdgesEdge(
|
||||
QGraphicsView* view, const DummyEdge* edge, std::set<Id>* visibleEdgeIds, bool interactive)
|
||||
{
|
||||
if (!edge->visible)
|
||||
@@ -1210,9 +1212,9 @@ QtGraphEdge* QtGraphView::createAggregationEdge(
|
||||
}
|
||||
|
||||
bool allVisible = true;
|
||||
std::set<Id> aggregationIds =
|
||||
edge->data->getComponent<TokenComponentAggregation>()->getAggregationIds();
|
||||
for (Id edgeId: aggregationIds)
|
||||
std::set<Id> bundledEdgesIds =
|
||||
edge->data->getComponent<TokenComponentBundledEdges>()->getBundledEdgesIds();
|
||||
for (Id edgeId: bundledEdgesIds)
|
||||
{
|
||||
if (visibleEdgeIds->find(edgeId) == visibleEdgeIds->end())
|
||||
{
|
||||
|
||||
@@ -128,7 +128,7 @@ private:
|
||||
QPointF pathOffset,
|
||||
bool useBezier,
|
||||
bool interactive);
|
||||
QtGraphEdge* createAggregationEdge(
|
||||
QtGraphEdge* createBundledEdgesEdge(
|
||||
QGraphicsView* view, const DummyEdge* edge, std::set<Id>* visibleEdgeIds, bool interactive);
|
||||
|
||||
QRectF itemsBoundingRect(const std::list<QtGraphNode*>& items) const;
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
float QtGraphViewStyleImpl::getCharWidth(const std::string& fontName, size_t fontSize)
|
||||
{
|
||||
return QFontMetrics(getFontForStyleType(fontName, fontSize))
|
||||
.width(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")) /
|
||||
.boundingRect(QStringLiteral("QtGraphNode::QtGraphNode::QtGraphNode")).width() /
|
||||
37.0f;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user