Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silence error in Kodi log #71

Merged
merged 1 commit into from Dec 9, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 5 additions & 7 deletions src/addon.cpp
Expand Up @@ -252,14 +252,12 @@ PERIPHERAL_ERROR GetFeatures(const JOYSTICK_INFO* joystick, const char* controll
return PERIPHERAL_ERROR_INVALID_PARAMETERS;

FeatureVector featureVector;
if (CStorageManager::Get().GetFeatures(ADDON::Joystick(*joystick), controller_id, featureVector))
{
*feature_count = featureVector.size();
ADDON::JoystickFeatures::ToStructs(featureVector, features);
return PERIPHERAL_NO_ERROR;
}
CStorageManager::Get().GetFeatures(ADDON::Joystick(*joystick), controller_id, featureVector);

return PERIPHERAL_ERROR_FAILED;
*feature_count = featureVector.size();
ADDON::JoystickFeatures::ToStructs(featureVector, features);

return PERIPHERAL_NO_ERROR;
}

void FreeFeatures(unsigned int feature_count, JOYSTICK_FEATURE* features)
Expand Down
4 changes: 1 addition & 3 deletions src/storage/StorageManager.cpp
Expand Up @@ -112,14 +112,12 @@ void CStorageManager::Deinitialize(void)
m_peripheralLib = nullptr;
}

bool CStorageManager::GetFeatures(const ADDON::Joystick& joystick,
void CStorageManager::GetFeatures(const ADDON::Joystick& joystick,
const std::string& strControllerId,
FeatureVector& features)
{
if (m_buttonMapper)
m_buttonMapper->GetFeatures(joystick, strControllerId, features);

return !features.empty();
}

bool CStorageManager::MapFeatures(const ADDON::Joystick& joystick,
Expand Down
4 changes: 1 addition & 3 deletions src/storage/StorageManager.h
Expand Up @@ -74,10 +74,8 @@ namespace JOYSTICK
* \param joystick The device's joystick properties; unknown values may be left at their default
* \param controller_id The controller profile being requested, e.g. game.controller.default
* \param features The array of features and their driver primitives
*
* \return true if results were loaded from a storage backend
*/
bool GetFeatures(const ADDON::Joystick& joystick,
void GetFeatures(const ADDON::Joystick& joystick,
const std::string& strDeviceId,
FeatureVector& features);

Expand Down