{"action":"created","comment":{"url":"https://api.github.com/repos/KDAB/GammaRay/pulls/comments/28330834","id":28330834,"diff_hunk":"@@ -0,0 +1,131 @@\n+/*\n+  backtracemodel.cpp\n+\n+  This file is part of GammaRay, the Qt application inspection and\n+  manipulation tool.\n+\n+  Copyright (C) 2010-2015 Klarälvdalens Datakonsult AB, a KDAB Group company, info@kdab.com\n+  Author: Gábor Angyal <angyalgabor@outlook.com>\n+\n+  This program is free software; you can redistribute it and/or modify\n+  it under the terms of the GNU General Public License as published by\n+  the Free Software Foundation, either version 2 of the License, or\n+  (at your option) any later version.\n+\n+  This program is distributed in the hope that it will be useful,\n+  but WITHOUT ANY WARRANTY; without even the implied warranty of\n+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n+  GNU General Public License for more details.\n+\n+  You should have received a copy of the GNU General Public License\n+  along with this program.  If not, see <http://www.gnu.org/licenses/>.\n+*/\n+\n+#include \"backtracemodel.h\"\n+\n+#include <tuple>\n+\n+using namespace std;\n+using namespace GammaRay;\n+\n+BacktraceModel::BacktraceModel(QObject *parent)\n+{\n+}\n+\n+int BacktraceModel::rowCount(const QModelIndex &parent) const\n+{\n+  Q_UNUSED(parent);\n+  return m_data.count();\n+}\n+\n+int BacktraceModel::columnCount(const QModelIndex &parent) const\n+{\n+  Q_UNUSED(parent);\n+  return COLUMN_COUNT;\n+}\n+\n+//Parses input in \"aaa (bbb)\" format into a tuple of \"aaa\" and \"bbb\".\n+tuple<QString, QString> parseParenthesis(QString str)\n+{\n+  QStringList parts = str.split(\" (\");\n+  if (parts.count() != 2)\n+    return tuple<QString, QString>();\n+  QString second = parts.at(1).left(parts.at(1).count()-1);\n+  return make_tuple(parts.at(0), second);\n+}\n+\n+//The input either contains a function name only,\n+//or is in the ClassName::FunctionName format.\n+tuple<QString, QString> parseClassAndFunctionName(QString str)","path":"core/tools/messagehandler/backtracemodel.cpp","position":59,"original_position":59,"commit_id":"56fc988922c0bfea9637ea7f3171edd758fc409a","original_commit_id":"56fc988922c0bfea9637ea7f3171edd758fc409a","user":{"login":"milianw","id":57207,"avatar_url":"https://avatars.githubusercontent.com/u/57207?v=3","gravatar_id":"","url":"https://api.github.com/users/milianw","html_url":"https://github.com/milianw","followers_url":"https://api.github.com/users/milianw/followers","following_url":"https://api.github.com/users/milianw/following{/other_user}","gists_url":"https://api.github.com/users/milianw/gists{/gist_id}","starred_url":"https://api.github.com/users/milianw/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/milianw/subscriptions","organizations_url":"https://api.github.com/users/milianw/orgs","repos_url":"https://api.github.com/users/milianw/repos","events_url":"https://api.github.com/users/milianw/events{/privacy}","received_events_url":"https://api.github.com/users/milianw/received_events","type":"User","site_admin":false},"body":"see above","created_at":"2015-04-14T14:24:03Z","updated_at":"2015-04-14T14:24:03Z","html_url":"https://github.com/KDAB/GammaRay/pull/112#discussion_r28330834","pull_request_url":"https://api.github.com/repos/KDAB/GammaRay/pulls/112","_links":{"self":{"href":"https://api.github.com/repos/KDAB/GammaRay/pulls/comments/28330834"},"html":{"href":"https://github.com/KDAB/GammaRay/pull/112#discussion_r28330834"},"pull_request":{"href":"https://api.github.com/repos/KDAB/GammaRay/pulls/112"}}},"pull_request":{"url":"https://api.github.com/repos/KDAB/GammaRay/pulls/112","id":30720010,"html_url":"https://github.com/KDAB/GammaRay/pull/112","diff_url":"https://github.com/KDAB/GammaRay/pull/112.diff","patch_url":"https://github.com/KDAB/GammaRay/pull/112.patch","issue_url":"https://api.github.com/repos/KDAB/GammaRay/issues/112","number":112,"state":"open","locked":false,"title":"Fixing some message handling issues","user":{"login":"agabor","id":6016661,"avatar_url":"https://avatars.githubusercontent.com/u/6016661?v=3","gravatar_id":"","url":"https://api.github.com/users/agabor","html_url":"https://github.com/agabor","followers_url":"https://api.github.com/users/agabor/followers","following_url":"https://api.github.com/users/agabor/following{/other_user}","gists_url":"https://api.github.com/users/agabor/gists{/gist_id}","starred_url":"https://api.github.com/users/agabor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agabor/subscriptions","organizations_url":"https://api.github.com/users/agabor/orgs","repos_url":"https://api.github.com/users/agabor/repos","events_url":"https://api.github.com/users/agabor/events{/privacy}","received_events_url":"https://api.github.com/users/agabor/received_events","type":"User","site_admin":false},"body":"This pull request is a follow up for this one: https://github.com/KDAB/GammaRay/pull/110\r\n1. The problem mentioned there is that the message handling dialog does not always appear when a `qFatal` message is received. The reason for this is, that the `MessageHandlerWidget`, which implements the handling of this message, is lazy initialized. Because of this the message handling dialog only appears if the \"Messages\" tab was previously selected in the tool selector. I could think of two ways around this:\r\n   * Force the initialization of the `MessageHandlerWidget`. This would certainly solve the problem, but feels dirty: for later readers of the code it would not be appearent why this is the only widget that is not lazy initialized.\r\n   * Move the error handling code to somewhere else. This seemed to be the cleaner way to go, so I did this. I extracted thi implementation fo the message handling dialog into its own class, and moved the invocation code into the `MainWindow`. This also has the side effect that I can set the main window as the parent for the message handling dialog, which this way receives the GammaRay icon, improving user experience :)\r\n\r\n2. I have run into the following phenomenon: When I start GammaRay the \"Objects\" tab is selected on the tool selector. Now if I click on the \"Messages\" tab the selector quickly jumps back to the \"Objects\" tab. I have found that the reason for this is how the `selectInitialTool` function is called in the `MainWindow` constructor. This function is connected to the `rowsInserted` and the `dataChanged` events of the `toolSelector`, but uppon succesfull call of this method, it disconnects itself. The problem I belevie is that this function was called from the constructor before it was connected to these events, so if the first call was succesfull it still remained connected. I assumed this was not intended, so I have chanded the invocation order, which fixed the problem.\r\n\r\n3. A code comment in `MessageHandlerWidget` told me that the display of the backtrace for each message is a TODO, so I implemented it. For this I created the `core/tools/messagehandler/BacktraceModel` class. An instance of this class is retrieved from the `ObjectBroker` in the `MessageHandlerWidget`. I added the `selectMessage` function to the `MessageHandlerInterface` which refreshes the backtrace model when a message is selected on the GUI.","created_at":"2015-03-08T14:06:03Z","updated_at":"2015-04-14T14:24:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"95abbd0e1069f6f56adfd889cece8110105e2b28","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/KDAB/GammaRay/pulls/112/commits","review_comments_url":"https://api.github.com/repos/KDAB/GammaRay/pulls/112/comments","review_comment_url":"https://api.github.com/repos/KDAB/GammaRay/pulls/comments{/number}","comments_url":"https://api.github.com/repos/KDAB/GammaRay/issues/112/comments","statuses_url":"https://api.github.com/repos/KDAB/GammaRay/statuses/56fc988922c0bfea9637ea7f3171edd758fc409a","head":{"label":"agabor:master","ref":"master","sha":"56fc988922c0bfea9637ea7f3171edd758fc409a","user":{"login":"agabor","id":6016661,"avatar_url":"https://avatars.githubusercontent.com/u/6016661?v=3","gravatar_id":"","url":"https://api.github.com/users/agabor","html_url":"https://github.com/agabor","followers_url":"https://api.github.com/users/agabor/followers","following_url":"https://api.github.com/users/agabor/following{/other_user}","gists_url":"https://api.github.com/users/agabor/gists{/gist_id}","starred_url":"https://api.github.com/users/agabor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agabor/subscriptions","organizations_url":"https://api.github.com/users/agabor/orgs","repos_url":"https://api.github.com/users/agabor/repos","events_url":"https://api.github.com/users/agabor/events{/privacy}","received_events_url":"https://api.github.com/users/agabor/received_events","type":"User","site_admin":false},"repo":{"id":30452552,"name":"GammaRay","full_name":"agabor/GammaRay","owner":{"login":"agabor","id":6016661,"avatar_url":"https://avatars.githubusercontent.com/u/6016661?v=3","gravatar_id":"","url":"https://api.github.com/users/agabor","html_url":"https://github.com/agabor","followers_url":"https://api.github.com/users/agabor/followers","following_url":"https://api.github.com/users/agabor/following{/other_user}","gists_url":"https://api.github.com/users/agabor/gists{/gist_id}","starred_url":"https://api.github.com/users/agabor/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/agabor/subscriptions","organizations_url":"https://api.github.com/users/agabor/orgs","repos_url":"https://api.github.com/users/agabor/repos","events_url":"https://api.github.com/users/agabor/events{/privacy}","received_events_url":"https://api.github.com/users/agabor/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/agabor/GammaRay","description":"GammaRay is a tool to poke around in a Qt-application and also to manipulate the application to some extent.","fork":true,"url":"https://api.github.com/repos/agabor/GammaRay","forks_url":"https://api.github.com/repos/agabor/GammaRay/forks","keys_url":"https://api.github.com/repos/agabor/GammaRay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/agabor/GammaRay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/agabor/GammaRay/teams","hooks_url":"https://api.github.com/repos/agabor/GammaRay/hooks","issue_events_url":"https://api.github.com/repos/agabor/GammaRay/issues/events{/number}","events_url":"https://api.github.com/repos/agabor/GammaRay/events","assignees_url":"https://api.github.com/repos/agabor/GammaRay/assignees{/user}","branches_url":"https://api.github.com/repos/agabor/GammaRay/branches{/branch}","tags_url":"https://api.github.com/repos/agabor/GammaRay/tags","blobs_url":"https://api.github.com/repos/agabor/GammaRay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/agabor/GammaRay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/agabor/GammaRay/git/refs{/sha}","trees_url":"https://api.github.com/repos/agabor/GammaRay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/agabor/GammaRay/statuses/{sha}","languages_url":"https://api.github.com/repos/agabor/GammaRay/languages","stargazers_url":"https://api.github.com/repos/agabor/GammaRay/stargazers","contributors_url":"https://api.github.com/repos/agabor/GammaRay/contributors","subscribers_url":"https://api.github.com/repos/agabor/GammaRay/subscribers","subscription_url":"https://api.github.com/repos/agabor/GammaRay/subscription","commits_url":"https://api.github.com/repos/agabor/GammaRay/commits{/sha}","git_commits_url":"https://api.github.com/repos/agabor/GammaRay/git/commits{/sha}","comments_url":"https://api.github.com/repos/agabor/GammaRay/comments{/number}","issue_comment_url":"https://api.github.com/repos/agabor/GammaRay/issues/comments{/number}","contents_url":"https://api.github.com/repos/agabor/GammaRay/contents/{+path}","compare_url":"https://api.github.com/repos/agabor/GammaRay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/agabor/GammaRay/merges","archive_url":"https://api.github.com/repos/agabor/GammaRay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/agabor/GammaRay/downloads","issues_url":"https://api.github.com/repos/agabor/GammaRay/issues{/number}","pulls_url":"https://api.github.com/repos/agabor/GammaRay/pulls{/number}","milestones_url":"https://api.github.com/repos/agabor/GammaRay/milestones{/number}","notifications_url":"https://api.github.com/repos/agabor/GammaRay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/agabor/GammaRay/labels{/name}","releases_url":"https://api.github.com/repos/agabor/GammaRay/releases{/id}","created_at":"2015-02-07T10:32:12Z","updated_at":"2015-03-08T13:11:49Z","pushed_at":"2015-03-08T13:11:49Z","git_url":"git://github.com/agabor/GammaRay.git","ssh_url":"git@github.com:agabor/GammaRay.git","clone_url":"https://github.com/agabor/GammaRay.git","svn_url":"https://github.com/agabor/GammaRay","homepage":"http://www.kdab.com/gammaray","size":10236,"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":"KDAB:master","ref":"master","sha":"c97528dc06e3d4704fbb238f4a65b77279c745bb","user":{"login":"KDAB","id":402842,"avatar_url":"https://avatars.githubusercontent.com/u/402842?v=3","gravatar_id":"","url":"https://api.github.com/users/KDAB","html_url":"https://github.com/KDAB","followers_url":"https://api.github.com/users/KDAB/followers","following_url":"https://api.github.com/users/KDAB/following{/other_user}","gists_url":"https://api.github.com/users/KDAB/gists{/gist_id}","starred_url":"https://api.github.com/users/KDAB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KDAB/subscriptions","organizations_url":"https://api.github.com/users/KDAB/orgs","repos_url":"https://api.github.com/users/KDAB/repos","events_url":"https://api.github.com/users/KDAB/events{/privacy}","received_events_url":"https://api.github.com/users/KDAB/received_events","type":"Organization","site_admin":false},"repo":{"id":2615451,"name":"GammaRay","full_name":"KDAB/GammaRay","owner":{"login":"KDAB","id":402842,"avatar_url":"https://avatars.githubusercontent.com/u/402842?v=3","gravatar_id":"","url":"https://api.github.com/users/KDAB","html_url":"https://github.com/KDAB","followers_url":"https://api.github.com/users/KDAB/followers","following_url":"https://api.github.com/users/KDAB/following{/other_user}","gists_url":"https://api.github.com/users/KDAB/gists{/gist_id}","starred_url":"https://api.github.com/users/KDAB/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/KDAB/subscriptions","organizations_url":"https://api.github.com/users/KDAB/orgs","repos_url":"https://api.github.com/users/KDAB/repos","events_url":"https://api.github.com/users/KDAB/events{/privacy}","received_events_url":"https://api.github.com/users/KDAB/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/KDAB/GammaRay","description":"GammaRay is a tool to poke around in a Qt-application and also to manipulate the application to some extent.","fork":false,"url":"https://api.github.com/repos/KDAB/GammaRay","forks_url":"https://api.github.com/repos/KDAB/GammaRay/forks","keys_url":"https://api.github.com/repos/KDAB/GammaRay/keys{/key_id}","collaborators_url":"https://api.github.com/repos/KDAB/GammaRay/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/KDAB/GammaRay/teams","hooks_url":"https://api.github.com/repos/KDAB/GammaRay/hooks","issue_events_url":"https://api.github.com/repos/KDAB/GammaRay/issues/events{/number}","events_url":"https://api.github.com/repos/KDAB/GammaRay/events","assignees_url":"https://api.github.com/repos/KDAB/GammaRay/assignees{/user}","branches_url":"https://api.github.com/repos/KDAB/GammaRay/branches{/branch}","tags_url":"https://api.github.com/repos/KDAB/GammaRay/tags","blobs_url":"https://api.github.com/repos/KDAB/GammaRay/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/KDAB/GammaRay/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/KDAB/GammaRay/git/refs{/sha}","trees_url":"https://api.github.com/repos/KDAB/GammaRay/git/trees{/sha}","statuses_url":"https://api.github.com/repos/KDAB/GammaRay/statuses/{sha}","languages_url":"https://api.github.com/repos/KDAB/GammaRay/languages","stargazers_url":"https://api.github.com/repos/KDAB/GammaRay/stargazers","contributors_url":"https://api.github.com/repos/KDAB/GammaRay/contributors","subscribers_url":"https://api.github.com/repos/KDAB/GammaRay/subscribers","subscription_url":"https://api.github.com/repos/KDAB/GammaRay/subscription","commits_url":"https://api.github.com/repos/KDAB/GammaRay/commits{/sha}","git_commits_url":"https://api.github.com/repos/KDAB/GammaRay/git/commits{/sha}","comments_url":"https://api.github.com/repos/KDAB/GammaRay/comments{/number}","issue_comment_url":"https://api.github.com/repos/KDAB/GammaRay/issues/comments{/number}","contents_url":"https://api.github.com/repos/KDAB/GammaRay/contents/{+path}","compare_url":"https://api.github.com/repos/KDAB/GammaRay/compare/{base}...{head}","merges_url":"https://api.github.com/repos/KDAB/GammaRay/merges","archive_url":"https://api.github.com/repos/KDAB/GammaRay/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/KDAB/GammaRay/downloads","issues_url":"https://api.github.com/repos/KDAB/GammaRay/issues{/number}","pulls_url":"https://api.github.com/repos/KDAB/GammaRay/pulls{/number}","milestones_url":"https://api.github.com/repos/KDAB/GammaRay/milestones{/number}","notifications_url":"https://api.github.com/repos/KDAB/GammaRay/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/KDAB/GammaRay/labels{/name}","releases_url":"https://api.github.com/repos/KDAB/GammaRay/releases{/id}","created_at":"2011-10-20T19:00:06Z","updated_at":"2015-04-11T01:06:18Z","pushed_at":"2015-04-10T11:20:39Z","git_url":"git://github.com/KDAB/GammaRay.git","ssh_url":"git@github.com:KDAB/GammaRay.git","clone_url":"https://github.com/KDAB/GammaRay.git","svn_url":"https://github.com/KDAB/GammaRay","homepage":"http://www.kdab.com/gammaray","size":16674,"stargazers_count":158,"watchers_count":158,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":39,"mirror_url":null,"open_issues_count":18,"forks":39,"open_issues":18,"watchers":158,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/KDAB/GammaRay/pulls/112"},"html":{"href":"https://github.com/KDAB/GammaRay/pull/112"},"issue":{"href":"https://api.github.com/repos/KDAB/GammaRay/issues/112"},"comments":{"href":"https://api.github.com/repos/KDAB/GammaRay/issues/112/comments"},"review_comments":{"href":"https://api.github.com/repos/KDAB/GammaRay/pulls/112/comments"},"review_comment":{"href":"https://api.github.com/repos/KDAB/GammaRay/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/KDAB/GammaRay/pulls/112/commits"},"statuses":{"href":"https://api.github.com/repos/KDAB/GammaRay/statuses/56fc988922c0bfea9637ea7f3171edd758fc409a"}}}}