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

Change appConnected to bool return

even though it is not used it still makes more sense
that this function can fail to return a bool
This commit is contained in:
Elias Steurer 2020-12-26 21:19:06 +01:00
parent 5019070aee
commit 5edba6f1c8
2 changed files with 8 additions and 4 deletions

View File

@ -221,21 +221,25 @@ void ScreenPlayManager::createWidget(
\brief Iterates all Wallpaper and Widgets for the matching appID. Returns true if a matching appID
was successful set.
*/
void ScreenPlayManager::appConnected(const std::shared_ptr<SDKConnection>& connection)
bool ScreenPlayManager::appConnected(const std::shared_ptr<SDKConnection>& connection)
{
for (const auto& item : qAsConst(m_screenPlayWidgets)) {
if (item->appID() == connection->appID()) {
item->setSDKConnection(connection);
return;
return true;
}
}
for (const auto& item : qAsConst(m_screenPlayWallpapers)) {
if (item->appID() == connection->appID()) {
item->setSDKConnection(connection);
return;
return true;
}
}
qWarning() << "No matching appID for id" << connection->appID() << " was found!";
return false;
}
/*!

View File

@ -190,7 +190,7 @@ public slots:
private:
void loadProfiles();
void appConnected(const std::shared_ptr<SDKConnection>& connection);
bool appConnected(const std::shared_ptr<SDKConnection>& connection);
bool checkIsAnotherScreenPlayInstanceRunning();
[[nodiscard]] bool removeWallpaperByAppID(const QString& appID);