Skip to content

Commit

Permalink
refactor: unify plugin library names
Browse files Browse the repository at this point in the history
- Updated plugin library names to follow consistent naming pattern:
  * Changed libdfmplugin-core.so to libdfm-core-plugin.so
  * Updated all plugin library names to use dfm-*-plugin format
- Separated PROJECT_NAME and BIN_NAME in CMake files:
  * PROJECT_NAME remains as dfmplugin-*
  * BIN_NAME set to dfm-*-plugin for output libraries
- Updated references in main applications to use new library names
- Maintained same installation paths and dependencies

Log: This change improves consistency in plugin naming across the project.
  • Loading branch information
Johnson-zs committed Jan 7, 2025
1 parent 3ed6b0c commit af2307e
Show file tree
Hide file tree
Showing 22 changed files with 95 additions and 78 deletions.
2 changes: 1 addition & 1 deletion src/apps/dde-file-dialog-wayland/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static constexpr char kCommonPluginInterface[] { "org.deepin.plugin.common" };
static constexpr char kDialogCorePluginName[] { "filedialog-core-plugin" };
static constexpr char kDialogCoreLibName[] { "libfiledialog-core-plugin.so" };
static constexpr char kDFMCorePluginName[] { "dfmplugin-core" };
static constexpr char kDFMCoreLibName[] { "libdfmplugin-core.so" };
static constexpr char kDFMCoreLibName[] { "libdfm-core-plugin.so" };

static void initLog()
{
Expand Down
2 changes: 1 addition & 1 deletion src/apps/dde-file-dialog-x11/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static constexpr char kCommonPluginInterface[] { "org.deepin.plugin.common" };
static constexpr char kDialogCorePluginName[] { "filedialog-core-plugin" };
static constexpr char kDialogCoreLibName[] { "libfiledialog-core-plugin.so" };
static constexpr char kDFMCorePluginName[] { "dfmplugin-core" };
static constexpr char kDFMCoreLibName[] { "libdfmplugin-core.so" };
static constexpr char kDFMCoreLibName[] { "libdfm-core-plugin.so" };

static void initLog()
{
Expand Down
2 changes: 1 addition & 1 deletion src/apps/dde-file-dialog/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ static constexpr char kCommonPluginInterface[] { "org.deepin.plugin.common" };
static constexpr char kDialogCorePluginName[] { "filedialog-core-plugin" };
static constexpr char kDialogCoreLibName[] { "libfiledialog-core-plugin.so" };
static constexpr char kDFMCorePluginName[] { "dfmplugin-core" };
static constexpr char kDFMCoreLibName[] { "libdfmplugin-core.so" };
static constexpr char kDFMCoreLibName[] { "libdfm-core-plugin.so" };

static void initLog()
{
Expand Down
2 changes: 1 addition & 1 deletion src/apps/dde-file-manager-preview/filepreview/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
// SPDX-License-Identifier: GPL-3.0-or-later

#include "previewsingleapplication.h"

#include <QProcessEnvironment>
#ifdef DFM_ORGANIZATION_NAME
# define ORGANIZATION_NAME DFM_ORGANIZATION_NAME
#else
Expand Down
2 changes: 1 addition & 1 deletion src/apps/dde-file-manager/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ using namespace GlobalDConfDefines::BaseConfig;
static constexpr char kFmPluginInterface[] { "org.deepin.plugin.filemanager" };
static constexpr char kCommonPluginInterface[] { "org.deepin.plugin.common" };
static constexpr char kPluginCore[] { "dfmplugin-core" };
static constexpr char kLibCore[] { "libdfmplugin-core.so" };
static constexpr char kLibCore[] { "libdfm-core-plugin.so" };

static constexpr int kMemoryThreshold { 80 * 1024 }; // 80MB
static constexpr int kTimerInterval { 60 * 1000 }; // 1 min
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/filedialog/core/views/filedialogstatusbar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ void FileDialogStatusBar::updateLayout()
if (curMode == kUnknow)
return;

if (!mainWindow)
if (!mainWindow || !mainWindow->centralWidget())
return;

setVisible(true);
Expand Down Expand Up @@ -358,6 +358,7 @@ void FileDialogStatusBar::updateLayout()

contentLayout->addWidget(curRejectButton);
contentLayout->addWidget(curAcceptButton);

mainWindow->centralWidget()->layout()->addWidget(this);
return;
}
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/filemanager/dfmplugin-avfsbrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-avfsbrowser)
set(BIN_NAME dfm-avfsbrowser-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -11,22 +12,22 @@ FILE(GLOB_RECURSE WORKSPACE_FILES CONFIGURE_DEPENDS
)

find_package(Qt6 COMPONENTS Core)
add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${WORKSPACE_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${BIN_NAME}
DFM6::base
DFM6::framework
)

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
11 changes: 6 additions & 5 deletions src/plugins/filemanager/dfmplugin-computer/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-computer)
set(BIN_NAME dfm-computer-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -14,28 +15,28 @@ find_package(PkgConfig REQUIRED)
pkg_check_modules(Secret REQUIRED libsecret-1)

find_package(Qt6 COMPONENTS Core)
add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${COMPUTER_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_include_directories(${PROJECT_NAME}
target_include_directories(${BIN_NAME}
PUBLIC
${Secret_INCLUDE_DIRS}
)

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${BIN_NAME}
DFM6::base
DFM6::framework
${Secret_LIBRARIES}
)

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/filemanager/dfmplugin-core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-core)
set(BIN_NAME dfm-core-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -11,22 +12,22 @@ FILE(GLOB_RECURSE CORE_FILES CONFIGURE_DEPENDS
)

find_package(Qt6 COMPONENTS Core)
add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${CORE_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${BIN_NAME}
DFM6::base
DFM6::framework
)

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/filemanager/dfmplugin-detailspace/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-detailspace)
set(BIN_NAME dfm-detailspace-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -11,22 +12,22 @@ FILE(GLOB_RECURSE DETAILSPCE_FILES CONFIGURE_DEPENDS
)

find_package(Qt6 COMPONENTS Core)
add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${DETAILSPCE_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${BIN_NAME}
DFM6::base
DFM6::framework
)

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.0)

project(dfmplugin-disk-encrypt LANGUAGES CXX)
set(BIN_NAME dfm-disk-encrypt-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -14,15 +15,15 @@ file(GLOB_RECURSE SRC
"${CMAKE_SOURCE_DIR}/src/services/diskencrypt/globaltypesdefine.h"
)

add_library(${PROJECT_NAME} SHARED ${SRC})
add_library(${BIN_NAME} SHARED ${SRC})

target_link_libraries(${PROJECT_NAME} PRIVATE
target_link_libraries(${BIN_NAME} PRIVATE
DFM6::base
DFM6::framework
)

target_compile_definitions(${PROJECT_NAME} PRIVATE DFMPLUGIN_DISK_ENCRYPT_LIBRARY)
set_target_properties(${PROJECT_NAME} PROPERTIES
target_compile_definitions(${BIN_NAME} PRIVATE DFMPLUGIN_DISK_ENCRYPT_LIBRARY)
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

# 设置翻译文件目录
Expand All @@ -34,16 +35,16 @@ set_source_files_properties(${TS_FILES} PROPERTIES OUTPUT_LOCATION "${CMAKE_CURR
qt6_add_translation(QM_FILES ${TS_FILES})

# 添加自定义目标以确保翻译文件被构建
add_custom_target(${PROJECT_NAME}_translations ALL DEPENDS ${QM_FILES})
add_dependencies(${PROJECT_NAME} ${PROJECT_NAME}_translations)
add_custom_target(${BIN_NAME}_translations ALL DEPENDS ${QM_FILES})
add_dependencies(${BIN_NAME} ${BIN_NAME}_translations)

# 安装
install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${DFM_PLUGIN_FILEMANAGER_CORE_DIR})
install(TARGETS ${BIN_NAME} LIBRARY DESTINATION ${DFM_PLUGIN_FILEMANAGER_CORE_DIR})

# 安装翻译文件
install(FILES ${QM_FILES} DESTINATION share/dde-file-manager/translations)

INSTALL_DCONFIG("org.deepin.dde.file-manager.diskencrypt.json")

message(">>>> install ${PROJECT_NAME} into ${DFM_PLUGIN_FILEMANAGER_CORE_DIR}")
message(">>>> install ${BIN_NAME} into ${DFM_PLUGIN_FILEMANAGER_CORE_DIR}")

Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.0)

project(dfmplugin-encrypt-manager)
set(BIN_NAME dfm-encrypt-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -11,15 +12,15 @@ file(GLOB_RECURSE SRC
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
${CMAKE_CURRENT_SOURCE_DIR}/*.json)

add_library(${PROJECT_NAME} SHARED
add_library(${BIN_NAME} SHARED
${SRC})

set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})
set_target_properties(${BIN_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME} PUBLIC
target_link_libraries(${BIN_NAME} PUBLIC
Qt6::Core
DFM6::base
DFM6::framework
)

install(TARGETS ${PROJECT_NAME} LIBRARY DESTINATION ${DFM_PLUGIN_FILEMANAGER_CORE_DIR})
install(TARGETS ${BIN_NAME} LIBRARY DESTINATION ${DFM_PLUGIN_FILEMANAGER_CORE_DIR})
11 changes: 6 additions & 5 deletions src/plugins/filemanager/dfmplugin-myshares/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-myshares)
set(BIN_NAME dfm-myshares-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -11,24 +12,24 @@ FILE(GLOB_RECURSE SHARES_FILES CONFIGURE_DEPENDS
)

find_package(Qt6 COMPONENTS Core)
add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${SHARES_FILES}
)

add_library(DFMPlugin::myshares ALIAS ${PROJECT_NAME})
add_library(DFMPlugin::myshares ALIAS ${BIN_NAME})

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${BIN_NAME}
DFM6::base
DFM6::framework
)

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/filemanager/dfmplugin-optical/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-optical)
set(BIN_NAME dfm-optical-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -13,15 +14,15 @@ FILE(GLOB_RECURSE OPTICAL_FILES CONFIGURE_DEPENDS
find_package(Qt6 COMPONENTS DBus Widgets Concurrent SvgWidgets REQUIRED)
set(SVGLIB Qt6::Svg)

add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${OPTICAL_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME} PRIVATE
target_link_libraries(${BIN_NAME} PRIVATE
Qt6::Core
Qt6::Widgets
Qt6::DBus
Expand All @@ -33,7 +34,7 @@ target_link_libraries(${PROJECT_NAME} PRIVATE

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
9 changes: 5 additions & 4 deletions src/plugins/filemanager/dfmplugin-recent/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
cmake_minimum_required(VERSION 3.10)

project(dfmplugin-recent)
set(BIN_NAME dfm-recent-plugin)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -18,15 +19,15 @@ qt6_add_dbus_interface(RECENT_FILES
${DFM_DBUS_XML_DIR}/org.deepin.Filemanager.Daemon.RecentManager.xml
recentmanager_interface)

add_library(${PROJECT_NAME}
add_library(${BIN_NAME}
SHARED
${RECENT_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES
set_target_properties(${BIN_NAME} PROPERTIES
LIBRARY_OUTPUT_DIRECTORY ${DFM_BUILD_PLUGIN_FILEMANAGER_DIR})

target_link_libraries(${PROJECT_NAME}
target_link_libraries(${BIN_NAME}
DFM6::base
DFM6::framework
Qt6::Xml
Expand All @@ -35,7 +36,7 @@ target_link_libraries(${PROJECT_NAME}

#install library file
install(TARGETS
${PROJECT_NAME}
${BIN_NAME}
LIBRARY
DESTINATION
${DFM_PLUGIN_FILEMANAGER_CORE_DIR}
Expand Down
Loading

0 comments on commit af2307e

Please sign in to comment.