{"action":"created","comment":{"url":"https://api.github.com/repos/bendiy/qt-client/pulls/comments/49350561","id":49350561,"diff_hunk":"@@ -10,41 +10,57 @@\n \n #include \"qjsonobjectproto.h\"\n \n+#if QT_VERSION < 0x050000\n+void setupQJsonObjectProto(QScriptEngine *engine)\n+{\n+  // do nothing\n+}\n+\n+#else\n+\n #include <QJsonObject>\n \n-QScriptValue QJsonObjecttoScriptValue(QScriptEngine *engine, QJsonObject::iterator const &iterator)\n+QScriptValue QJsonObjectToScriptValue(QScriptEngine *engine, QJsonObject* const &in)\n+{\n+  QScriptValue obj = engine->toScriptValue(in->toVariantMap());\n+  return obj;\n+}\n+\n+void QJsonObjectFromScriptValue(const QScriptValue &obj, QJsonObject* &out)\n+{\n+  out = dynamic_cast<QJsonObject*>(obj.toQObject());\n+}\n+\n+static QScriptValue fromVariantHash(QScriptContext *context, QScriptEngine *engine)\n {\n-  //return engine->newQObject(item);\n-  return engine->newVariant(QVariant(&iterator));\n+  QJsonObject obj = QJsonObject::fromVariantHash(context->argument(0).toVariant().toHash());","path":"scriptapi/qjsonobjectproto.cpp","position":30,"original_position":30,"commit_id":"e45179146c044b08b3c36fef0121c30fb5041789","original_commit_id":"e45179146c044b08b3c36fef0121c30fb5041789","user":{"login":"bendiy","id":571574,"avatar_url":"https://avatars.githubusercontent.com/u/571574?v=3","gravatar_id":"","url":"https://api.github.com/users/bendiy","html_url":"https://github.com/bendiy","followers_url":"https://api.github.com/users/bendiy/followers","following_url":"https://api.github.com/users/bendiy/following{/other_user}","gists_url":"https://api.github.com/users/bendiy/gists{/gist_id}","starred_url":"https://api.github.com/users/bendiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendiy/subscriptions","organizations_url":"https://api.github.com/users/bendiy/orgs","repos_url":"https://api.github.com/users/bendiy/repos","events_url":"https://api.github.com/users/bendiy/events{/privacy}","received_events_url":"https://api.github.com/users/bendiy/received_events","type":"User","site_admin":false},"body":"```\r\nqjsonobjectproto.cpp: In function 'QScriptValue fromVariantHash(QScriptContext*, QScriptEngine*)':\r\nqjsonobjectproto.cpp:36:21: error: 'fromVariantHash' is not a member of 'QJsonObject'\r\n   QJsonObject obj = QJsonObject::fromVariantHash(context->argument(0).toVariant().toHash());\r\n                     ^\r\nqjsonobjectproto.cpp: In member function 'QVariantHash QJsonObjectProto::toVariantHash() const':\r\nqjsonobjectproto.cpp:243:18: error: 'class QJsonObject' has no member named 'toVariantHash'\r\n     return item->toVariantHash();\r\n                  ^\r\n```","created_at":"2016-01-11T17:33:39Z","updated_at":"2016-01-11T17:33:39Z","html_url":"https://github.com/bendiy/qt-client/pull/1#discussion_r49350561","pull_request_url":"https://api.github.com/repos/bendiy/qt-client/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/bendiy/qt-client/pulls/comments/49350561"},"html":{"href":"https://github.com/bendiy/qt-client/pull/1#discussion_r49350561"},"pull_request":{"href":"https://api.github.com/repos/bendiy/qt-client/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/bendiy/qt-client/pulls/1","id":51711815,"html_url":"https://github.com/bendiy/qt-client/pull/1","diff_url":"https://github.com/bendiy/qt-client/pull/1.diff","patch_url":"https://github.com/bendiy/qt-client/pull/1.patch","issue_url":"https://api.github.com/repos/bendiy/qt-client/issues/1","number":1,"state":"closed","locked":false,"title":"expose more qweb* classes to scripting","user":{"login":"gilmoskowitz","id":704111,"avatar_url":"https://avatars.githubusercontent.com/u/704111?v=3","gravatar_id":"","url":"https://api.github.com/users/gilmoskowitz","html_url":"https://github.com/gilmoskowitz","followers_url":"https://api.github.com/users/gilmoskowitz/followers","following_url":"https://api.github.com/users/gilmoskowitz/following{/other_user}","gists_url":"https://api.github.com/users/gilmoskowitz/gists{/gist_id}","starred_url":"https://api.github.com/users/gilmoskowitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilmoskowitz/subscriptions","organizations_url":"https://api.github.com/users/gilmoskowitz/orgs","repos_url":"https://api.github.com/users/gilmoskowitz/repos","events_url":"https://api.github.com/users/gilmoskowitz/events{/privacy}","received_events_url":"https://api.github.com/users/gilmoskowitz/received_events","type":"User","site_admin":false},"body":"I don't think qnetworkaccessmanager needs to be exposed at all since the only chunk in `bendiy/expose-qwebframe-to-scripting` is a _signal_. also, there are already xnetworkaccessmanager.* files (don't remember why) that can probably be used if necessary.\r\n\r\nThe XWebSync classes are strange; if XWebSync is our own class and not derived from an existing class, there should be no need for a prototype - just expose XWebSync itself with Q_PROPERTY and, if necessary, Q_INVOKABLE. The `from` and `to` functions should transform XWebSync objects, not QJsonObjects.","created_at":"2015-11-24T20:21:15Z","updated_at":"2016-01-11T17:33:39Z","closed_at":"2016-01-11T17:06:36Z","merged_at":"2016-01-11T17:06:36Z","merge_commit_sha":"a94a433f501927868960fde6760f9d546bd3eef8","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/bendiy/qt-client/pulls/1/commits","review_comments_url":"https://api.github.com/repos/bendiy/qt-client/pulls/1/comments","review_comment_url":"https://api.github.com/repos/bendiy/qt-client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/bendiy/qt-client/issues/1/comments","statuses_url":"https://api.github.com/repos/bendiy/qt-client/statuses/e45179146c044b08b3c36fef0121c30fb5041789","head":{"label":"gilmoskowitz:fixWebScriptExposure","ref":"fixWebScriptExposure","sha":"e45179146c044b08b3c36fef0121c30fb5041789","user":{"login":"gilmoskowitz","id":704111,"avatar_url":"https://avatars.githubusercontent.com/u/704111?v=3","gravatar_id":"","url":"https://api.github.com/users/gilmoskowitz","html_url":"https://github.com/gilmoskowitz","followers_url":"https://api.github.com/users/gilmoskowitz/followers","following_url":"https://api.github.com/users/gilmoskowitz/following{/other_user}","gists_url":"https://api.github.com/users/gilmoskowitz/gists{/gist_id}","starred_url":"https://api.github.com/users/gilmoskowitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilmoskowitz/subscriptions","organizations_url":"https://api.github.com/users/gilmoskowitz/orgs","repos_url":"https://api.github.com/users/gilmoskowitz/repos","events_url":"https://api.github.com/users/gilmoskowitz/events{/privacy}","received_events_url":"https://api.github.com/users/gilmoskowitz/received_events","type":"User","site_admin":false},"repo":{"id":19700391,"name":"qt-client","full_name":"gilmoskowitz/qt-client","owner":{"login":"gilmoskowitz","id":704111,"avatar_url":"https://avatars.githubusercontent.com/u/704111?v=3","gravatar_id":"","url":"https://api.github.com/users/gilmoskowitz","html_url":"https://github.com/gilmoskowitz","followers_url":"https://api.github.com/users/gilmoskowitz/followers","following_url":"https://api.github.com/users/gilmoskowitz/following{/other_user}","gists_url":"https://api.github.com/users/gilmoskowitz/gists{/gist_id}","starred_url":"https://api.github.com/users/gilmoskowitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gilmoskowitz/subscriptions","organizations_url":"https://api.github.com/users/gilmoskowitz/orgs","repos_url":"https://api.github.com/users/gilmoskowitz/repos","events_url":"https://api.github.com/users/gilmoskowitz/events{/privacy}","received_events_url":"https://api.github.com/users/gilmoskowitz/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gilmoskowitz/qt-client","description":"Desktop Client","fork":true,"url":"https://api.github.com/repos/gilmoskowitz/qt-client","forks_url":"https://api.github.com/repos/gilmoskowitz/qt-client/forks","keys_url":"https://api.github.com/repos/gilmoskowitz/qt-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gilmoskowitz/qt-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gilmoskowitz/qt-client/teams","hooks_url":"https://api.github.com/repos/gilmoskowitz/qt-client/hooks","issue_events_url":"https://api.github.com/repos/gilmoskowitz/qt-client/issues/events{/number}","events_url":"https://api.github.com/repos/gilmoskowitz/qt-client/events","assignees_url":"https://api.github.com/repos/gilmoskowitz/qt-client/assignees{/user}","branches_url":"https://api.github.com/repos/gilmoskowitz/qt-client/branches{/branch}","tags_url":"https://api.github.com/repos/gilmoskowitz/qt-client/tags","blobs_url":"https://api.github.com/repos/gilmoskowitz/qt-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gilmoskowitz/qt-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gilmoskowitz/qt-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/gilmoskowitz/qt-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gilmoskowitz/qt-client/statuses/{sha}","languages_url":"https://api.github.com/repos/gilmoskowitz/qt-client/languages","stargazers_url":"https://api.github.com/repos/gilmoskowitz/qt-client/stargazers","contributors_url":"https://api.github.com/repos/gilmoskowitz/qt-client/contributors","subscribers_url":"https://api.github.com/repos/gilmoskowitz/qt-client/subscribers","subscription_url":"https://api.github.com/repos/gilmoskowitz/qt-client/subscription","commits_url":"https://api.github.com/repos/gilmoskowitz/qt-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/gilmoskowitz/qt-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/gilmoskowitz/qt-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/gilmoskowitz/qt-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/gilmoskowitz/qt-client/contents/{+path}","compare_url":"https://api.github.com/repos/gilmoskowitz/qt-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gilmoskowitz/qt-client/merges","archive_url":"https://api.github.com/repos/gilmoskowitz/qt-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gilmoskowitz/qt-client/downloads","issues_url":"https://api.github.com/repos/gilmoskowitz/qt-client/issues{/number}","pulls_url":"https://api.github.com/repos/gilmoskowitz/qt-client/pulls{/number}","milestones_url":"https://api.github.com/repos/gilmoskowitz/qt-client/milestones{/number}","notifications_url":"https://api.github.com/repos/gilmoskowitz/qt-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gilmoskowitz/qt-client/labels{/name}","releases_url":"https://api.github.com/repos/gilmoskowitz/qt-client/releases{/id}","created_at":"2014-05-12T13:46:20Z","updated_at":"2014-07-02T12:19:47Z","pushed_at":"2016-01-05T20:33:16Z","git_url":"git://github.com/gilmoskowitz/qt-client.git","ssh_url":"git@github.com:gilmoskowitz/qt-client.git","clone_url":"https://github.com/gilmoskowitz/qt-client.git","svn_url":"https://github.com/gilmoskowitz/qt-client","homepage":"","size":79955,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"bendiy:expose-qwebframe-to-scripts","ref":"expose-qwebframe-to-scripts","sha":"6cf8101507c31f944b1bcae1051ddf2fa584496d","user":{"login":"bendiy","id":571574,"avatar_url":"https://avatars.githubusercontent.com/u/571574?v=3","gravatar_id":"","url":"https://api.github.com/users/bendiy","html_url":"https://github.com/bendiy","followers_url":"https://api.github.com/users/bendiy/followers","following_url":"https://api.github.com/users/bendiy/following{/other_user}","gists_url":"https://api.github.com/users/bendiy/gists{/gist_id}","starred_url":"https://api.github.com/users/bendiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendiy/subscriptions","organizations_url":"https://api.github.com/users/bendiy/orgs","repos_url":"https://api.github.com/users/bendiy/repos","events_url":"https://api.github.com/users/bendiy/events{/privacy}","received_events_url":"https://api.github.com/users/bendiy/received_events","type":"User","site_admin":false},"repo":{"id":22648917,"name":"qt-client","full_name":"bendiy/qt-client","owner":{"login":"bendiy","id":571574,"avatar_url":"https://avatars.githubusercontent.com/u/571574?v=3","gravatar_id":"","url":"https://api.github.com/users/bendiy","html_url":"https://github.com/bendiy","followers_url":"https://api.github.com/users/bendiy/followers","following_url":"https://api.github.com/users/bendiy/following{/other_user}","gists_url":"https://api.github.com/users/bendiy/gists{/gist_id}","starred_url":"https://api.github.com/users/bendiy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bendiy/subscriptions","organizations_url":"https://api.github.com/users/bendiy/orgs","repos_url":"https://api.github.com/users/bendiy/repos","events_url":"https://api.github.com/users/bendiy/events{/privacy}","received_events_url":"https://api.github.com/users/bendiy/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/bendiy/qt-client","description":"Desktop Client","fork":true,"url":"https://api.github.com/repos/bendiy/qt-client","forks_url":"https://api.github.com/repos/bendiy/qt-client/forks","keys_url":"https://api.github.com/repos/bendiy/qt-client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/bendiy/qt-client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/bendiy/qt-client/teams","hooks_url":"https://api.github.com/repos/bendiy/qt-client/hooks","issue_events_url":"https://api.github.com/repos/bendiy/qt-client/issues/events{/number}","events_url":"https://api.github.com/repos/bendiy/qt-client/events","assignees_url":"https://api.github.com/repos/bendiy/qt-client/assignees{/user}","branches_url":"https://api.github.com/repos/bendiy/qt-client/branches{/branch}","tags_url":"https://api.github.com/repos/bendiy/qt-client/tags","blobs_url":"https://api.github.com/repos/bendiy/qt-client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/bendiy/qt-client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/bendiy/qt-client/git/refs{/sha}","trees_url":"https://api.github.com/repos/bendiy/qt-client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/bendiy/qt-client/statuses/{sha}","languages_url":"https://api.github.com/repos/bendiy/qt-client/languages","stargazers_url":"https://api.github.com/repos/bendiy/qt-client/stargazers","contributors_url":"https://api.github.com/repos/bendiy/qt-client/contributors","subscribers_url":"https://api.github.com/repos/bendiy/qt-client/subscribers","subscription_url":"https://api.github.com/repos/bendiy/qt-client/subscription","commits_url":"https://api.github.com/repos/bendiy/qt-client/commits{/sha}","git_commits_url":"https://api.github.com/repos/bendiy/qt-client/git/commits{/sha}","comments_url":"https://api.github.com/repos/bendiy/qt-client/comments{/number}","issue_comment_url":"https://api.github.com/repos/bendiy/qt-client/issues/comments{/number}","contents_url":"https://api.github.com/repos/bendiy/qt-client/contents/{+path}","compare_url":"https://api.github.com/repos/bendiy/qt-client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/bendiy/qt-client/merges","archive_url":"https://api.github.com/repos/bendiy/qt-client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/bendiy/qt-client/downloads","issues_url":"https://api.github.com/repos/bendiy/qt-client/issues{/number}","pulls_url":"https://api.github.com/repos/bendiy/qt-client/pulls{/number}","milestones_url":"https://api.github.com/repos/bendiy/qt-client/milestones{/number}","notifications_url":"https://api.github.com/repos/bendiy/qt-client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/bendiy/qt-client/labels{/name}","releases_url":"https://api.github.com/repos/bendiy/qt-client/releases{/id}","created_at":"2014-08-05T15:35:35Z","updated_at":"2014-07-02T17:28:32Z","pushed_at":"2016-01-11T17:06:36Z","git_url":"git://github.com/bendiy/qt-client.git","ssh_url":"git@github.com:bendiy/qt-client.git","clone_url":"https://github.com/bendiy/qt-client.git","svn_url":"https://github.com/bendiy/qt-client","homepage":"","size":67263,"stargazers_count":0,"watchers_count":0,"language":null,"has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/bendiy/qt-client/pulls/1"},"html":{"href":"https://github.com/bendiy/qt-client/pull/1"},"issue":{"href":"https://api.github.com/repos/bendiy/qt-client/issues/1"},"comments":{"href":"https://api.github.com/repos/bendiy/qt-client/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/bendiy/qt-client/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/bendiy/qt-client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/bendiy/qt-client/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/bendiy/qt-client/statuses/e45179146c044b08b3c36fef0121c30fb5041789"}}}}