{"action":"created","comment":{"url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/comments/26286311","id":26286311,"diff_hunk":"@@ -107,6 +109,13 @@ void DBWorker::init()\n             QSqlQuery query = prepare(db_schema[i]);\n             execute(query);\n         }\n+    } else {\n+        // Limit history size to 2000 entries\n+        QSqlQuery cleanupHistory = prepare(QString(\"DELETE FROM browser_history WHERE id NOT IN (SELECT id from \"\\\n+                                                   \"browser_history ORDER BY date DESC LIMIT %1);\").arg(MAX_BROWSER_HISTORY_SIZE));","path":"src/dbworker.cpp","position":16,"original_position":16,"commit_id":"2b83f0f8a6979aa8694ff95efe9337ebc2121097","original_commit_id":"2b83f0f8a6979aa8694ff95efe9337ebc2121097","user":{"login":"rojkov","id":33377,"avatar_url":"https://avatars.githubusercontent.com/u/33377?v=3","gravatar_id":"","url":"https://api.github.com/users/rojkov","html_url":"https://github.com/rojkov","followers_url":"https://api.github.com/users/rojkov/followers","following_url":"https://api.github.com/users/rojkov/following{/other_user}","gists_url":"https://api.github.com/users/rojkov/gists{/gist_id}","starred_url":"https://api.github.com/users/rojkov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rojkov/subscriptions","organizations_url":"https://api.github.com/users/rojkov/orgs","repos_url":"https://api.github.com/users/rojkov/repos","events_url":"https://api.github.com/users/rojkov/events{/privacy}","received_events_url":"https://api.github.com/users/rojkov/received_events","type":"User","site_admin":false},"body":"micro-optimization: a better way to extrapolate a string with a constant is to use the STR macro. This way the string would be extrapolated in build time, not run time.","created_at":"2015-03-12T09:04:59Z","updated_at":"2015-03-12T09:04:59Z","html_url":"https://github.com/sailfishos/sailfish-browser/pull/307#discussion_r26286311","pull_request_url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307","_links":{"self":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/comments/26286311"},"html":{"href":"https://github.com/sailfishos/sailfish-browser/pull/307#discussion_r26286311"},"pull_request":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307"}}},"pull_request":{"url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307","id":30934079,"html_url":"https://github.com/sailfishos/sailfish-browser/pull/307","diff_url":"https://github.com/sailfishos/sailfish-browser/pull/307.diff","patch_url":"https://github.com/sailfishos/sailfish-browser/pull/307.patch","issue_url":"https://api.github.com/repos/sailfishos/sailfish-browser/issues/307","number":307,"state":"open","locked":false,"title":"[sailfish-browser] Limit history size to 2000 entries","user":{"login":"siteshwar","id":1300760,"avatar_url":"https://avatars.githubusercontent.com/u/1300760?v=3","gravatar_id":"","url":"https://api.github.com/users/siteshwar","html_url":"https://github.com/siteshwar","followers_url":"https://api.github.com/users/siteshwar/followers","following_url":"https://api.github.com/users/siteshwar/following{/other_user}","gists_url":"https://api.github.com/users/siteshwar/gists{/gist_id}","starred_url":"https://api.github.com/users/siteshwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siteshwar/subscriptions","organizations_url":"https://api.github.com/users/siteshwar/orgs","repos_url":"https://api.github.com/users/siteshwar/repos","events_url":"https://api.github.com/users/siteshwar/events{/privacy}","received_events_url":"https://api.github.com/users/siteshwar/received_events","type":"User","site_admin":false},"body":"Fixes #199","created_at":"2015-03-11T11:20:46Z","updated_at":"2015-03-12T09:04:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"17575b3842e95d1af874e25750536b072151e5b4","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307/commits","review_comments_url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307/comments","review_comment_url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sailfishos/sailfish-browser/issues/307/comments","statuses_url":"https://api.github.com/repos/sailfishos/sailfish-browser/statuses/2b83f0f8a6979aa8694ff95efe9337ebc2121097","head":{"label":"siteshwar:sb-199","ref":"sb-199","sha":"2b83f0f8a6979aa8694ff95efe9337ebc2121097","user":{"login":"siteshwar","id":1300760,"avatar_url":"https://avatars.githubusercontent.com/u/1300760?v=3","gravatar_id":"","url":"https://api.github.com/users/siteshwar","html_url":"https://github.com/siteshwar","followers_url":"https://api.github.com/users/siteshwar/followers","following_url":"https://api.github.com/users/siteshwar/following{/other_user}","gists_url":"https://api.github.com/users/siteshwar/gists{/gist_id}","starred_url":"https://api.github.com/users/siteshwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siteshwar/subscriptions","organizations_url":"https://api.github.com/users/siteshwar/orgs","repos_url":"https://api.github.com/users/siteshwar/repos","events_url":"https://api.github.com/users/siteshwar/events{/privacy}","received_events_url":"https://api.github.com/users/siteshwar/received_events","type":"User","site_admin":false},"repo":{"id":16728959,"name":"sailfish-browser","full_name":"siteshwar/sailfish-browser","owner":{"login":"siteshwar","id":1300760,"avatar_url":"https://avatars.githubusercontent.com/u/1300760?v=3","gravatar_id":"","url":"https://api.github.com/users/siteshwar","html_url":"https://github.com/siteshwar","followers_url":"https://api.github.com/users/siteshwar/followers","following_url":"https://api.github.com/users/siteshwar/following{/other_user}","gists_url":"https://api.github.com/users/siteshwar/gists{/gist_id}","starred_url":"https://api.github.com/users/siteshwar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siteshwar/subscriptions","organizations_url":"https://api.github.com/users/siteshwar/orgs","repos_url":"https://api.github.com/users/siteshwar/repos","events_url":"https://api.github.com/users/siteshwar/events{/privacy}","received_events_url":"https://api.github.com/users/siteshwar/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/siteshwar/sailfish-browser","description":"","fork":true,"url":"https://api.github.com/repos/siteshwar/sailfish-browser","forks_url":"https://api.github.com/repos/siteshwar/sailfish-browser/forks","keys_url":"https://api.github.com/repos/siteshwar/sailfish-browser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/siteshwar/sailfish-browser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/siteshwar/sailfish-browser/teams","hooks_url":"https://api.github.com/repos/siteshwar/sailfish-browser/hooks","issue_events_url":"https://api.github.com/repos/siteshwar/sailfish-browser/issues/events{/number}","events_url":"https://api.github.com/repos/siteshwar/sailfish-browser/events","assignees_url":"https://api.github.com/repos/siteshwar/sailfish-browser/assignees{/user}","branches_url":"https://api.github.com/repos/siteshwar/sailfish-browser/branches{/branch}","tags_url":"https://api.github.com/repos/siteshwar/sailfish-browser/tags","blobs_url":"https://api.github.com/repos/siteshwar/sailfish-browser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/siteshwar/sailfish-browser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/siteshwar/sailfish-browser/git/refs{/sha}","trees_url":"https://api.github.com/repos/siteshwar/sailfish-browser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/siteshwar/sailfish-browser/statuses/{sha}","languages_url":"https://api.github.com/repos/siteshwar/sailfish-browser/languages","stargazers_url":"https://api.github.com/repos/siteshwar/sailfish-browser/stargazers","contributors_url":"https://api.github.com/repos/siteshwar/sailfish-browser/contributors","subscribers_url":"https://api.github.com/repos/siteshwar/sailfish-browser/subscribers","subscription_url":"https://api.github.com/repos/siteshwar/sailfish-browser/subscription","commits_url":"https://api.github.com/repos/siteshwar/sailfish-browser/commits{/sha}","git_commits_url":"https://api.github.com/repos/siteshwar/sailfish-browser/git/commits{/sha}","comments_url":"https://api.github.com/repos/siteshwar/sailfish-browser/comments{/number}","issue_comment_url":"https://api.github.com/repos/siteshwar/sailfish-browser/issues/comments{/number}","contents_url":"https://api.github.com/repos/siteshwar/sailfish-browser/contents/{+path}","compare_url":"https://api.github.com/repos/siteshwar/sailfish-browser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/siteshwar/sailfish-browser/merges","archive_url":"https://api.github.com/repos/siteshwar/sailfish-browser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/siteshwar/sailfish-browser/downloads","issues_url":"https://api.github.com/repos/siteshwar/sailfish-browser/issues{/number}","pulls_url":"https://api.github.com/repos/siteshwar/sailfish-browser/pulls{/number}","milestones_url":"https://api.github.com/repos/siteshwar/sailfish-browser/milestones{/number}","notifications_url":"https://api.github.com/repos/siteshwar/sailfish-browser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/siteshwar/sailfish-browser/labels{/name}","releases_url":"https://api.github.com/repos/siteshwar/sailfish-browser/releases{/id}","created_at":"2014-02-11T11:36:41Z","updated_at":"2014-02-11T11:36:45Z","pushed_at":"2015-03-11T15:23:49Z","git_url":"git://github.com/siteshwar/sailfish-browser.git","ssh_url":"git@github.com:siteshwar/sailfish-browser.git","clone_url":"https://github.com/siteshwar/sailfish-browser.git","svn_url":"https://github.com/siteshwar/sailfish-browser","homepage":null,"size":1211499,"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":"sailfishos:master","ref":"master","sha":"3954f39c633cc8ef946cbc65a546bd4883d710a7","user":{"login":"sailfishos","id":6198659,"avatar_url":"https://avatars.githubusercontent.com/u/6198659?v=3","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":16723800,"name":"sailfish-browser","full_name":"sailfishos/sailfish-browser","owner":{"login":"sailfishos","id":6198659,"avatar_url":"https://avatars.githubusercontent.com/u/6198659?v=3","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},"private":false,"html_url":"https://github.com/sailfishos/sailfish-browser","description":"Sailfish Browser","fork":false,"url":"https://api.github.com/repos/sailfishos/sailfish-browser","forks_url":"https://api.github.com/repos/sailfishos/sailfish-browser/forks","keys_url":"https://api.github.com/repos/sailfishos/sailfish-browser/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sailfishos/sailfish-browser/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sailfishos/sailfish-browser/teams","hooks_url":"https://api.github.com/repos/sailfishos/sailfish-browser/hooks","issue_events_url":"https://api.github.com/repos/sailfishos/sailfish-browser/issues/events{/number}","events_url":"https://api.github.com/repos/sailfishos/sailfish-browser/events","assignees_url":"https://api.github.com/repos/sailfishos/sailfish-browser/assignees{/user}","branches_url":"https://api.github.com/repos/sailfishos/sailfish-browser/branches{/branch}","tags_url":"https://api.github.com/repos/sailfishos/sailfish-browser/tags","blobs_url":"https://api.github.com/repos/sailfishos/sailfish-browser/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sailfishos/sailfish-browser/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sailfishos/sailfish-browser/git/refs{/sha}","trees_url":"https://api.github.com/repos/sailfishos/sailfish-browser/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sailfishos/sailfish-browser/statuses/{sha}","languages_url":"https://api.github.com/repos/sailfishos/sailfish-browser/languages","stargazers_url":"https://api.github.com/repos/sailfishos/sailfish-browser/stargazers","contributors_url":"https://api.github.com/repos/sailfishos/sailfish-browser/contributors","subscribers_url":"https://api.github.com/repos/sailfishos/sailfish-browser/subscribers","subscription_url":"https://api.github.com/repos/sailfishos/sailfish-browser/subscription","commits_url":"https://api.github.com/repos/sailfishos/sailfish-browser/commits{/sha}","git_commits_url":"https://api.github.com/repos/sailfishos/sailfish-browser/git/commits{/sha}","comments_url":"https://api.github.com/repos/sailfishos/sailfish-browser/comments{/number}","issue_comment_url":"https://api.github.com/repos/sailfishos/sailfish-browser/issues/comments{/number}","contents_url":"https://api.github.com/repos/sailfishos/sailfish-browser/contents/{+path}","compare_url":"https://api.github.com/repos/sailfishos/sailfish-browser/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sailfishos/sailfish-browser/merges","archive_url":"https://api.github.com/repos/sailfishos/sailfish-browser/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sailfishos/sailfish-browser/downloads","issues_url":"https://api.github.com/repos/sailfishos/sailfish-browser/issues{/number}","pulls_url":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls{/number}","milestones_url":"https://api.github.com/repos/sailfishos/sailfish-browser/milestones{/number}","notifications_url":"https://api.github.com/repos/sailfishos/sailfish-browser/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sailfishos/sailfish-browser/labels{/name}","releases_url":"https://api.github.com/repos/sailfishos/sailfish-browser/releases{/id}","created_at":"2014-02-11T08:11:37Z","updated_at":"2015-03-04T13:37:39Z","pushed_at":"2015-03-03T09:29:16Z","git_url":"git://github.com/sailfishos/sailfish-browser.git","ssh_url":"git@github.com:sailfishos/sailfish-browser.git","clone_url":"https://github.com/sailfishos/sailfish-browser.git","svn_url":"https://github.com/sailfishos/sailfish-browser","homepage":"https://github.com/sailfishos/sailfish-browser/wiki/Sailfish-Browser-wiki","size":7143,"stargazers_count":182,"watchers_count":182,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":55,"mirror_url":null,"open_issues_count":49,"forks":55,"open_issues":49,"watchers":182,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307"},"html":{"href":"https://github.com/sailfishos/sailfish-browser/pull/307"},"issue":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/issues/307"},"comments":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/issues/307/comments"},"review_comments":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307/comments"},"review_comment":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/pulls/307/commits"},"statuses":{"href":"https://api.github.com/repos/sailfishos/sailfish-browser/statuses/2b83f0f8a6979aa8694ff95efe9337ebc2121097"}}}}