{"action":"created","comment":{"url":"https://api.github.com/repos/opentx/opentx/pulls/comments/99979441","pull_request_review_id":20670649,"id":99979441,"diff_hunk":"@@ -698,8 +698,11 @@ class ConversionField: public TransformedField {\n       if (table) {\n         if (table->exportValue(_field, _field))\n           return;\n-        if (!error.isEmpty())\n+        if (!error.isEmpty()) {\n+          // TODO how could we avoid this global?","path":"companion/src/eepromimportexport.h","position":15,"original_position":15,"commit_id":"729aedf28674b6be58aeb06e24c14fc0817ed1cf","original_commit_id":"82c8b6c4cf1e6fec5f46aa2b4852c089d13b7317","user":{"login":"mpaperno","id":1366615,"avatar_url":"https://avatars.githubusercontent.com/u/1366615?v=3","gravatar_id":"","url":"https://api.github.com/users/mpaperno","html_url":"https://github.com/mpaperno","followers_url":"https://api.github.com/users/mpaperno/followers","following_url":"https://api.github.com/users/mpaperno/following{/other_user}","gists_url":"https://api.github.com/users/mpaperno/gists{/gist_id}","starred_url":"https://api.github.com/users/mpaperno/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mpaperno/subscriptions","organizations_url":"https://api.github.com/users/mpaperno/orgs","repos_url":"https://api.github.com/users/mpaperno/repos","events_url":"https://api.github.com/users/mpaperno/events{/privacy}","received_events_url":"https://api.github.com/users/mpaperno/received_events","type":"User","site_admin":false},"body":"What is the ultimate goal in this particular case?  I only see `EEPROMWarnings` displayed from inside `OpenTxEeepromInterface::save()`.\r\n\r\nThe following idea does a bit of assuming but I'll toss it out there anyway.\r\n\r\nIf each field is a subtype of `DataField` then it would make a lot of sense to have an error/warning handler in the parent class (or perhaps in `TransformedField` if `DataField` is too broad).  I'm not sure why you suggest the parent/child relationship, but if you need to track a hierarchy then that could be built into the handler (you could pass the parent and child object names for example, along with the message and e.g. error code). Of course the parent class already has some of that info, like `name`, so that could easily be added to the warning data already.  E.g. just something as simple as `DataField::addWarning(const QString &txt)` would do it, no?\r\n\r\nAs to how to actually get the error \"collector\" in there (`EEPROMWarnings`), I can think of a few ways... but here's one.  Since `EEPROMInterface` already essentially exists as a singleton, I'd add the \"collector\" as a member of that (eg. it could be a public struct definition with more data than just message).  Then in the `DataField` (or `TransformedField`) initializer I'd get a reference to the current `EEPROMInterface` instance (`EEPROMInterface * eeInstance = getCurrentEEpromInterface();`).  I'd then use whatever function(s) `EEPROMInterface` provides for adding warning messages (I'd suggest a function rather than direct access to the \"collector\" variable).  Or in other words inside our theoretical `DataField::addWarning(txt)` function we'd just call something like `eeInstance->addWarning(txt);`.\r\n\r\nActually I'd probably make `EEPROMInterface` and `DataField` inherit from QObject and then connect `DataField::warningAdded()` to `EEPROMInterface::onWarningAdded()` (or something like that).\r\n\r\nOf course `EEPROMWarnings` could also be its own self-contained independent singleton/static class/struct, but I'm not sure it would add much benefit.  Or a part of new class for that matter, eg. `EepromImportExport`.  At that point it becomes a question of if that same warnings container would be useful for other aspects of dealing with `EEPROMInterface`, or if it's purely for import/export.","created_at":"2017-02-08T02:23:14Z","updated_at":"2017-02-08T02:23:15Z","html_url":"https://github.com/opentx/opentx/pull/4425#discussion_r99979441","pull_request_url":"https://api.github.com/repos/opentx/opentx/pulls/4425","_links":{"self":{"href":"https://api.github.com/repos/opentx/opentx/pulls/comments/99979441"},"html":{"href":"https://github.com/opentx/opentx/pull/4425#discussion_r99979441"},"pull_request":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4425"}}},"pull_request":{"url":"https://api.github.com/repos/opentx/opentx/pulls/4425","id":105093435,"html_url":"https://github.com/opentx/opentx/pull/4425","diff_url":"https://github.com/opentx/opentx/pull/4425.diff","patch_url":"https://github.com/opentx/opentx/pull/4425.patch","issue_url":"https://api.github.com/repos/opentx/opentx/issues/4425","number":4425,"state":"open","locked":false,"title":"Bsongis/issue 4400","user":{"login":"bsongis","id":5603504,"avatar_url":"https://avatars.githubusercontent.com/u/5603504?v=3","gravatar_id":"","url":"https://api.github.com/users/bsongis","html_url":"https://github.com/bsongis","followers_url":"https://api.github.com/users/bsongis/followers","following_url":"https://api.github.com/users/bsongis/following{/other_user}","gists_url":"https://api.github.com/users/bsongis/gists{/gist_id}","starred_url":"https://api.github.com/users/bsongis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bsongis/subscriptions","organizations_url":"https://api.github.com/users/bsongis/orgs","repos_url":"https://api.github.com/users/bsongis/repos","events_url":"https://api.github.com/users/bsongis/events{/privacy}","received_events_url":"https://api.github.com/users/bsongis/received_events","type":"User","site_admin":false},"body":"It should fix #4400 \r\nPlease review\r\nDiscussion needed about all the TODO I introduced\r\n","created_at":"2017-02-07T21:04:13Z","updated_at":"2017-02-08T02:23:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"71900b8edcd590fabab7bd492a1ccb225d944c1b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/opentx/opentx/pulls/4425/commits","review_comments_url":"https://api.github.com/repos/opentx/opentx/pulls/4425/comments","review_comment_url":"https://api.github.com/repos/opentx/opentx/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opentx/opentx/issues/4425/comments","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/729aedf28674b6be58aeb06e24c14fc0817ed1cf","head":{"label":"opentx:bsongis/issue_4400","ref":"bsongis/issue_4400","sha":"729aedf28674b6be58aeb06e24c14fc0817ed1cf","user":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"repo":{"id":14794708,"name":"opentx","full_name":"opentx/opentx","owner":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentx/opentx","description":"OpenTX custom firmware for Transmitters","fork":false,"url":"https://api.github.com/repos/opentx/opentx","forks_url":"https://api.github.com/repos/opentx/opentx/forks","keys_url":"https://api.github.com/repos/opentx/opentx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentx/opentx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentx/opentx/teams","hooks_url":"https://api.github.com/repos/opentx/opentx/hooks","issue_events_url":"https://api.github.com/repos/opentx/opentx/issues/events{/number}","events_url":"https://api.github.com/repos/opentx/opentx/events","assignees_url":"https://api.github.com/repos/opentx/opentx/assignees{/user}","branches_url":"https://api.github.com/repos/opentx/opentx/branches{/branch}","tags_url":"https://api.github.com/repos/opentx/opentx/tags","blobs_url":"https://api.github.com/repos/opentx/opentx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentx/opentx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentx/opentx/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentx/opentx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/{sha}","languages_url":"https://api.github.com/repos/opentx/opentx/languages","stargazers_url":"https://api.github.com/repos/opentx/opentx/stargazers","contributors_url":"https://api.github.com/repos/opentx/opentx/contributors","subscribers_url":"https://api.github.com/repos/opentx/opentx/subscribers","subscription_url":"https://api.github.com/repos/opentx/opentx/subscription","commits_url":"https://api.github.com/repos/opentx/opentx/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentx/opentx/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentx/opentx/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentx/opentx/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentx/opentx/contents/{+path}","compare_url":"https://api.github.com/repos/opentx/opentx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentx/opentx/merges","archive_url":"https://api.github.com/repos/opentx/opentx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentx/opentx/downloads","issues_url":"https://api.github.com/repos/opentx/opentx/issues{/number}","pulls_url":"https://api.github.com/repos/opentx/opentx/pulls{/number}","milestones_url":"https://api.github.com/repos/opentx/opentx/milestones{/number}","notifications_url":"https://api.github.com/repos/opentx/opentx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentx/opentx/labels{/name}","releases_url":"https://api.github.com/repos/opentx/opentx/releases{/id}","deployments_url":"https://api.github.com/repos/opentx/opentx/deployments","created_at":"2013-11-29T07:02:56Z","updated_at":"2017-02-02T09:46:12Z","pushed_at":"2017-02-07T21:56:05Z","git_url":"git://github.com/opentx/opentx.git","ssh_url":"git@github.com:opentx/opentx.git","clone_url":"https://github.com/opentx/opentx.git","svn_url":"https://github.com/opentx/opentx","homepage":"","size":144996,"stargazers_count":494,"watchers_count":494,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":288,"mirror_url":null,"open_issues_count":458,"forks":288,"open_issues":458,"watchers":494,"default_branch":"next"}},"base":{"label":"opentx:next","ref":"next","sha":"4e24d0ef7d8551c054899950a42e987b86885aa5","user":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"repo":{"id":14794708,"name":"opentx","full_name":"opentx/opentx","owner":{"login":"opentx","id":6073522,"avatar_url":"https://avatars.githubusercontent.com/u/6073522?v=3","gravatar_id":"","url":"https://api.github.com/users/opentx","html_url":"https://github.com/opentx","followers_url":"https://api.github.com/users/opentx/followers","following_url":"https://api.github.com/users/opentx/following{/other_user}","gists_url":"https://api.github.com/users/opentx/gists{/gist_id}","starred_url":"https://api.github.com/users/opentx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opentx/subscriptions","organizations_url":"https://api.github.com/users/opentx/orgs","repos_url":"https://api.github.com/users/opentx/repos","events_url":"https://api.github.com/users/opentx/events{/privacy}","received_events_url":"https://api.github.com/users/opentx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opentx/opentx","description":"OpenTX custom firmware for Transmitters","fork":false,"url":"https://api.github.com/repos/opentx/opentx","forks_url":"https://api.github.com/repos/opentx/opentx/forks","keys_url":"https://api.github.com/repos/opentx/opentx/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opentx/opentx/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opentx/opentx/teams","hooks_url":"https://api.github.com/repos/opentx/opentx/hooks","issue_events_url":"https://api.github.com/repos/opentx/opentx/issues/events{/number}","events_url":"https://api.github.com/repos/opentx/opentx/events","assignees_url":"https://api.github.com/repos/opentx/opentx/assignees{/user}","branches_url":"https://api.github.com/repos/opentx/opentx/branches{/branch}","tags_url":"https://api.github.com/repos/opentx/opentx/tags","blobs_url":"https://api.github.com/repos/opentx/opentx/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opentx/opentx/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opentx/opentx/git/refs{/sha}","trees_url":"https://api.github.com/repos/opentx/opentx/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opentx/opentx/statuses/{sha}","languages_url":"https://api.github.com/repos/opentx/opentx/languages","stargazers_url":"https://api.github.com/repos/opentx/opentx/stargazers","contributors_url":"https://api.github.com/repos/opentx/opentx/contributors","subscribers_url":"https://api.github.com/repos/opentx/opentx/subscribers","subscription_url":"https://api.github.com/repos/opentx/opentx/subscription","commits_url":"https://api.github.com/repos/opentx/opentx/commits{/sha}","git_commits_url":"https://api.github.com/repos/opentx/opentx/git/commits{/sha}","comments_url":"https://api.github.com/repos/opentx/opentx/comments{/number}","issue_comment_url":"https://api.github.com/repos/opentx/opentx/issues/comments{/number}","contents_url":"https://api.github.com/repos/opentx/opentx/contents/{+path}","compare_url":"https://api.github.com/repos/opentx/opentx/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opentx/opentx/merges","archive_url":"https://api.github.com/repos/opentx/opentx/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opentx/opentx/downloads","issues_url":"https://api.github.com/repos/opentx/opentx/issues{/number}","pulls_url":"https://api.github.com/repos/opentx/opentx/pulls{/number}","milestones_url":"https://api.github.com/repos/opentx/opentx/milestones{/number}","notifications_url":"https://api.github.com/repos/opentx/opentx/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opentx/opentx/labels{/name}","releases_url":"https://api.github.com/repos/opentx/opentx/releases{/id}","deployments_url":"https://api.github.com/repos/opentx/opentx/deployments","created_at":"2013-11-29T07:02:56Z","updated_at":"2017-02-02T09:46:12Z","pushed_at":"2017-02-07T21:56:05Z","git_url":"git://github.com/opentx/opentx.git","ssh_url":"git@github.com:opentx/opentx.git","clone_url":"https://github.com/opentx/opentx.git","svn_url":"https://github.com/opentx/opentx","homepage":"","size":144996,"stargazers_count":494,"watchers_count":494,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":288,"mirror_url":null,"open_issues_count":458,"forks":288,"open_issues":458,"watchers":494,"default_branch":"next"}},"_links":{"self":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4425"},"html":{"href":"https://github.com/opentx/opentx/pull/4425"},"issue":{"href":"https://api.github.com/repos/opentx/opentx/issues/4425"},"comments":{"href":"https://api.github.com/repos/opentx/opentx/issues/4425/comments"},"review_comments":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4425/comments"},"review_comment":{"href":"https://api.github.com/repos/opentx/opentx/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opentx/opentx/pulls/4425/commits"},"statuses":{"href":"https://api.github.com/repos/opentx/opentx/statuses/729aedf28674b6be58aeb06e24c14fc0817ed1cf"}}}}
{"actor":{"display_login":"mpaperno"}}