| 307 | } |
| 308 | |
| 309 | bool MultiIconPlugin::loadIcon(uint8_t slotId, FileMgrService::FileId fileId) |
| 310 | { |
| 311 | bool isSuccessful = false; |
| 312 | |
| 313 | if (_MultiIconPlugin::View::MAX_ICON_SLOTS > slotId) |
| 314 | { |
| 315 | MutexGuard<MutexRecursive> guard(m_mutex); |
| 316 | IconSlot& iconSlot = m_slots[slotId]; |
| 317 | String iconFullPath; |
| 318 | |
| 319 | iconSlot.fileId = fileId; |
| 320 | iconSlot.hasSlotChanged = true; |
| 321 | m_hasTopicSlotsChanged = true; |
| 322 | |
| 323 | if (FileMgrService::FILE_ID_INVALID == iconSlot.fileId) |
| 324 | { |
| 325 | m_view.clearIcon(slotId); |
| 326 | } |
| 327 | else if (false == FileMgrService::getInstance().getFileFullPathById(iconFullPath, iconSlot.fileId)) |
| 328 | { |
| 329 | LOG_WARNING("Unknown file id %u.", iconSlot.fileId); |
| 330 | m_view.clearIcon(slotId); |
| 331 | } |
| 332 | else if (false == m_view.loadIcon(slotId, iconFullPath)) |
| 333 | { |
| 334 | LOG_ERROR("Icon not found: %s", iconFullPath.c_str()); |
| 335 | } |
| 336 | else |
| 337 | { |
| 338 | ; |
| 339 | } |
| 340 | |
| 341 | isSuccessful = true; |
| 342 | } |
| 343 | |
| 344 | return isSuccessful; |
| 345 | } |
| 346 | |
| 347 | void MultiIconPlugin::clearIcon(uint8_t slotId) |
| 348 | { |
no test coverage detected