{"action":"created","comment":{"url":"https://api.github.com/repos/qreal/qreal/pulls/comments/34985553","id":34985553,"diff_hunk":"@@ -0,0 +1,56 @@\n+#include \"pluginLoader.h\"\n+#include <QtCore/QPluginLoader>\n+#include <QtCore/QDir>\n+\n+#include \"qrrepo/repoApi.h\"\n+#include \"qrutils/nameNormalizer.h\"\n+\n+using namespace qReal;\n+using namespace editorPluginTestingFramework;\n+using namespace utils;\n+using namespace qrRepo;\n+\n+EditorInterface* PluginLoader::loadedPlugin(\n+\t\tconst QString &fileName\n+\t\t, const QString &pathToFile\n+\t\t, const QString &pluginExtension\n+\t\t, const QString &prefix)\n+{\n+\tqDebug() << \"STARTING PLUGIN LOADING\";\n+\tQDir mPluginDir = QDir(pathToFile);\n+\n+\tQString normalizedFileName = fileName;\n+\tif (!fileName.contains(\".qrs\")) {\n+\t\tnormalizedFileName += \".qrs\";\n+\t}\n+\n+\tconst RepoApi *mRepoApi = new RepoApi(normalizedFileName);\n+\tconst IdList metamodels = mRepoApi->children(Id::rootId());\n+\n+\tfor (Id const &key : metamodels) {\n+\t\tif (mRepoApi->isLogicalElement(key)) {\n+\t\t\tconst QString &normalizedMetamodelName = NameNormalizer::normalize(mRepoApi->stringProperty(key, \"name\"), false);\n+\t\t\tconst QString &pluginName = prefix + normalizedMetamodelName + \"-d\" + \".\" + pluginExtension;\n+\t\t\tmPluginNames.append(pluginName);\n+\n+\t\t\tQPluginLoader * const loader = new QPluginLoader(mPluginDir.absoluteFilePath(pluginName));\n+\t\t\tloader->load();\n+\t\t\tQObject *plugin = loader->instance();\n+\n+\t\t\tif (plugin) {\n+\t\t\t\tqDebug() << \"plugin is loaded\";\n+\t\t\t\tEditorInterface * const iEditor = qobject_cast<EditorInterface *>(plugin);\n+\t\t\t\treturn iEditor;\n+\t\t\t}\n+\n+\t\t\tqDebug() << \"plugin is NOT loaded\";\n+\t\t}\n+\t}\n+\n+\treturn NULL;","path":"qrtest/editorPluginTestingFramework/pluginLoader.cpp","position":50,"original_position":50,"commit_id":"847bed1aae6cbb1ef4905d45ac94f640e855cb9b","original_commit_id":"847bed1aae6cbb1ef4905d45ac94f640e855cb9b","user":{"login":"yurii-litvinov","id":706768,"avatar_url":"https://avatars.githubusercontent.com/u/706768?v=3","gravatar_id":"","url":"https://api.github.com/users/yurii-litvinov","html_url":"https://github.com/yurii-litvinov","followers_url":"https://api.github.com/users/yurii-litvinov/followers","following_url":"https://api.github.com/users/yurii-litvinov/following{/other_user}","gists_url":"https://api.github.com/users/yurii-litvinov/gists{/gist_id}","starred_url":"https://api.github.com/users/yurii-litvinov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yurii-litvinov/subscriptions","organizations_url":"https://api.github.com/users/yurii-litvinov/orgs","repos_url":"https://api.github.com/users/yurii-litvinov/repos","events_url":"https://api.github.com/users/yurii-litvinov/events{/privacy}","received_events_url":"https://api.github.com/users/yurii-litvinov/received_events","type":"User","site_admin":false},"body":"NULLы запрещены :)","created_at":"2015-07-20T11:23:19Z","updated_at":"2015-07-20T11:23:19Z","html_url":"https://github.com/qreal/qreal/pull/1490#discussion_r34985553","pull_request_url":"https://api.github.com/repos/qreal/qreal/pulls/1490","_links":{"self":{"href":"https://api.github.com/repos/qreal/qreal/pulls/comments/34985553"},"html":{"href":"https://github.com/qreal/qreal/pull/1490#discussion_r34985553"},"pull_request":{"href":"https://api.github.com/repos/qreal/qreal/pulls/1490"}}},"pull_request":{"url":"https://api.github.com/repos/qreal/qreal/pulls/1490","id":34557084,"html_url":"https://github.com/qreal/qreal/pull/1490","diff_url":"https://github.com/qreal/qreal/pull/1490.diff","patch_url":"https://github.com/qreal/qreal/pull/1490.patch","issue_url":"https://api.github.com/repos/qreal/qreal/issues/1490","number":1490,"state":"open","locked":false,"title":"New editor plugin test tool","user":{"login":"Julia-Khramyshkina","id":6695349,"avatar_url":"https://avatars.githubusercontent.com/u/6695349?v=3","gravatar_id":"","url":"https://api.github.com/users/Julia-Khramyshkina","html_url":"https://github.com/Julia-Khramyshkina","followers_url":"https://api.github.com/users/Julia-Khramyshkina/followers","following_url":"https://api.github.com/users/Julia-Khramyshkina/following{/other_user}","gists_url":"https://api.github.com/users/Julia-Khramyshkina/gists{/gist_id}","starred_url":"https://api.github.com/users/Julia-Khramyshkina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Julia-Khramyshkina/subscriptions","organizations_url":"https://api.github.com/users/Julia-Khramyshkina/orgs","repos_url":"https://api.github.com/users/Julia-Khramyshkina/repos","events_url":"https://api.github.com/users/Julia-Khramyshkina/events{/privacy}","received_events_url":"https://api.github.com/users/Julia-Khramyshkina/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-05-01T18:40:43Z","updated_at":"2015-07-20T11:23:19Z","closed_at":null,"merged_at":null,"merge_commit_sha":"57a7bced3754ff88d71a8e2dd6dfb797161003ec","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/qreal/qreal/pulls/1490/commits","review_comments_url":"https://api.github.com/repos/qreal/qreal/pulls/1490/comments","review_comment_url":"https://api.github.com/repos/qreal/qreal/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qreal/qreal/issues/1490/comments","statuses_url":"https://api.github.com/repos/qreal/qreal/statuses/847bed1aae6cbb1ef4905d45ac94f640e855cb9b","head":{"label":"Julia-Khramyshkina:newEditorPluginTestTool","ref":"newEditorPluginTestTool","sha":"847bed1aae6cbb1ef4905d45ac94f640e855cb9b","user":{"login":"Julia-Khramyshkina","id":6695349,"avatar_url":"https://avatars.githubusercontent.com/u/6695349?v=3","gravatar_id":"","url":"https://api.github.com/users/Julia-Khramyshkina","html_url":"https://github.com/Julia-Khramyshkina","followers_url":"https://api.github.com/users/Julia-Khramyshkina/followers","following_url":"https://api.github.com/users/Julia-Khramyshkina/following{/other_user}","gists_url":"https://api.github.com/users/Julia-Khramyshkina/gists{/gist_id}","starred_url":"https://api.github.com/users/Julia-Khramyshkina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Julia-Khramyshkina/subscriptions","organizations_url":"https://api.github.com/users/Julia-Khramyshkina/orgs","repos_url":"https://api.github.com/users/Julia-Khramyshkina/repos","events_url":"https://api.github.com/users/Julia-Khramyshkina/events{/privacy}","received_events_url":"https://api.github.com/users/Julia-Khramyshkina/received_events","type":"User","site_admin":false},"repo":{"id":19817766,"name":"qreal","full_name":"Julia-Khramyshkina/qreal","owner":{"login":"Julia-Khramyshkina","id":6695349,"avatar_url":"https://avatars.githubusercontent.com/u/6695349?v=3","gravatar_id":"","url":"https://api.github.com/users/Julia-Khramyshkina","html_url":"https://github.com/Julia-Khramyshkina","followers_url":"https://api.github.com/users/Julia-Khramyshkina/followers","following_url":"https://api.github.com/users/Julia-Khramyshkina/following{/other_user}","gists_url":"https://api.github.com/users/Julia-Khramyshkina/gists{/gist_id}","starred_url":"https://api.github.com/users/Julia-Khramyshkina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Julia-Khramyshkina/subscriptions","organizations_url":"https://api.github.com/users/Julia-Khramyshkina/orgs","repos_url":"https://api.github.com/users/Julia-Khramyshkina/repos","events_url":"https://api.github.com/users/Julia-Khramyshkina/events{/privacy}","received_events_url":"https://api.github.com/users/Julia-Khramyshkina/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Julia-Khramyshkina/qreal","description":"CASE and metaCASE system","fork":true,"url":"https://api.github.com/repos/Julia-Khramyshkina/qreal","forks_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/forks","keys_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/teams","hooks_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/hooks","issue_events_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/issues/events{/number}","events_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/events","assignees_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/assignees{/user}","branches_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/branches{/branch}","tags_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/tags","blobs_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/git/refs{/sha}","trees_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/statuses/{sha}","languages_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/languages","stargazers_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/stargazers","contributors_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/contributors","subscribers_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/subscribers","subscription_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/subscription","commits_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/commits{/sha}","git_commits_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/git/commits{/sha}","comments_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/comments{/number}","issue_comment_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/issues/comments{/number}","contents_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/contents/{+path}","compare_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/merges","archive_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/downloads","issues_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/issues{/number}","pulls_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/pulls{/number}","milestones_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/milestones{/number}","notifications_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/labels{/name}","releases_url":"https://api.github.com/repos/Julia-Khramyshkina/qreal/releases{/id}","created_at":"2014-05-15T12:06:23Z","updated_at":"2014-12-07T17:17:47Z","pushed_at":"2015-07-16T16:28:09Z","git_url":"git://github.com/Julia-Khramyshkina/qreal.git","ssh_url":"git@github.com:Julia-Khramyshkina/qreal.git","clone_url":"https://github.com/Julia-Khramyshkina/qreal.git","svn_url":"https://github.com/Julia-Khramyshkina/qreal","homepage":"","size":112012,"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":"qreal:master","ref":"master","sha":"993d3ec12bd263237e3b57f7d2c586468ae57682","user":{"login":"qreal","id":706806,"avatar_url":"https://avatars.githubusercontent.com/u/706806?v=3","gravatar_id":"","url":"https://api.github.com/users/qreal","html_url":"https://github.com/qreal","followers_url":"https://api.github.com/users/qreal/followers","following_url":"https://api.github.com/users/qreal/following{/other_user}","gists_url":"https://api.github.com/users/qreal/gists{/gist_id}","starred_url":"https://api.github.com/users/qreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qreal/subscriptions","organizations_url":"https://api.github.com/users/qreal/orgs","repos_url":"https://api.github.com/users/qreal/repos","events_url":"https://api.github.com/users/qreal/events{/privacy}","received_events_url":"https://api.github.com/users/qreal/received_events","type":"Organization","site_admin":false},"repo":{"id":1563281,"name":"qreal","full_name":"qreal/qreal","owner":{"login":"qreal","id":706806,"avatar_url":"https://avatars.githubusercontent.com/u/706806?v=3","gravatar_id":"","url":"https://api.github.com/users/qreal","html_url":"https://github.com/qreal","followers_url":"https://api.github.com/users/qreal/followers","following_url":"https://api.github.com/users/qreal/following{/other_user}","gists_url":"https://api.github.com/users/qreal/gists{/gist_id}","starred_url":"https://api.github.com/users/qreal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qreal/subscriptions","organizations_url":"https://api.github.com/users/qreal/orgs","repos_url":"https://api.github.com/users/qreal/repos","events_url":"https://api.github.com/users/qreal/events{/privacy}","received_events_url":"https://api.github.com/users/qreal/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qreal/qreal","description":"CASE and metaCASE system","fork":false,"url":"https://api.github.com/repos/qreal/qreal","forks_url":"https://api.github.com/repos/qreal/qreal/forks","keys_url":"https://api.github.com/repos/qreal/qreal/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qreal/qreal/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qreal/qreal/teams","hooks_url":"https://api.github.com/repos/qreal/qreal/hooks","issue_events_url":"https://api.github.com/repos/qreal/qreal/issues/events{/number}","events_url":"https://api.github.com/repos/qreal/qreal/events","assignees_url":"https://api.github.com/repos/qreal/qreal/assignees{/user}","branches_url":"https://api.github.com/repos/qreal/qreal/branches{/branch}","tags_url":"https://api.github.com/repos/qreal/qreal/tags","blobs_url":"https://api.github.com/repos/qreal/qreal/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qreal/qreal/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qreal/qreal/git/refs{/sha}","trees_url":"https://api.github.com/repos/qreal/qreal/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qreal/qreal/statuses/{sha}","languages_url":"https://api.github.com/repos/qreal/qreal/languages","stargazers_url":"https://api.github.com/repos/qreal/qreal/stargazers","contributors_url":"https://api.github.com/repos/qreal/qreal/contributors","subscribers_url":"https://api.github.com/repos/qreal/qreal/subscribers","subscription_url":"https://api.github.com/repos/qreal/qreal/subscription","commits_url":"https://api.github.com/repos/qreal/qreal/commits{/sha}","git_commits_url":"https://api.github.com/repos/qreal/qreal/git/commits{/sha}","comments_url":"https://api.github.com/repos/qreal/qreal/comments{/number}","issue_comment_url":"https://api.github.com/repos/qreal/qreal/issues/comments{/number}","contents_url":"https://api.github.com/repos/qreal/qreal/contents/{+path}","compare_url":"https://api.github.com/repos/qreal/qreal/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qreal/qreal/merges","archive_url":"https://api.github.com/repos/qreal/qreal/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qreal/qreal/downloads","issues_url":"https://api.github.com/repos/qreal/qreal/issues{/number}","pulls_url":"https://api.github.com/repos/qreal/qreal/pulls{/number}","milestones_url":"https://api.github.com/repos/qreal/qreal/milestones{/number}","notifications_url":"https://api.github.com/repos/qreal/qreal/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qreal/qreal/labels{/name}","releases_url":"https://api.github.com/repos/qreal/qreal/releases{/id}","created_at":"2011-04-03T15:38:06Z","updated_at":"2015-07-15T13:13:40Z","pushed_at":"2015-07-20T10:46:09Z","git_url":"git://github.com/qreal/qreal.git","ssh_url":"git@github.com:qreal/qreal.git","clone_url":"https://github.com/qreal/qreal.git","svn_url":"https://github.com/qreal/qreal","homepage":"","size":469823,"stargazers_count":36,"watchers_count":36,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":74,"mirror_url":null,"open_issues_count":149,"forks":74,"open_issues":149,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qreal/qreal/pulls/1490"},"html":{"href":"https://github.com/qreal/qreal/pull/1490"},"issue":{"href":"https://api.github.com/repos/qreal/qreal/issues/1490"},"comments":{"href":"https://api.github.com/repos/qreal/qreal/issues/1490/comments"},"review_comments":{"href":"https://api.github.com/repos/qreal/qreal/pulls/1490/comments"},"review_comment":{"href":"https://api.github.com/repos/qreal/qreal/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qreal/qreal/pulls/1490/commits"},"statuses":{"href":"https://api.github.com/repos/qreal/qreal/statuses/847bed1aae6cbb1ef4905d45ac94f640e855cb9b"}}}}