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 appruntimeitem plugin #756

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

Conversation

wjyrich
Copy link

@wjyrich wjyrich commented Sep 16, 2024

Add a plugin to count application running time and manage application running.

Log: Add a plugin to count application running time and manage application running.

@deepin-ci-robot
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: wjyrich

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

panels/dock/appruntimeitem/CMakeLists.txt Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/CMakeLists.txt Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/appruntimeitem.cpp Show resolved Hide resolved
panels/dock/appruntimeitem/appruntimeitem.cpp Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/appruntimeitem.h Show resolved Hide resolved
panels/dock/appruntimeitem/package/icons/appruntime.svg Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/windowmanager.cpp Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/windowmanager.cpp Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/windowmanager.h Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/xcb_get.cpp Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/xcbgetinfo.h Outdated Show resolved Hide resolved
panels/dock/appruntimeitem/xcbgetinfo.h Outdated Show resolved Hide resolved
@deepin-ci-robot
Copy link

@wjyrich: The /test command needs one or more targets.
The following commands are available to trigger required jobs:

  • /test github-pr-review-ci
  • /test github-trigger-obs-ci

Use /test all to run all jobs.

In response to this:

/test

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@wjyrich wjyrich force-pushed the code1 branch 2 times, most recently from 9178c2d to 77a36df Compare October 12, 2024 08:35
@wjyrich wjyrich force-pushed the code1 branch 2 times, most recently from 82a8515 to b6e0ef0 Compare October 13, 2024 07:31
@deepin-ci-robot
Copy link

deepin pr auto review

diff --git a/panels/dock/appruntimeitem/x11utils.cpp b/panels/dock/appruntimeitem/x11utils.cpp
new file mode 100644
index 000000000..8b9a8d6a0
--- /dev/null
+++ b/panels/dock/appruntimeitem/x11utils.cpp
@@ -0,0 +1,431 @@
+// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
+//
+// SPDX-License-Identifier: GPL-3.0-or-later
+
+#include "x11utils.h"
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include

@wjyrich wjyrich force-pushed the code1 branch 2 times, most recently from 95da17c to 8b3b75d Compare October 17, 2024 06:43
Add a plugin to count application running time and manage application running.

Log: Add a plugin to count application running time and manage application running.
Comment on lines +35 to +41
target_link_libraries(dock-appruntimeitem PRIVATE
dde-shell-frame
${XCB_LIBRARIES}
)
target_link_libraries(dock-appruntimeitem PRIVATE
dde-shell-frame
)
Copy link
Contributor

Choose a reason for hiding this comment

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

这里有重复的link

panels/dock/appruntimeitem/appruntimeitem.cpp Show resolved Hide resolved
panels/dock/appruntimeitem/appruntimeitem.cpp Show resolved Hide resolved
void AppRuntimeItem::setVisible(bool visible)
{
if (m_Visible != visible) {
m_Visible = visible;
Copy link
Contributor

Choose a reason for hiding this comment

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

一般成员变量下划线后面的第一个字母都是小写。


Timer {
id: timer
interval: 1000
Copy link
Contributor

Choose a reason for hiding this comment

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

这个timer太频繁了,没必要这么频繁地更新数据。

Comment on lines +53 to +75
connect(this, &XcbGetInfo::windowEnterChanged, this, &XcbGetInfo::handleEnterEvent);
connect(this, &XcbGetInfo::windowLeaveChanged, this, &XcbGetInfo::handleLeaveEvent);
connect(this, &XcbGetInfo::windowPropertyChanged, this, &XcbGetInfo::handlePropertyNotifyEvent);
connect(this, &XcbGetInfo::windowPropertyChanged, this, &XcbGetInfo::handlePropertyNotifyEvent);

connect(this, &XcbGetInfo::eventFilterWindowCreated, this, &XcbGetInfo::handleCreateNotifyEvent);
connect(this, &XcbGetInfo::eventFilterWindowDestroyed, this, &XcbGetInfo::handleDestroyNotifyEvent);
connect(this, &XcbGetInfo::windowEnterChangedActive, this, [this](xcb_window_t window, const QString name) {
Q_EMIT windowLeaveChangedInactiveName(window, name);
});
connect(this, &XcbGetInfo::windowEnterChangedActive, this, [this](xcb_window_t window, const QString name) {
Q_EMIT windowEnterChangedActiveName(window, name);
});

connect(this, &XcbGetInfo::windowCreatedForeground, this, [this](xcb_window_t window, const QString name) {
Q_EMIT windowInfoChangedForeground(name, window);
});
connect(this, &XcbGetInfo::windowCreated, this, [this](xcb_window_t window, const QString name) {
Q_EMIT windowInfoChanged(name, window);
});
connect(this, &XcbGetInfo::windowDestroyed, this, [this](xcb_window_t window) {
Q_EMIT windowDestroyChanged(window);
});
Copy link
Contributor

Choose a reason for hiding this comment

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

没必要自己连自己的信号去处理事情,应该自己处理完事情之后发出必要暴露给别人的信号。

# SPDX-License-Identifier: GPL-3.0-or-later

if (BUILD_WITH_X11)
find_package(XCB REQUIRED)
Copy link
Contributor

Choose a reason for hiding this comment

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

使用IMPORTED_TARGET

Comment on lines +26 to +27
include_directories(${CMAKE_SOURCE_DIR}/panels/dock)
include_directories(${CMAKE_SOURCE_DIR}/panels/dock/taskmanager)
Copy link
Contributor

Choose a reason for hiding this comment

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

不要使用include_directories,使用target_include_directories

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.

4 participants