Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add deepinfiledialog theme #188

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kegechen
Copy link
Contributor

compiling deepin file dialog theme without dtk depends

可以方便的编译出非系统 Qt 版本的theme, 方便使用 deepin 风格 filedialog。
当然,还是需要修改一下顶层 CMakeList.txt 去掉其他插件,去掉其中 dtk 的依赖

@kegechen kegechen requested a review from asterwyx August 10, 2023 07:58
compiling deepin file dialog theme without dtk depends
@deepin-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: kegechen

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

qt6_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialogmanager.xml filedialogmanager_interface)
endif()

include(../filedialog/filedialog.cmake)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里如果是为了源码共享,可以使用OBJECT或者INTERFACE的TARGET类型共享

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同下

@@ -0,0 +1,69 @@
/*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这两个文件名最好修改一下。

@@ -7,7 +7,7 @@
#include "filedialogmanager_interface.h"
#include "dthemesettings.h"
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
#include "../3rdparty/qdbustrayicon_p.h"
#include "../../3rdparty/qdbustrayicon_p.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

避免在源码中使用相对目录,使用target_include_directories

Comment on lines +1 to +14
# SPDX-FileCopyrightText: 2023 UnionTech Software Technology Co., Ltd.
#
# SPDX-License-Identifier: LGPL-3.0-or-later

if(QT_VERSION_MAJOR EQUAL 5)
qt5_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialog.xml filedialog_interface)
qt5_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialogmanager.xml filedialogmanager_interface)
else()
qt6_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialog.xml filedialog_interface)
qt6_add_dbus_interface(DBUS_INTERFACES ${CMAKE_CURRENT_LIST_DIR}/xmls/com.deepin.filemanager.filedialogmanager.xml filedialogmanager_interface)
endif()

set(DFM_DLG_HEADERS ${CMAKE_CURRENT_LIST_DIR}/qdeepinfiledialoghelper.h)
set(DFM_DLG_SOURCES ${CMAKE_CURRENT_LIST_DIR}/qdeepinfiledialoghelper.cpp)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

建议使用target的方式共享

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

target 就把俩plugin关联在一起了。 现在这种方式可以只编译一个。没有dtk的依赖。换成target是不是需要带入另外一个theme的编译依赖呢

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

不需要,是这个文件夹里面的内容单独做一个target,两个theme都依赖这一个target。

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

仅仅是使用target的方式共享需要共享的源码,本质上和你这里的cmake一样,但是以target的方式,会更加灵活,不需要依赖于目录。

Comment on lines -30 to -31
#include <DPlatformHandle>
DGUI_USE_NAMESPACE
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里为什么不使用dtkgui的内容呢

Copy link
Contributor Author

@kegechen kegechen Aug 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

就是想要纯粹的文管的filedialog服务,不想引入dtk依赖, 比如一个安装在opt目录下的自带qt 某一个版本的应用(很多,如网易云音乐,有道词典等)需要用我们的文管对话框,这个时候就可以简单的编译deepin-file-dialog的theme来实现

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

但是我记得qdeepinfiledialog本身有dtkwidget的依赖吧

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有。仅仅有的dtkgui的都移除了。
风格插件有dtkwidget的依赖

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我们这整个项目都有dtkwidget的依赖,如果想要单独编出这个插件,还要做一些修改

@asterwyx
Copy link
Contributor

试着跑一下覆盖率脚本,看一下是否能够正常获取信息

@kegechen kegechen requested a review from zccrs August 24, 2023 03:28
@kegechen kegechen marked this pull request as draft August 28, 2023 03:43
@kegechen kegechen removed the approve label Aug 28, 2023
@deepin-bot
Copy link
Contributor

deepin-bot bot commented Mar 11, 2024

TAG Bot

New tag: 5.6.25
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #212

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Mar 27, 2024

TAG Bot

New tag: 5.6.26
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #214

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Apr 23, 2024

TAG Bot

New tag: 5.6.27
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #217

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Apr 30, 2024

TAG Bot

New tag: 5.6.28
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #218

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 16, 2024

TAG Bot

New tag: 5.6.29
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #220

@deepin-bot
Copy link
Contributor

deepin-bot bot commented May 31, 2024

TAG Bot

New tag: 5.6.30
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #223

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Jun 27, 2024

TAG Bot

New tag: 5.6.31
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #225

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Jul 10, 2024

TAG Bot

New tag: 5.6.32
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #229

@deepin-bot
Copy link
Contributor

deepin-bot bot commented Aug 21, 2024

TAG Bot

New tag: 5.6.34
DISTRIBUTION: unstable
Suggest: synchronizing this PR through rebase #239

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants