{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/comments/46547347","id":46547347,"diff_hunk":"@@ -519,6 +519,77 @@ void QgsCategorizedSymbolRendererV2::toSld( QDomDocument &doc, QDomElement &elem\n   }\n }\n \n+QString QgsCategorizedSymbolRendererV2::filter( const QgsFields& fields )\n+{\n+  int attrNum = fields.fieldNameIndex( mAttrName );\n+  bool isExpression = ( attrNum == -1 );\n+\n+  bool hasDefault = false;\n+  bool defaultActive = false;\n+  bool allActive = true;\n+  bool noneActive = true;\n+\n+  //we need to build lists of both inactive and active values, as either list may be required\n+  //depending on whether the default category is active or not\n+  QString activeValues;\n+  QString inactiveValues;\n+\n+  Q_FOREACH ( const QgsRendererCategoryV2& cat, mCategories )\n+  {\n+    if ( cat.value() == \"\" )\n+    {\n+      hasDefault = true;\n+      defaultActive = cat.renderState();\n+    }\n+\n+    noneActive = noneActive && !cat.renderState();\n+    allActive = allActive && cat.renderState();\n+\n+    QVariant::Type valType = isExpression ? cat.value().type() : fields.at( attrNum ).type();\n+    QString value = QgsExpression::quotedValue( cat.value(), valType );\n+\n+    if ( !cat.renderState() )\n+    {\n+      allActive = false;","path":"src/core/symbology-ng/qgscategorizedsymbolrendererv2.cpp","position":35,"original_position":35,"commit_id":"6650165a802894d9d481c5005421853ad41959f1","original_commit_id":"6650165a802894d9d481c5005421853ad41959f1","user":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"body":"Duplicate with line 546?","created_at":"2015-12-03T12:52:23Z","updated_at":"2015-12-03T12:52:23Z","html_url":"https://github.com/qgis/QGIS/pull/2526#discussion_r46547347","pull_request_url":"https://api.github.com/repos/qgis/QGIS/pulls/2526","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments/46547347"},"html":{"href":"https://github.com/qgis/QGIS/pull/2526#discussion_r46547347"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2526"}}},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/2526","id":52354751,"html_url":"https://github.com/qgis/QGIS/pull/2526","diff_url":"https://github.com/qgis/QGIS/pull/2526.diff","patch_url":"https://github.com/qgis/QGIS/pull/2526.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/2526","number":2526,"state":"open","locked":false,"title":"Apply filters to feature request for categorized renderer","user":{"login":"nyalldawson","id":1829991,"avatar_url":"https://avatars.githubusercontent.com/u/1829991?v=3","gravatar_id":"","url":"https://api.github.com/users/nyalldawson","html_url":"https://github.com/nyalldawson","followers_url":"https://api.github.com/users/nyalldawson/followers","following_url":"https://api.github.com/users/nyalldawson/following{/other_user}","gists_url":"https://api.github.com/users/nyalldawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nyalldawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyalldawson/subscriptions","organizations_url":"https://api.github.com/users/nyalldawson/orgs","repos_url":"https://api.github.com/users/nyalldawson/repos","events_url":"https://api.github.com/users/nyalldawson/events{/privacy}","received_events_url":"https://api.github.com/users/nyalldawson/received_events","type":"User","site_admin":false},"body":"This makes rendering for the categorized renderer MUCH faster when only certain categories are checked, as only the matching records for the displayed features are fetched from the provider. The current behaviour is that ALL features are fetched, and then only those with a matching value are rendered.\r\n\r\n","created_at":"2015-12-02T05:16:10Z","updated_at":"2015-12-03T12:52:23Z","closed_at":null,"merged_at":null,"merge_commit_sha":"c49a834779b58cb2d64ee876d6bb8edd19d41e11","assignee":{"login":"m-kuhn","id":588407,"avatar_url":"https://avatars.githubusercontent.com/u/588407?v=3","gravatar_id":"","url":"https://api.github.com/users/m-kuhn","html_url":"https://github.com/m-kuhn","followers_url":"https://api.github.com/users/m-kuhn/followers","following_url":"https://api.github.com/users/m-kuhn/following{/other_user}","gists_url":"https://api.github.com/users/m-kuhn/gists{/gist_id}","starred_url":"https://api.github.com/users/m-kuhn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/m-kuhn/subscriptions","organizations_url":"https://api.github.com/users/m-kuhn/orgs","repos_url":"https://api.github.com/users/m-kuhn/repos","events_url":"https://api.github.com/users/m-kuhn/events{/privacy}","received_events_url":"https://api.github.com/users/m-kuhn/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/2526/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/2526/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/2526/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/6650165a802894d9d481c5005421853ad41959f1","head":{"label":"nyalldawson:cat","ref":"cat","sha":"6650165a802894d9d481c5005421853ad41959f1","user":{"login":"nyalldawson","id":1829991,"avatar_url":"https://avatars.githubusercontent.com/u/1829991?v=3","gravatar_id":"","url":"https://api.github.com/users/nyalldawson","html_url":"https://github.com/nyalldawson","followers_url":"https://api.github.com/users/nyalldawson/followers","following_url":"https://api.github.com/users/nyalldawson/following{/other_user}","gists_url":"https://api.github.com/users/nyalldawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nyalldawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyalldawson/subscriptions","organizations_url":"https://api.github.com/users/nyalldawson/orgs","repos_url":"https://api.github.com/users/nyalldawson/repos","events_url":"https://api.github.com/users/nyalldawson/events{/privacy}","received_events_url":"https://api.github.com/users/nyalldawson/received_events","type":"User","site_admin":false},"repo":{"id":8490349,"name":"QGIS","full_name":"nyalldawson/QGIS","owner":{"login":"nyalldawson","id":1829991,"avatar_url":"https://avatars.githubusercontent.com/u/1829991?v=3","gravatar_id":"","url":"https://api.github.com/users/nyalldawson","html_url":"https://github.com/nyalldawson","followers_url":"https://api.github.com/users/nyalldawson/followers","following_url":"https://api.github.com/users/nyalldawson/following{/other_user}","gists_url":"https://api.github.com/users/nyalldawson/gists{/gist_id}","starred_url":"https://api.github.com/users/nyalldawson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nyalldawson/subscriptions","organizations_url":"https://api.github.com/users/nyalldawson/orgs","repos_url":"https://api.github.com/users/nyalldawson/repos","events_url":"https://api.github.com/users/nyalldawson/events{/privacy}","received_events_url":"https://api.github.com/users/nyalldawson/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nyalldawson/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":true,"url":"https://api.github.com/repos/nyalldawson/QGIS","forks_url":"https://api.github.com/repos/nyalldawson/QGIS/forks","keys_url":"https://api.github.com/repos/nyalldawson/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nyalldawson/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nyalldawson/QGIS/teams","hooks_url":"https://api.github.com/repos/nyalldawson/QGIS/hooks","issue_events_url":"https://api.github.com/repos/nyalldawson/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/nyalldawson/QGIS/events","assignees_url":"https://api.github.com/repos/nyalldawson/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/nyalldawson/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/nyalldawson/QGIS/tags","blobs_url":"https://api.github.com/repos/nyalldawson/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nyalldawson/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nyalldawson/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/nyalldawson/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nyalldawson/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/nyalldawson/QGIS/languages","stargazers_url":"https://api.github.com/repos/nyalldawson/QGIS/stargazers","contributors_url":"https://api.github.com/repos/nyalldawson/QGIS/contributors","subscribers_url":"https://api.github.com/repos/nyalldawson/QGIS/subscribers","subscription_url":"https://api.github.com/repos/nyalldawson/QGIS/subscription","commits_url":"https://api.github.com/repos/nyalldawson/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/nyalldawson/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/nyalldawson/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/nyalldawson/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/nyalldawson/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/nyalldawson/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nyalldawson/QGIS/merges","archive_url":"https://api.github.com/repos/nyalldawson/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nyalldawson/QGIS/downloads","issues_url":"https://api.github.com/repos/nyalldawson/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/nyalldawson/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/nyalldawson/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/nyalldawson/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nyalldawson/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/nyalldawson/QGIS/releases{/id}","created_at":"2013-02-28T23:20:44Z","updated_at":"2015-05-07T12:23:35Z","pushed_at":"2015-12-03T05:13:39Z","git_url":"git://github.com/nyalldawson/QGIS.git","ssh_url":"git@github.com:nyalldawson/QGIS.git","clone_url":"https://github.com/nyalldawson/QGIS.git","svn_url":"https://github.com/nyalldawson/QGIS","homepage":"http://qgis.org","size":1083259,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"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":"qgis:master","ref":"master","sha":"71baa456f7a6fc075d0928cd55dff18ffa960b35","user":{"login":"qgis","id":483444,"avatar_url":"https://avatars.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"repo":{"id":1690480,"name":"QGIS","full_name":"qgis/QGIS","owner":{"login":"qgis","id":483444,"avatar_url":"https://avatars.githubusercontent.com/u/483444?v=3","gravatar_id":"","url":"https://api.github.com/users/qgis","html_url":"https://github.com/qgis","followers_url":"https://api.github.com/users/qgis/followers","following_url":"https://api.github.com/users/qgis/following{/other_user}","gists_url":"https://api.github.com/users/qgis/gists{/gist_id}","starred_url":"https://api.github.com/users/qgis/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qgis/subscriptions","organizations_url":"https://api.github.com/users/qgis/orgs","repos_url":"https://api.github.com/users/qgis/repos","events_url":"https://api.github.com/users/qgis/events{/privacy}","received_events_url":"https://api.github.com/users/qgis/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qgis/QGIS","description":"QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)","fork":false,"url":"https://api.github.com/repos/qgis/QGIS","forks_url":"https://api.github.com/repos/qgis/QGIS/forks","keys_url":"https://api.github.com/repos/qgis/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qgis/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qgis/QGIS/teams","hooks_url":"https://api.github.com/repos/qgis/QGIS/hooks","issue_events_url":"https://api.github.com/repos/qgis/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/qgis/QGIS/events","assignees_url":"https://api.github.com/repos/qgis/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/qgis/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/qgis/QGIS/tags","blobs_url":"https://api.github.com/repos/qgis/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qgis/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qgis/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/qgis/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/qgis/QGIS/languages","stargazers_url":"https://api.github.com/repos/qgis/QGIS/stargazers","contributors_url":"https://api.github.com/repos/qgis/QGIS/contributors","subscribers_url":"https://api.github.com/repos/qgis/QGIS/subscribers","subscription_url":"https://api.github.com/repos/qgis/QGIS/subscription","commits_url":"https://api.github.com/repos/qgis/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/qgis/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/qgis/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/qgis/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/qgis/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/qgis/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qgis/QGIS/merges","archive_url":"https://api.github.com/repos/qgis/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qgis/QGIS/downloads","issues_url":"https://api.github.com/repos/qgis/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/qgis/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/qgis/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/qgis/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qgis/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/qgis/QGIS/releases{/id}","created_at":"2011-05-02T08:06:26Z","updated_at":"2015-11-30T11:25:56Z","pushed_at":"2015-12-03T12:47:06Z","git_url":"git://github.com/qgis/QGIS.git","ssh_url":"git@github.com:qgis/QGIS.git","clone_url":"https://github.com/qgis/QGIS.git","svn_url":"https://github.com/qgis/QGIS","homepage":"http://qgis.org","size":1207869,"stargazers_count":810,"watchers_count":810,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":745,"mirror_url":null,"open_issues_count":52,"forks":745,"open_issues":52,"watchers":810,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2526"},"html":{"href":"https://github.com/qgis/QGIS/pull/2526"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/2526"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/2526/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2526/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2526/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/6650165a802894d9d481c5005421853ad41959f1"}}}}