Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion plugins/application-tray/util.cpp
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand Down Expand Up @@ -316,8 +316,9 @@
xcb_send_event(m_x11connection, false, window, XCB_EVENT_MASK_NO_EVENT, (char *)&ev);
}

QString Util::generateUniqueId(const QString &id)

Check warning on line 319 in plugins/application-tray/util.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'generateUniqueId' is never used.
{
QMutexLocker locker(&m_idMutex);
for (int i = 0; i < 100; i++) {
QString newId = id + "-" + QString::number(i);
if (!m_currentIds.contains(newId)) {
Expand All @@ -330,7 +331,8 @@
return id;
}

void Util::removeUniqueId(const QString &id) {

Check warning on line 334 in plugins/application-tray/util.cpp

View workflow job for this annotation

GitHub Actions / cppcheck

The function 'removeUniqueId' is never used.
QMutexLocker locker(&m_idMutex);
m_currentIds.remove(id);
}

Expand Down
4 changes: 3 additions & 1 deletion plugins/application-tray/util.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
//
// SPDX-License-Identifier: GPL-3.0-or-later

Expand All @@ -6,12 +6,13 @@

#include <QHash>
#include <QImage>
#include <QSharedPointer>

Check warning on line 9 in plugins/application-tray/util.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QSharedPointer> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QSet>

Check warning on line 10 in plugins/application-tray/util.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QSet> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QObject>

Check warning on line 11 in plugins/application-tray/util.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QObject> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <QMutex>

Check warning on line 12 in plugins/application-tray/util.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <QMutex> not found. Please note: Cppcheck does not need standard library headers to get proper results.

#include <cstdint>

Check warning on line 14 in plugins/application-tray/util.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <cstdint> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <sys/types.h>

Check warning on line 15 in plugins/application-tray/util.h

View workflow job for this annotation

GitHub Actions / cppcheck

Include file: <sys/types.h> not found. Please note: Cppcheck does not need standard library headers to get proper results.
#include <xcb/xcb.h>
#include <xcb/xproto.h>
#include <xcb/xcb_ewmh.h>
Expand Down Expand Up @@ -78,6 +79,7 @@
_XDisplay *m_display;

QSet<QString> m_currentIds;
QMutex m_idMutex;
};

}
Loading