Skip to content

Commit

Permalink
fix сompatibility with version 2.6.3
Browse files Browse the repository at this point in the history
  • Loading branch information
VPROFi committed Oct 5, 2024
1 parent deea98e commit ec83df9
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 20 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ add_subdirectory(vendor/far2l)

# build plugin
set(PROJECT_SOURCE_DIR ${CMAKE_SOURCE_DIR}/vendor/far2l)
get_directory_property(INSTALL_DIR DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION INSTALL_DIR)
set(FAR_SOURCE_DIR ${CMAKE_SOURCE_DIR}/vendor/far2l)
get_directory_property(INSTALL_DIR DIRECTORY ${FAR_SOURCE_DIR} DEFINITION INSTALL_DIR)

add_subdirectory(src)
28 changes: 14 additions & 14 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ project(processes)
get_directory_property(PROJECT_SOURCE_DIR DIRECTORY ../ DEFINITION PROJECT_SOURCE_DIR)
get_directory_property(INSTALL_DIR DIRECTORY ${PROJECT_SOURCE_DIR} DEFINITION INSTALL_DIR)

message("processes PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR} ${CMAKE_SYSTEM_NAME}")
message(STATUS "${PROJECT_NAME} PROJECT_SOURCE_DIR ${PROJECT_SOURCE_DIR} ${CMAKE_SYSTEM_NAME}")

set(SOURCES
farconnect.cpp
Expand Down Expand Up @@ -46,25 +46,25 @@ if (ARM AND CMAKE_COMPILER_IS_GNUCC)
endif (GCC_HAS_NO_PSABI)
endif ()

add_library(processes MODULE ${SOURCES})
target_link_libraries(processes utils far2l)
add_library(${PROJECT_NAME} MODULE ${SOURCES})
target_link_libraries(${PROJECT_NAME} utils far2l)

target_compile_definitions(processes PRIVATE -DUSEUCD=OFF -DWINPORT_DIRECT -DUNICODE -DFAR_DONT_USE_INTERNALS)
target_compile_definitions(${PROJECT_NAME} PRIVATE -DUSEUCD=OFF -DWINPORT_DIRECT -DUNICODE -DFAR_DONT_USE_INTERNALS)

target_include_directories(processes PRIVATE .)
target_include_directories(processes PRIVATE ./process)
target_include_directories(processes PRIVATE ${PROJECT_SOURCE_DIR}/utils/include)
target_include_directories(processes PRIVATE ${PROJECT_SOURCE_DIR}/far2l/far2sdk)
target_include_directories(processes PRIVATE ${PROJECT_SOURCE_DIR}/far2l/Include)
target_include_directories(processes PRIVATE ${PROJECT_SOURCE_DIR}/WinPort)
target_include_directories(${PROJECT_NAME} PRIVATE .)
target_include_directories(${PROJECT_NAME} PRIVATE ./process)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/utils/include)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/far2l/far2sdk)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/far2l/Include)
target_include_directories(${PROJECT_NAME} PRIVATE ${PROJECT_SOURCE_DIR}/WinPort)

set_target_properties(processes
set_target_properties(${PROJECT_NAME}
PROPERTIES
LIBRARY_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/processes/plug"
LIBRARY_OUTPUT_DIRECTORY "${INSTALL_DIR}/Plugins/${PROJECT_NAME}/plug"
PREFIX ""
SUFFIX ".far-plug-wide")

add_custom_command(TARGET processes POST_BUILD
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/configs
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configs "${INSTALL_DIR}/Plugins/processes"
COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_SOURCE_DIR}/configs "${INSTALL_DIR}/Plugins/${PROJECT_NAME}"
)
8 changes: 4 additions & 4 deletions src/progress.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ void progress::show()
{
if (!_visible) {
_visible = true;
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*)PGS_INDETERMINATE);
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*)PGS_INDETERMINATE, 0);
}

if (_bar.empty()) {
Expand All @@ -60,8 +60,8 @@ void progress::show()
void progress::hide()
{
if (_visible) {
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_PROGRESSNOTIFY, 0);
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*)PGS_NOPROGRESS);
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_PROGRESSNOTIFY, 0, 0);
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_SETPROGRESSSTATE, (void*)PGS_NOPROGRESS, 0);
Plugin::psi.Control(PANEL_ACTIVE, FCTL_REDRAWPANEL, 0, 0);
Plugin::psi.Control(PANEL_PASSIVE, FCTL_REDRAWPANEL, 0, 0);
_visible = false;
Expand All @@ -81,7 +81,7 @@ void progress::update(const uint64_t val)
memset(&pv, 0, sizeof(pv));
pv.Completed = percent;
pv.Total = 100;
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_SETPROGRESSVALUE, &pv);
Plugin::psi.AdvControl(Plugin::psi.ModuleNumber, ACTL_SETPROGRESSVALUE, &pv, 0);

if (_bar.empty())
_bar.resize(PROGRESS_WIDTH);
Expand Down
2 changes: 1 addition & 1 deletion vendor/far2l
Submodule far2l updated 2915 files

0 comments on commit ec83df9

Please sign in to comment.