1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-09-18 08:22:33 +02:00

Fix wallpaper closing

This commit is contained in:
Elias Steurer 2021-05-09 12:13:36 +02:00
parent 5445012cb5
commit 2c8a0450bf
4 changed files with 17 additions and 6 deletions

View File

@ -362,11 +362,6 @@ void ScreenPlayManager::newConnection()
return;
}
qWarning() << "There are no wallpaper or widgets that have to SDKConnection "
<< "m_screenPlayWallpapers count: " << m_screenPlayWallpapers.size()
<< "m_screenPlayWidgets count: " << m_screenPlayWidgets.size()
<< "m_unconnectedClients count: " << m_unconnectedClients.size();
std::unique_ptr<SDKConnection> matchingConnection;
for (int i = 0; i < m_unconnectedClients.size(); ++i) {
if (m_unconnectedClients.at(i).get() == connection) {
@ -382,6 +377,7 @@ void ScreenPlayManager::newConnection()
for (int i = 0; i < m_screenPlayWallpapers.size(); ++i) {
if (m_screenPlayWallpapers.at(i)->appID() == matchingConnection->appID()) {
qInfo() << "Matching Wallpaper found!";
m_screenPlayWallpapers.at(i)->setSDKConnection(std::move(matchingConnection));
return;
}
@ -389,12 +385,19 @@ void ScreenPlayManager::newConnection()
for (int i = 0; i < m_screenPlayWidgets.size(); ++i) {
if (m_screenPlayWidgets.at(i)->appID() == matchingConnection->appID()) {
qInfo() << "Matching Widget found!";
m_screenPlayWidgets.at(i)->setSDKConnection(std::move(matchingConnection));
return;
}
}
qWarning() << "No matching connection found!";
qWarning() << "There are no wallpaper or widgets that have to SDKConnection "
<< "m_screenPlayWallpapers count: " << m_screenPlayWallpapers.size()
<< "m_screenPlayWidgets count: " << m_screenPlayWidgets.size()
<< "m_unconnectedClients count: " << m_unconnectedClients.size();
});
m_unconnectedClients.push_back(std::move(connection));
}

View File

@ -15,7 +15,9 @@ namespace ScreenPlay {
*/
ScreenPlayWallpaper::~ScreenPlayWallpaper()
{
m_connection->close();
qInfo() << "Remove wallpaper " << m_appID;
}
/*!

View File

@ -54,7 +54,12 @@ ScreenPlayWidget::ScreenPlayWidget(
QVariant::fromValue(m_type).toString(),
QString::number(m_position.x()),
QString::number(m_position.y()),
};
};
}
ScreenPlayWidget::~ScreenPlayWidget()
{
m_connection->close();
}
bool ScreenPlayWidget::start()

View File

@ -68,6 +68,7 @@ public:
const QString& absolutePath,
const QString& previewImage, const QJsonObject& properties,
const InstalledType::InstalledType type);
~ScreenPlayWidget();
bool start();