payload: {"action":"created","comment":{"url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/comments/261599213","pull_request_review_id":209575472,"id":261599213,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDI2MTU5OTIxMw==","diff_hunk":"@@ -48,8 +48,9 @@ class VirtualMachineInfo\n     QString sharedSsh;\n     quint16 sshPort;\n     quint16 wwwPort;\n-    QList<quint16> freePorts;\n-    QList<quint16> qmlLivePorts;\n+    QHash<QString, quint16> freePorts;\n+    QHash<QString, quint16> qmlLivePorts;\n+    QHash<QString, quint16> otherPorts;","path":"src/plugins/mer/mervirtualboxmanager.h","position":8,"original_position":8,"commit_id":"25717ad7e69f19a4d78049ef1c4235bdab5ef4eb","original_commit_id":"25717ad7e69f19a4d78049ef1c4235bdab5ef4eb","user":{"login":"martyone","id":182428,"node_id":"MDQ6VXNlcjE4MjQyOA==","avatar_url":"https://avatars1.githubusercontent.com/u/182428?v=4","gravatar_id":"","url":"https://api.github.com/users/martyone","html_url":"https://github.com/martyone","followers_url":"https://api.github.com/users/martyone/followers","following_url":"https://api.github.com/users/martyone/following{/other_user}","gists_url":"https://api.github.com/users/martyone/gists{/gist_id}","starred_url":"https://api.github.com/users/martyone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/martyone/subscriptions","organizations_url":"https://api.github.com/users/martyone/orgs","repos_url":"https://api.github.com/users/martyone/repos","events_url":"https://api.github.com/users/martyone/events{/privacy}","received_events_url":"https://api.github.com/users/martyone/received_events","type":"User","site_admin":false},"body":"We should use QMap instead - order matters","created_at":"2019-03-01T13:19:37Z","updated_at":"2019-03-01T13:32:08Z","html_url":"https://github.com/sailfishos/sailfish-qtcreator/pull/165#discussion_r261599213","pull_request_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165","author_association":"CONTRIBUTOR","_links":{"self":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/comments/261599213"},"html":{"href":"https://github.com/sailfishos/sailfish-qtcreator/pull/165#discussion_r261599213"},"pull_request":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165"}}},"pull_request":{"url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165","id":243307759,"node_id":"MDExOlB1bGxSZXF1ZXN0MjQzMzA3NzU5","html_url":"https://github.com/sailfishos/sailfish-qtcreator/pull/165","diff_url":"https://github.com/sailfishos/sailfish-qtcreator/pull/165.diff","patch_url":"https://github.com/sailfishos/sailfish-qtcreator/pull/165.patch","issue_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues/165","number":165,"state":"open","locked":false,"title":"Mer: Adapt the \"mer\" plugin for using from other Qt Creator plugins","user":{"login":"yarfruct","id":43994328,"node_id":"MDQ6VXNlcjQzOTk0MzI4","avatar_url":"https://avatars2.githubusercontent.com/u/43994328?v=4","gravatar_id":"","url":"https://api.github.com/users/yarfruct","html_url":"https://github.com/yarfruct","followers_url":"https://api.github.com/users/yarfruct/followers","following_url":"https://api.github.com/users/yarfruct/following{/other_user}","gists_url":"https://api.github.com/users/yarfruct/gists{/gist_id}","starred_url":"https://api.github.com/users/yarfruct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarfruct/subscriptions","organizations_url":"https://api.github.com/users/yarfruct/orgs","repos_url":"https://api.github.com/users/yarfruct/repos","events_url":"https://api.github.com/users/yarfruct/events{/privacy}","received_events_url":"https://api.github.com/users/yarfruct/received_events","type":"User","site_admin":false},"body":"We are implementing a Qt Creator plugin for sensors emulation. To do so we need to use the \"mer\" Qt Creator plugin for:\r\n\r\n1. Monitoring the Sailfish OS Emulator virtual machine state (on or off).\r\n2. Setting up port forwarding between the host machine and Sailfish OS Emulator.\r\n\r\nWhen implementing the sensor emulation plugin, we faced the following issues and fixed them in this pull request:\r\n\r\n1. The \"mer\" plugin does not allow to use itself as a dependency.\r\n2. It is not possible to use the \"mer\" plugin classes and methods inside other Qt Creator plugins.\r\n3. The \"mer\" plugin have no methods to set up port forwarding for an arbitrary port.\r\n\r\n**First issue:** Our plugin cannot be loaded when we describe the \"mer\" plugin as a dependency.\r\n**Reason of the first issue:** The \"mer\" plugin `Name` identifier and its shared library name are different. During Qt Creator plugin loading it checks dependencies and compares their plugin `Name` identifiers with shared libraries names. The \"mer\" plugin have \"SailfishOS\" as the plugin name and \"Mer\" as name of the shared library and this is a reason why it cannot be initialized as a dependency of our plugin and why our plugin cannot be loaded.\r\n**Solution of the first issue:** Change the \"mer\" plugin shared library name from \"Mer\" to \"SailfishOS\".\r\n\r\n**Second issue:** We have to use the emulator connection for monitoring the emulator VM state. To get instance of the connection it is used the `MerEmulatorDevice::connection()` method. But when we use the \"mer\" plugin classes inside our plugin code base the build is failed on the linking stage.\r\n**Reasons of the second issue:** \r\n1. The \"mer\" plugin classes are inside the `Mer::Internal` namespace.\r\n2. The \"mer\" plugin classes does not have the `Q_DECL_EXPORT` macros in their declarations.\r\n\r\n**Solution of the second issue:** Move the `MerConnection`, `MerEmulatorDevice` and `MerDevice` classes from the `Mer::Internal` namespace and add the `Q_DECL_EXPORT` macros to classes that will be used inside our plugin: `MerConnection` and `MerEmulatorDevice` .\r\n\r\n**Third issue:** We have to set up port forwarding between the host machine and Sailfish OS Emulator. The \"mer\" Qt Creator plugin contains the `MerVirtualBoxManager` class that uses the `VBoxManage` utility for working with virtual machines. But a problem is that this class has no methods to set up port forwarding for an arbitrary port.\r\n**Solution of the third issue:** \r\n1. Add methods to update and delete a port forwarding for ports to the `MerVirtualBoxManager`.\r\n2. Add a method to set up an arbitrary port to the `MerEmulatorDevice` that is used  `MerVirtualBoxManager`.\r\n3. Add a method to the `MerEmulatorDevice` for checking whether the port forwarding rule is already set or not.","created_at":"2019-01-09T11:58:05Z","updated_at":"2019-03-01T13:32:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":"e024daeab594fd975daf6fd3c9b62e46280ffbe6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165/commits","review_comments_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165/comments","review_comment_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues/165/comments","statuses_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/statuses/25717ad7e69f19a4d78049ef1c4235bdab5ef4eb","head":{"label":"yarfruct:adapt-mer-plugin-for-using-from-other-qt-creator-plugins","ref":"adapt-mer-plugin-for-using-from-other-qt-creator-plugins","sha":"25717ad7e69f19a4d78049ef1c4235bdab5ef4eb","user":{"login":"yarfruct","id":43994328,"node_id":"MDQ6VXNlcjQzOTk0MzI4","avatar_url":"https://avatars2.githubusercontent.com/u/43994328?v=4","gravatar_id":"","url":"https://api.github.com/users/yarfruct","html_url":"https://github.com/yarfruct","followers_url":"https://api.github.com/users/yarfruct/followers","following_url":"https://api.github.com/users/yarfruct/following{/other_user}","gists_url":"https://api.github.com/users/yarfruct/gists{/gist_id}","starred_url":"https://api.github.com/users/yarfruct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarfruct/subscriptions","organizations_url":"https://api.github.com/users/yarfruct/orgs","repos_url":"https://api.github.com/users/yarfruct/repos","events_url":"https://api.github.com/users/yarfruct/events{/privacy}","received_events_url":"https://api.github.com/users/yarfruct/received_events","type":"User","site_admin":false},"repo":{"id":152257405,"node_id":"MDEwOlJlcG9zaXRvcnkxNTIyNTc0MDU=","name":"sailfish-qtcreator","full_name":"yarfruct/sailfish-qtcreator","private":false,"owner":{"login":"yarfruct","id":43994328,"node_id":"MDQ6VXNlcjQzOTk0MzI4","avatar_url":"https://avatars2.githubusercontent.com/u/43994328?v=4","gravatar_id":"","url":"https://api.github.com/users/yarfruct","html_url":"https://github.com/yarfruct","followers_url":"https://api.github.com/users/yarfruct/followers","following_url":"https://api.github.com/users/yarfruct/following{/other_user}","gists_url":"https://api.github.com/users/yarfruct/gists{/gist_id}","starred_url":"https://api.github.com/users/yarfruct/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarfruct/subscriptions","organizations_url":"https://api.github.com/users/yarfruct/orgs","repos_url":"https://api.github.com/users/yarfruct/repos","events_url":"https://api.github.com/users/yarfruct/events{/privacy}","received_events_url":"https://api.github.com/users/yarfruct/received_events","type":"User","site_admin":false},"html_url":"https://github.com/yarfruct/sailfish-qtcreator","description":"SDK IDE for SailfishOS application development.","fork":true,"url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator","forks_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/forks","keys_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/teams","hooks_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/hooks","issue_events_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/issues/events{/number}","events_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/events","assignees_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/assignees{/user}","branches_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/branches{/branch}","tags_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/tags","blobs_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/git/refs{/sha}","trees_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/statuses/{sha}","languages_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/languages","stargazers_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/stargazers","contributors_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/contributors","subscribers_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/subscribers","subscription_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/subscription","commits_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/commits{/sha}","git_commits_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/git/commits{/sha}","comments_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/comments{/number}","issue_comment_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/issues/comments{/number}","contents_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/contents/{+path}","compare_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/merges","archive_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/downloads","issues_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/issues{/number}","pulls_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/pulls{/number}","milestones_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/milestones{/number}","notifications_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/labels{/name}","releases_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/releases{/id}","deployments_url":"https://api.github.com/repos/yarfruct/sailfish-qtcreator/deployments","created_at":"2018-10-09T13:37:48Z","updated_at":"2019-01-09T08:40:34Z","pushed_at":"2019-01-24T13:14:48Z","git_url":"git://github.com/yarfruct/sailfish-qtcreator.git","ssh_url":"git@github.com:yarfruct/sailfish-qtcreator.git","clone_url":"https://github.com/yarfruct/sailfish-qtcreator.git","svn_url":"https://github.com/yarfruct/sailfish-qtcreator","homepage":null,"size":265941,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"sailfishos:master","ref":"master","sha":"19ad8270cf51882e0fd319c410b684cd03bf6596","user":{"login":"sailfishos","id":6198659,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxOTg2NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6198659?v=4","gravatar_id":"","url":"https://api.github.com/users/sailfishos","html_url":"https://github.com/sailfishos","followers_url":"https://api.github.com/users/sailfishos/followers","following_url":"https://api.github.com/users/sailfishos/following{/other_user}","gists_url":"https://api.github.com/users/sailfishos/gists{/gist_id}","starred_url":"https://api.github.com/users/sailfishos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailfishos/subscriptions","organizations_url":"https://api.github.com/users/sailfishos/orgs","repos_url":"https://api.github.com/users/sailfishos/repos","events_url":"https://api.github.com/users/sailfishos/events{/privacy}","received_events_url":"https://api.github.com/users/sailfishos/received_events","type":"Organization","site_admin":false},"repo":{"id":17949007,"node_id":"MDEwOlJlcG9zaXRvcnkxNzk0OTAwNw==","name":"sailfish-qtcreator","full_name":"sailfishos/sailfish-qtcreator","private":false,"owner":{"login":"sailfishos","id":6198659,"node_id":"MDEyOk9yZ2FuaXphdGlvbjYxOTg2NTk=","avatar_url":"https://avatars0.githubusercontent.com/u/6198659?v=4","gravatar_id":"","url":"https://api.github.com/users/sailfishos","html_url":"https://github.com/sailfishos","followers_url":"https://api.github.com/users/sailfishos/followers","following_url":"https://api.github.com/users/sailfishos/following{/other_user}","gists_url":"https://api.github.com/users/sailfishos/gists{/gist_id}","starred_url":"https://api.github.com/users/sailfishos/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sailfishos/subscriptions","organizations_url":"https://api.github.com/users/sailfishos/orgs","repos_url":"https://api.github.com/users/sailfishos/repos","events_url":"https://api.github.com/users/sailfishos/events{/privacy}","received_events_url":"https://api.github.com/users/sailfishos/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/sailfishos/sailfish-qtcreator","description":"SDK IDE for SailfishOS application development.","fork":false,"url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator","forks_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/forks","keys_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/teams","hooks_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/hooks","issue_events_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues/events{/number}","events_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/events","assignees_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/assignees{/user}","branches_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/branches{/branch}","tags_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/tags","blobs_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/git/refs{/sha}","trees_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/statuses/{sha}","languages_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/languages","stargazers_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/stargazers","contributors_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/contributors","subscribers_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/subscribers","subscription_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/subscription","commits_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/commits{/sha}","git_commits_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/git/commits{/sha}","comments_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/comments{/number}","issue_comment_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues/comments{/number}","contents_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/contents/{+path}","compare_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/merges","archive_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/downloads","issues_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues{/number}","pulls_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls{/number}","milestones_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/milestones{/number}","notifications_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/labels{/name}","releases_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/releases{/id}","deployments_url":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/deployments","created_at":"2014-03-20T16:05:36Z","updated_at":"2019-03-01T10:26:36Z","pushed_at":"2019-03-01T13:11:53Z","git_url":"git://github.com/sailfishos/sailfish-qtcreator.git","ssh_url":"git@github.com:sailfishos/sailfish-qtcreator.git","clone_url":"https://github.com/sailfishos/sailfish-qtcreator.git","svn_url":"https://github.com/sailfishos/sailfish-qtcreator","homepage":null,"size":270461,"stargazers_count":23,"watchers_count":23,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":18,"mirror_url":null,"archived":false,"open_issues_count":13,"license":{"key":"other","name":"Other","spdx_id":"NOASSERTION","url":null,"node_id":"MDc6TGljZW5zZTA="},"forks":18,"open_issues":13,"watchers":23,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165"},"html":{"href":"https://github.com/sailfishos/sailfish-qtcreator/pull/165"},"issue":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues/165"},"comments":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/issues/165/comments"},"review_comments":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165/comments"},"review_comment":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/pulls/165/commits"},"statuses":{"href":"https://api.github.com/repos/sailfishos/sailfish-qtcreator/statuses/25717ad7e69f19a4d78049ef1c4235bdab5ef4eb"}},"author_association":"NONE"}}
other: {"actor":{"display_login":"martyone"}}