1
0
mirror of https://gitlab.com/kelteseth/ScreenPlay.git synced 2024-11-08 03:52:42 +01:00
This commit is contained in:
Elias Steurer 2020-05-16 22:59:54 +02:00
parent 6900bccb7c
commit 96d28dad01
4 changed files with 8 additions and 30 deletions

View File

@ -51,13 +51,12 @@ void ScreenPlayManager::createWallpaper(
m_telemetry->sendEvent("wallpaper", "start");
}
QString path = QUrl::fromUserInput(absoluteStoragePath).toLocalFile();
QJsonArray monitors;
for (const int index : monitorIndex) {
monitors.append(index);
}
QString path = QUrl::fromUserInput(absoluteStoragePath).toLocalFile();
QString appID = Util::generateRandomString();
std::shared_ptr<ScreenPlayWallpaper> wallpaper;
@ -277,7 +276,7 @@ bool ScreenPlayManager::removeWallpaperByAppID(const QString& appID)
qInfo() << "Remove wallpaper " << wallpaper->file() << "at monitor " << wallpaper->screenNumber();
decreaseActiveWallpaperCounter();
m_screenPlayWallpapers.removeOne(wallpaper);
if(activeWallpaperCounter() != m_screenPlayWallpapers.length()){
if (activeWallpaperCounter() != m_screenPlayWallpapers.length()) {
qWarning() << "activeWallpaperCounter value: " << activeWallpaperCounter()
<< "does not match m_screenPlayWallpapers length:" << m_screenPlayWallpapers.length();
return false;

View File

@ -74,7 +74,7 @@ public slots:
void removeAllWallpapers();
void removeAllWidgets();
bool removeWallpaperAt(const int index = 0);
bool removeWallpaperAt(const int index);
void requestProjectSettingsListModelAt(const int index);
void setWallpaperValue(const int index, const QString& key, const QString& value);

View File

@ -76,6 +76,7 @@ void SDKConnector::closeAllConnections()
client->close();
}
m_clients.clear();
m_clients.squeeze();
}
/*!
@ -131,36 +132,16 @@ void SDKConnector::closeConntectionByType(const QStringList& list)
}
}
/*!
\brief Closes a wallpaper at the given \a index. The native monitor index is used here.
On Windows the monitor 0 is the main display.
*/
void SDKConnector::closeWallpapersAt(int at)
{
for (const std::shared_ptr<SDKConnection>& refSDKConnection : qAsConst(m_clients)) {
refSDKConnection->close();
if (!refSDKConnection->monitor().empty()) {
if (refSDKConnection->monitor().at(0) == at) {
refSDKConnection->close();
qDebug() << "Wall Closed...!";
} else {
qDebug() << "COULD NOT CLOSE!";
}
} else {
qDebug() << "no wp window ";
}
}
}
/*!
\brief Closes a wallpaper by the given \a appID.
*/
void SDKConnector::closeWallpaper(const QString& appID)
{
for (auto& item : m_clients) {
if (item->appID() == appID) {
item->close();
m_clients.removeOne(item);
for (auto& client : m_clients) {
if (client->appID() == appID) {
client->close();
m_clients.removeOne(client);
return;
}
}

View File

@ -40,8 +40,6 @@ public slots:
void closeAllConnections();
void closeAllWallpapers();
void closeAllWidgets();
void closeWallpapersAt(int at);
void closeWallpaper(const QString& appID);
void setWallpaperValue(QString appID, QString key, QString value);