Skip to content

Commit

Permalink
fix: change anything service
Browse files Browse the repository at this point in the history
as title

Log: as title
  • Loading branch information
Lighto-Ku authored and Johnson-zs committed Sep 5, 2024
1 parent d1ba0ab commit 10813ec
Show file tree
Hide file tree
Showing 5 changed files with 41 additions and 39 deletions.
15 changes: 8 additions & 7 deletions src/services/anything/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
cmake_minimum_required(VERSION 3.10)

set(BIN_NAME "deepin-anything-service")
project(${BIN_NAME})
project(dde-filemanager-anything)

set(CMAKE_INCLUDE_CURRENT_DIR ON)

Expand All @@ -11,20 +10,22 @@ FILE(GLOB SOURCE_FILES
"${CMAKE_CURRENT_SOURCE_DIR}/*.json"
)

add_executable(${BIN_NAME}
add_library(${PROJECT_NAME}
SHARED
${SOURCE_FILES}
)

set_target_properties(${PROJECT_NAME} PROPERTIES LIBRARY_OUTPUT_DIRECTORY ../../)

find_package(Qt5 COMPONENTS
DBus
REQUIRED
)

target_link_libraries(${BIN_NAME}
target_link_libraries(${PROJECT_NAME}
DFM::framework
)

install(TARGETS ${BIN_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
install(FILES ${BIN_NAME}.json DESTINATION share/deepin-service-manager/other/)
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_LIBDIR}/deepin-service-manager/)
install(FILES ${PROJECT_NAME}.json DESTINATION share/deepin-service-manager/system/)
install(FILES org.deepin.Filemanager.Anything.conf DESTINATION share/dbus-1/system.d/)
install(FILES org.deepin.Filemanager.Anything.service DESTINATION share/dbus-1/system-services/)
7 changes: 7 additions & 0 deletions src/services/anything/dde-filemanager-anything.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"name": "org.deepin.Filemanager.Anything",
"libPath": "libdde-filemanager-anything.so",
"group": "app",
"policyStartType": "Resident",
"pluginType": "qt"
}
4 changes: 0 additions & 4 deletions src/services/anything/deepin-anything-service.json

This file was deleted.

28 changes: 0 additions & 28 deletions src/services/anything/main.cpp

This file was deleted.

26 changes: 26 additions & 0 deletions src/services/anything/plugin.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

#include "anythingserver.h"

static service_anything::AnythingPlugin *anythingServer = nullptr;

extern "C" int DSMRegister(const char *name, void *data)
{
(void)data;
anythingServer = new service_anything::AnythingPlugin();
anythingServer->initialize();
anythingServer->start();
return 0;
}

extern "C" int DSMUnRegister(const char *name, void *data)
{
(void)name;
(void)data;
anythingServer->stop();
anythingServer->deleteLater();
anythingServer = nullptr;
return 0;
}

0 comments on commit 10813ec

Please sign in to comment.