-
Notifications
You must be signed in to change notification settings - Fork 44
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
Fix miscellaneous issues and warnings #652
Conversation
- Binding loop warning in WorldStats - ImageDisplay warning stating that the image source is invalid - This happened because the provider is being initialized in LoadConfig which runs after the QML has been loaded. The solution was to move it to the constructor. However, it depends on a unique name obtained from the QML, which causes a chicken and egg problem. To fix this, I've opted for generating a random string based on a UUID number. Signed-off-by: Addisu Z. Taddese <[email protected]>
@@ -51,19 +54,32 @@ class ImageDisplay::Implementation | |||
|
|||
/// \brief To provide images for QML. | |||
public: ImageProvider *provider{nullptr}; | |||
|
|||
/// \brief Holds the provider name unique to this plugin instance | |||
public: QString providerName; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
include <Qstring>
and <QStringList>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added in ImageDisplay.hh
since they are needed there as well.
@@ -95,13 +111,12 @@ void ImageDisplay::LoadConfig(const tinyxml2::XMLElement *_pluginElem) | |||
this->PluginItem()->setProperty("showPicker", topicPicker); | |||
|
|||
if (!topic.empty()) | |||
this->OnTopic(QString::fromStdString(topic)); | |||
{ | |||
auto qTopic = QString::fromStdString(topic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
auto qTopic = QString::fromStdString(topic); | |
auto qTopic = QString::fromStdString(topic); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 80ad45e
@@ -225,6 +240,7 @@ void ImageDisplay::OnTopic(const QString _topic) | |||
///////////////////////////////////////////////// | |||
void ImageDisplay::OnRefresh() | |||
{ | |||
gzwarn << "OnRefresh\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
@@ -249,6 +265,7 @@ void ImageDisplay::OnRefresh() | |||
// Select first one | |||
if (this->dataPtr->topicList.count() > 0) | |||
this->OnTopic(this->dataPtr->topicList.at(0)); | |||
gzwarn << "TopicListChanged\n"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove
Instead of generating a random string from a UUID, this adds a new member function that gets called from the QML to register the image provider with a unique name. Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
Signed-off-by: Addisu Z. Taddese <[email protected]>
The UUID implementation broke tests, so I've changed the implementation a little bit. Instead of generating a random string, the QML now calls |
🦟 Bug fix
Summary
To fix this, I've opted for generating a random string based on a UUID number.To fix this, the QML now calls a member function of ImageDisplay to register the image provider with a unique name.Checklist
codecheck
passed (See contributing)Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining
Signed-off-by
messages.