{"action":"created","comment":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/comments/59292902","id":59292902,"diff_hunk":"@@ -335,19 +458,26 @@ void QgsSingleBandPseudoColorRendererWidget::on_mClassifyButton_clicked()\n   QList<double>::const_iterator value_it = entryValues.begin();\n   QVector<QColor>::const_iterator color_it = entryColors.begin();\n \n+  // calculate a reasonable number of decimals to display\n+  double maxabs = log10( std::max<double>( std::fabs( max ), std::fabs( min ) ) );\n+  int nDecimals = round( std::max<double>( 3.0 + maxabs - log10( max - min ), maxabs <= 6.0 ? maxabs + 0.49 : 0.0 ) );\n+\n   for ( ; value_it != entryValues.end(); ++value_it, ++color_it )\n   {\n-    QTreeWidgetItem* newItem = new QTreeWidgetItem( mColormapTreeWidget );\n-    newItem->setText( 0, QString::number( *value_it, 'f' ) );\n+    QgsTreeWidgetItem* newItem = new QgsTreeWidgetItem( mColormapTreeWidget );\n+    newItem->setText( 0, QString::number( *value_it, 'g', nDecimals ) );\n     newItem->setBackground( 1, QBrush( *color_it ) );\n-    newItem->setText( 2, QString::number( *value_it, 'f' ) );\n+    newItem->setText( 2, \"\" );","path":"src/gui/raster/qgssinglebandpseudocolorrendererwidget.cpp","position":279,"original_position":279,"commit_id":"a3b2360f848fe9e87e1a6fc6e23abb4b041af8cf","original_commit_id":"a3b2360f848fe9e87e1a6fc6e23abb4b041af8cf","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":"`ewItem->setText( 2, QString() );`","created_at":"2016-04-11T22:29:15Z","updated_at":"2016-04-11T22:29:15Z","html_url":"https://github.com/qgis/QGIS/pull/2979#discussion_r59292902","pull_request_url":"https://api.github.com/repos/qgis/QGIS/pulls/2979","_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments/59292902"},"html":{"href":"https://github.com/qgis/QGIS/pull/2979#discussion_r59292902"},"pull_request":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2979"}}},"pull_request":{"url":"https://api.github.com/repos/qgis/QGIS/pulls/2979","id":65468271,"html_url":"https://github.com/qgis/QGIS/pull/2979","diff_url":"https://github.com/qgis/QGIS/pull/2979.diff","patch_url":"https://github.com/qgis/QGIS/pull/2979.patch","issue_url":"https://api.github.com/repos/qgis/QGIS/issues/2979","number":2979,"state":"open","locked":false,"title":"Color mapping tweaks, quantile mode, improved labels, ...","user":{"login":"pierstitus","id":4028149,"avatar_url":"https://avatars.githubusercontent.com/u/4028149?v=3","gravatar_id":"","url":"https://api.github.com/users/pierstitus","html_url":"https://github.com/pierstitus","followers_url":"https://api.github.com/users/pierstitus/followers","following_url":"https://api.github.com/users/pierstitus/following{/other_user}","gists_url":"https://api.github.com/users/pierstitus/gists{/gist_id}","starred_url":"https://api.github.com/users/pierstitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierstitus/subscriptions","organizations_url":"https://api.github.com/users/pierstitus/orgs","repos_url":"https://api.github.com/users/pierstitus/repos","events_url":"https://api.github.com/users/pierstitus/events{/privacy}","received_events_url":"https://api.github.com/users/pierstitus/received_events","type":"User","site_admin":false},"body":"This patch contains several tweaks to the pseudocolor raster color mapping interface:\r\n- Get rid of leading zeros\r\n- Automatically update labels if the value is manually changed\r\n- Optionally add a unit to the labels\r\n- Make distinction between automatic labels and manual labels, manual labels are skipped by automatic labeling\r\n- Improve sort code, sort automatically after each edit, and remove the sort button \r\n- Add Quantile based color map classification mode\r\n\r\n![color_map_tweaks](https://cloud.githubusercontent.com/assets/4028149/14318609/faa1e3f2-fc0d-11e5-8bfd-2880f31e6f3d.png)\r\n","created_at":"2016-04-06T13:44:11Z","updated_at":"2016-04-11T22:29:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"9137d99432356ab0416cfe087fd77ea4db6e6c7b","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/qgis/QGIS/pulls/2979/commits","review_comments_url":"https://api.github.com/repos/qgis/QGIS/pulls/2979/comments","review_comment_url":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qgis/QGIS/issues/2979/comments","statuses_url":"https://api.github.com/repos/qgis/QGIS/statuses/a3b2360f848fe9e87e1a6fc6e23abb4b041af8cf","head":{"label":"pierstitus:pseudocolor_tweaks","ref":"pseudocolor_tweaks","sha":"a3b2360f848fe9e87e1a6fc6e23abb4b041af8cf","user":{"login":"pierstitus","id":4028149,"avatar_url":"https://avatars.githubusercontent.com/u/4028149?v=3","gravatar_id":"","url":"https://api.github.com/users/pierstitus","html_url":"https://github.com/pierstitus","followers_url":"https://api.github.com/users/pierstitus/followers","following_url":"https://api.github.com/users/pierstitus/following{/other_user}","gists_url":"https://api.github.com/users/pierstitus/gists{/gist_id}","starred_url":"https://api.github.com/users/pierstitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierstitus/subscriptions","organizations_url":"https://api.github.com/users/pierstitus/orgs","repos_url":"https://api.github.com/users/pierstitus/repos","events_url":"https://api.github.com/users/pierstitus/events{/privacy}","received_events_url":"https://api.github.com/users/pierstitus/received_events","type":"User","site_admin":false},"repo":{"id":55577646,"name":"QGIS","full_name":"pierstitus/QGIS","owner":{"login":"pierstitus","id":4028149,"avatar_url":"https://avatars.githubusercontent.com/u/4028149?v=3","gravatar_id":"","url":"https://api.github.com/users/pierstitus","html_url":"https://github.com/pierstitus","followers_url":"https://api.github.com/users/pierstitus/followers","following_url":"https://api.github.com/users/pierstitus/following{/other_user}","gists_url":"https://api.github.com/users/pierstitus/gists{/gist_id}","starred_url":"https://api.github.com/users/pierstitus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pierstitus/subscriptions","organizations_url":"https://api.github.com/users/pierstitus/orgs","repos_url":"https://api.github.com/users/pierstitus/repos","events_url":"https://api.github.com/users/pierstitus/events{/privacy}","received_events_url":"https://api.github.com/users/pierstitus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pierstitus/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/pierstitus/QGIS","forks_url":"https://api.github.com/repos/pierstitus/QGIS/forks","keys_url":"https://api.github.com/repos/pierstitus/QGIS/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pierstitus/QGIS/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pierstitus/QGIS/teams","hooks_url":"https://api.github.com/repos/pierstitus/QGIS/hooks","issue_events_url":"https://api.github.com/repos/pierstitus/QGIS/issues/events{/number}","events_url":"https://api.github.com/repos/pierstitus/QGIS/events","assignees_url":"https://api.github.com/repos/pierstitus/QGIS/assignees{/user}","branches_url":"https://api.github.com/repos/pierstitus/QGIS/branches{/branch}","tags_url":"https://api.github.com/repos/pierstitus/QGIS/tags","blobs_url":"https://api.github.com/repos/pierstitus/QGIS/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pierstitus/QGIS/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pierstitus/QGIS/git/refs{/sha}","trees_url":"https://api.github.com/repos/pierstitus/QGIS/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pierstitus/QGIS/statuses/{sha}","languages_url":"https://api.github.com/repos/pierstitus/QGIS/languages","stargazers_url":"https://api.github.com/repos/pierstitus/QGIS/stargazers","contributors_url":"https://api.github.com/repos/pierstitus/QGIS/contributors","subscribers_url":"https://api.github.com/repos/pierstitus/QGIS/subscribers","subscription_url":"https://api.github.com/repos/pierstitus/QGIS/subscription","commits_url":"https://api.github.com/repos/pierstitus/QGIS/commits{/sha}","git_commits_url":"https://api.github.com/repos/pierstitus/QGIS/git/commits{/sha}","comments_url":"https://api.github.com/repos/pierstitus/QGIS/comments{/number}","issue_comment_url":"https://api.github.com/repos/pierstitus/QGIS/issues/comments{/number}","contents_url":"https://api.github.com/repos/pierstitus/QGIS/contents/{+path}","compare_url":"https://api.github.com/repos/pierstitus/QGIS/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pierstitus/QGIS/merges","archive_url":"https://api.github.com/repos/pierstitus/QGIS/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pierstitus/QGIS/downloads","issues_url":"https://api.github.com/repos/pierstitus/QGIS/issues{/number}","pulls_url":"https://api.github.com/repos/pierstitus/QGIS/pulls{/number}","milestones_url":"https://api.github.com/repos/pierstitus/QGIS/milestones{/number}","notifications_url":"https://api.github.com/repos/pierstitus/QGIS/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pierstitus/QGIS/labels{/name}","releases_url":"https://api.github.com/repos/pierstitus/QGIS/releases{/id}","deployments_url":"https://api.github.com/repos/pierstitus/QGIS/deployments","created_at":"2016-04-06T05:15:39Z","updated_at":"2016-04-06T05:16:09Z","pushed_at":"2016-04-11T12:42:51Z","git_url":"git://github.com/pierstitus/QGIS.git","ssh_url":"git@github.com:pierstitus/QGIS.git","clone_url":"https://github.com/pierstitus/QGIS.git","svn_url":"https://github.com/pierstitus/QGIS","homepage":"http://qgis.org","size":1274566,"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":"3ba3986ae2c411ad1f557181cec30ecbd9532b5b","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}","deployments_url":"https://api.github.com/repos/qgis/QGIS/deployments","created_at":"2011-05-02T08:06:26Z","updated_at":"2016-04-11T03:17:10Z","pushed_at":"2016-04-11T22:09:10Z","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":1303382,"stargazers_count":939,"watchers_count":939,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":823,"mirror_url":null,"open_issues_count":61,"forks":823,"open_issues":61,"watchers":939,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2979"},"html":{"href":"https://github.com/qgis/QGIS/pull/2979"},"issue":{"href":"https://api.github.com/repos/qgis/QGIS/issues/2979"},"comments":{"href":"https://api.github.com/repos/qgis/QGIS/issues/2979/comments"},"review_comments":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2979/comments"},"review_comment":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qgis/QGIS/pulls/2979/commits"},"statuses":{"href":"https://api.github.com/repos/qgis/QGIS/statuses/a3b2360f848fe9e87e1a6fc6e23abb4b041af8cf"}}}}