Skip to content

Commit abb8c77

Browse files
sync: from linuxdeepin/dde-session-shell
Synchronize source files from linuxdeepin/dde-session-shell. Source-pull-request: linuxdeepin/dde-session-shell#21
1 parent 6bd4bc0 commit abb8c77

File tree

14 files changed

+2340
-15
lines changed

14 files changed

+2340
-15
lines changed

.reuse/dep5

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,18 @@ Files: README.md README.zh_CN.md
88
Copyright: None
99
License: CC-BY-4.0
1010

11+
# cmake
12+
Files: cmake/*.in cmake/*.cmake
13+
Copyright: None
14+
License: CC0-1.0
15+
1116
# xml2cpp
1217
Files: src/global_util/dbus/*
1318
Copyright: The Qt Company Ltd.
1419
License: CC0-1.0
1520

1621
# Project file
17-
Files: *.pro *.qrc *CMakeLists.txt *.cmake qt-theme.ini files/* scripts/* src/lightdm-deepin-greeter/deepin-greeter
22+
Files: *.pro *.qrc *CMakeLists.txt *.cmake qt-theme.ini files/* scripts/* src/lightdm-deepin-greeter/deepin-greeter .project
1823
Copyright: None
1924
License: CC0-1.0
2025

@@ -24,7 +29,7 @@ Copyright: UnionTech Software Technology Co., Ltd.
2429
License: GPL-3.0-or-later
2530

2631
# png svg
27-
Files: src/widgets/img/* misc/images/* src/session-widgets/img/*
32+
Files: src/widgets/img/* misc/images/* src/session-widgets/img/* plugins/examples/login-plugins/login-udcp/images/*
2833
Copyright: UnionTech Software Technology Co., Ltd.
2934
License: GPL-3.0-or-later
3035

LICENSES/GPL-3.0-or-later.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
GNU GENERAL PUBLIC LICENSE
22
Version 3, 29 June 2007
33

4-
Copyright © 2007 Free Software Foundation, Inc. <http://fsf.org/>
4+
Copyright © 2007 Free Software Foundation, Inc. <https://fsf.org/>
55

66
Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed.
77

@@ -215,7 +215,7 @@ To do so, attach the following notices to the program. It is safest to attach th
215215

216216
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
217217

218-
You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.
218+
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
219219

220220
Also add information on how to contact you by electronic and paper mail.
221221

@@ -227,6 +227,6 @@ If the program does terminal interaction, make it output a short notice like thi
227227

228228
The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, your program's commands might be different; for a GUI interface, you would use an “about box”.
229229

230-
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <http://www.gnu.org/licenses/>.
230+
You should also get your employer (if you work as a programmer) or school, if any, to sign a “copyright disclaimer” for the program, if necessary. For more information on this, and how to apply and follow the GNU GPL, see <https://www.gnu.org/licenses/>.
231231

232-
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <http://www.gnu.org/philosophy/why-not-lgpl.html>.
232+
The GNU General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. But first, please read <https://www.gnu.org/philosophy/why-not-lgpl.html>.

plugins/examples/login-plugins/login-udcp/qss/udcp_mfa_login_widget.qss

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
/*
2+
* SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
3+
*
4+
* SPDX-License-Identifier: GPL-3.0-or-later
5+
*/
6+
17
QPushButton#sendButton {
28
background-color: rgba(255, 255, 255, 76);
39
color: white;

src/global_util/plugin_manager/modules_loader.cpp

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,12 @@ ModulesLoader::~ModulesLoader()
3333
{
3434
quit();
3535
wait();
36+
37+
QMutexLocker locker(&m_mutex);
38+
for (auto &loader : m_pluginLoaders) {
39+
cleanupPluginLoader(loader);
40+
}
41+
m_pluginLoaders.clear();
3642
}
3743

3844
ModulesLoader& ModulesLoader::instance()
@@ -86,13 +92,15 @@ void ModulesLoader::findModule(const QString& path)
8692
// 版本过低则不加载,可能会导致登录器崩溃
8793
if (!checkVersion(version, LOWEST_VERSION)) {
8894
qCWarning(DDE_SHELL) << "The module version is too low, version:" << version << ", lowest version:" << LOWEST_VERSION;
95+
loader->deleteLater();
8996
continue;
9097
}
9198

9299
// 性能优化,分类加载
93100
QString pluginType = meta.value("pluginType").toString();
94101
if (!pluginType.isEmpty()) {
95102
if ((pluginType == LoginType && !m_loadLoginModule) || (pluginType == TrayType && m_loadLoginModule)) {
103+
loader->deleteLater();
96104
continue;
97105
}
98106
} else {
@@ -103,27 +111,27 @@ void ModulesLoader::findModule(const QString& path)
103111
auto* moduleInstance = dynamic_cast<dss::module::BaseModuleInterface*>(loader->instance());
104112
if (!moduleInstance) {
105113
qCWarning(DDE_SHELL) << "Load plugin failed, error:" << loader->errorString();
106-
loader->unload();
114+
cleanupPluginLoader(loader);
107115
continue;
108116
}
109117

110118
qCInfo(DDE_SHELL) << "Current plugin key:" << moduleInstance->key();
111119
if (blackList.contains(moduleInstance->key())) {
112120
qCInfo(DDE_SHELL) << "The plugin is in black list, won't be loaded.";
113-
loader->unload();
121+
cleanupPluginLoader(loader);
114122
continue;
115123
}
116124

117125
int loadPluginType = moduleInstance->loadPluginType();
118126
if (loadPluginType != dss::module::BaseModuleInterface::Load) {
119127
qCInfo(DDE_SHELL) << "The plugin dose not want to be loaded.";
120-
loader->unload();
128+
cleanupPluginLoader(loader);
121129
continue;
122130
}
123131

124132
if (PluginManager::instance()->contains(moduleInstance->key())) {
125133
qCInfo(DDE_SHELL) << "The plugin has been loaded.";
126-
loader->unload();
134+
cleanupPluginLoader(loader);
127135
continue;
128136
}
129137

@@ -268,6 +276,7 @@ bool ModulesLoader::isPluginEnabled(const QFileInfo& module)
268276
auto dbusInterface = new QDBusInterface(service, targetPath, interface, dbusConnection);
269277
if (!dbusInterface || !dbusInterface->isValid()) {
270278
qCWarning(DDE_SHELL) << "Check plugin enabled dbus interface is not valid.";
279+
dbusInterface->deleteLater();
271280
return false;
272281
}
273282
const bool pluginEnabled = dbusInterface->property(property.toStdString().c_str()).toBool();
@@ -346,6 +355,14 @@ void ModulesLoader::unloadPlugin(const QString& path)
346355
}
347356
}
348357

358+
void ModulesLoader::cleanupPluginLoader(QPluginLoader* loader)
359+
{
360+
if (loader) {
361+
loader->unload();
362+
loader->deleteLater();
363+
}
364+
}
365+
349366
// TODO 只重新加载/卸载变更的插件
350367
void ModulesLoader::onDConfigPropertyChanged(const QString& key, const QVariant& value, QObject* objPtr)
351368
{
@@ -367,4 +384,4 @@ void ModulesLoader::onDbusPropertiesChanged(const QString& interfaceName, const
367384
start(QThread::LowestPriority);
368385
}
369386
}
370-
}
387+
}

src/global_util/plugin_manager/modules_loader.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ class ModulesLoader : public QThread
4040
bool isPluginEnabled(const QFileInfo &module);
4141
bool contains(const QString &pluginFile) const;
4242
QPair<QString, QPluginLoader*> getPluginLoader(const QString &pluginFile) const;
43+
void cleanupPluginLoader(QPluginLoader* loader);
4344

4445
static void onDConfigPropertyChanged(const QString &key, const QVariant &value, QObject *objPtr);
4546

src/pam-inhibit-autologin/pam_inhibit_autologin.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2011 - 2025 UnionTech Software Technology Co., Ltd.
2+
//
3+
// SPDX-License-Identifier: GPL-3.0-or-later
4+
15
#include <security/pam_ext.h>
26
#include <security/pam_modules.h>
37
#include <security/_pam_types.h>

src/session-widgets/fullmanagedauthwidget.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
2+
//
3+
// SPDX-License-Identifier: GPL-3.0-or-later
4+
15
#ifndef FULLMANAGEDAUTHWIDGET_H
26
#define FULLMANAGEDAUTHWIDGET_H
37

src/widgets/abstractfullbackgroundinterface.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
2+
//
3+
// SPDX-License-Identifier: GPL-3.0-or-later
4+
15
#ifndef ABSTRACTFULLBACKGROUND_H
26
#define ABSTRACTFULLBACKGROUND_H
37

src/widgets/popupwindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
22
//
3-
// SPDX-License-Identifier: LGPL-3.0-or-later
3+
// SPDX-License-Identifier: GPL-3.0-or-later
44

55
#include "popupwindow.h"
66

src/widgets/popupwindow.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// SPDX-FileCopyrightText: 2011 - 2022 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2021 - 2022 UnionTech Software Technology Co., Ltd.
22
//
3-
// SPDX-License-Identifier: LGPL-3.0-or-later
3+
// SPDX-License-Identifier: GPL-3.0-or-later
44

55
#ifndef POPUPWINDOW_H
66
#define POPUPWINDOW_H

0 commit comments

Comments
 (0)