{"action":"created","comment":{"url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/comments/25592078","id":25592078,"diff_hunk":"@@ -0,0 +1,154 @@\n+/****************************************************************************************\n+**\n+** Copyright (C) 2015 Jolla Ltd.\n+** Contact: Martin Grimme <martin.grimme@gmail.com>\n+** All rights reserved.\n+**\n+** This file is part of the btrfs-balancer package.\n+**\n+** You may use this file under the terms of the GNU Lesser General\n+** Public License version 2.1 as published by the Free Software Foundation\n+** and appearing in the file license.lgpl included in the packaging\n+** of this file.\n+**\n+** This library is free software; you can redistribute it and/or\n+** modify it under the terms of the GNU Lesser General Public\n+** License version 2.1 as published by the Free Software Foundation\n+** and appearing in the file license.lgpl included in the packaging\n+** of this file.\n+**\n+** This library 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 GNU\n+** Lesser General Public License for more details.\n+**\n+****************************************************************************************/\n+\n+\n+#include \"btrfs.h\"\n+\n+#include <QLocale>\n+#include <QRegExp>\n+#include <QDebug>\n+\n+namespace\n+{\n+// path of the btrfs tool\n+const QString BTRFS_PATH(\"/usr/sbin/btrfs\");\n+\n+// default root device to use\n+const QString ROOT_DEVICE(\"/dev/mmcblk0p28\");\n+\n+// regexp to retrieve size usage information from btrfs output\n+const QRegExp RE_USAGE(\"size ([0-9.]+\\\\w+) used ([0-9.]+\\\\w+)\");\n+\n+qint64 parseSize(const QString& size)\n+{\n+    double value = -1;\n+\n+    QLocale defaultLocale = QLocale();\n+    QLocale::setDefault(QLocale::C);","path":"src/btrfs.cpp","position":50,"original_position":50,"commit_id":"7dc0a1cb20453902c605e5a1fc1a7d500b98610f","original_commit_id":"7dc0a1cb20453902c605e5a1fc1a7d500b98610f","user":{"login":"pvuorela","id":2478615,"avatar_url":"https://avatars.githubusercontent.com/u/2478615?v=3","gravatar_id":"","url":"https://api.github.com/users/pvuorela","html_url":"https://github.com/pvuorela","followers_url":"https://api.github.com/users/pvuorela/followers","following_url":"https://api.github.com/users/pvuorela/following{/other_user}","gists_url":"https://api.github.com/users/pvuorela/gists{/gist_id}","starred_url":"https://api.github.com/users/pvuorela/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pvuorela/subscriptions","organizations_url":"https://api.github.com/users/pvuorela/orgs","repos_url":"https://api.github.com/users/pvuorela/repos","events_url":"https://api.github.com/users/pvuorela/events{/privacy}","received_events_url":"https://api.github.com/users/pvuorela/received_events","type":"User","site_admin":false},"body":"Looks unnecessary, QString: \"The string conversion will always happen in the 'C' locale. For locale dependent conversion use QLocale::toDouble()\"","created_at":"2015-03-02T11:32:57Z","updated_at":"2015-03-02T11:32:57Z","html_url":"https://github.com/sailfishos/btrfs-balancer/pull/6#discussion_r25592078","pull_request_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6","_links":{"self":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/comments/25592078"},"html":{"href":"https://github.com/sailfishos/btrfs-balancer/pull/6#discussion_r25592078"},"pull_request":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6"}}},"pull_request":{"url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6","id":30240628,"html_url":"https://github.com/sailfishos/btrfs-balancer/pull/6","diff_url":"https://github.com/sailfishos/btrfs-balancer/pull/6.diff","patch_url":"https://github.com/sailfishos/btrfs-balancer/pull/6.patch","issue_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues/6","number":6,"state":"open","locked":false,"title":"Dbus service for btrfs-balancing","user":{"login":"pycage","id":5649780,"avatar_url":"https://avatars.githubusercontent.com/u/5649780?v=3","gravatar_id":"","url":"https://api.github.com/users/pycage","html_url":"https://github.com/pycage","followers_url":"https://api.github.com/users/pycage/followers","following_url":"https://api.github.com/users/pycage/following{/other_user}","gists_url":"https://api.github.com/users/pycage/gists{/gist_id}","starred_url":"https://api.github.com/users/pycage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pycage/subscriptions","organizations_url":"https://api.github.com/users/pycage/orgs","repos_url":"https://api.github.com/users/pycage/repos","events_url":"https://api.github.com/users/pycage/events{/privacy}","received_events_url":"https://api.github.com/users/pycage/received_events","type":"User","site_admin":false},"body":"Converted the btrfs-balancer to a D-Bus system service for use by UI applications.","created_at":"2015-03-01T11:27:12Z","updated_at":"2015-03-02T11:32:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"933c0cd63328b0ae8b1b10c0b5cab0c05314488f","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6/commits","review_comments_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6/comments","review_comment_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/comments{/number}","comments_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues/6/comments","statuses_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/statuses/7dc0a1cb20453902c605e5a1fc1a7d500b98610f","head":{"label":"pycage:dbus-service","ref":"dbus-service","sha":"7dc0a1cb20453902c605e5a1fc1a7d500b98610f","user":{"login":"pycage","id":5649780,"avatar_url":"https://avatars.githubusercontent.com/u/5649780?v=3","gravatar_id":"","url":"https://api.github.com/users/pycage","html_url":"https://github.com/pycage","followers_url":"https://api.github.com/users/pycage/followers","following_url":"https://api.github.com/users/pycage/following{/other_user}","gists_url":"https://api.github.com/users/pycage/gists{/gist_id}","starred_url":"https://api.github.com/users/pycage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pycage/subscriptions","organizations_url":"https://api.github.com/users/pycage/orgs","repos_url":"https://api.github.com/users/pycage/repos","events_url":"https://api.github.com/users/pycage/events{/privacy}","received_events_url":"https://api.github.com/users/pycage/received_events","type":"User","site_admin":false},"repo":{"id":31411219,"name":"btrfs-balancer","full_name":"pycage/btrfs-balancer","owner":{"login":"pycage","id":5649780,"avatar_url":"https://avatars.githubusercontent.com/u/5649780?v=3","gravatar_id":"","url":"https://api.github.com/users/pycage","html_url":"https://github.com/pycage","followers_url":"https://api.github.com/users/pycage/followers","following_url":"https://api.github.com/users/pycage/following{/other_user}","gists_url":"https://api.github.com/users/pycage/gists{/gist_id}","starred_url":"https://api.github.com/users/pycage/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pycage/subscriptions","organizations_url":"https://api.github.com/users/pycage/orgs","repos_url":"https://api.github.com/users/pycage/repos","events_url":"https://api.github.com/users/pycage/events{/privacy}","received_events_url":"https://api.github.com/users/pycage/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pycage/btrfs-balancer","description":"Systemd service and related tools to run btrfs balance on a filesystem periodically.","fork":true,"url":"https://api.github.com/repos/pycage/btrfs-balancer","forks_url":"https://api.github.com/repos/pycage/btrfs-balancer/forks","keys_url":"https://api.github.com/repos/pycage/btrfs-balancer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pycage/btrfs-balancer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pycage/btrfs-balancer/teams","hooks_url":"https://api.github.com/repos/pycage/btrfs-balancer/hooks","issue_events_url":"https://api.github.com/repos/pycage/btrfs-balancer/issues/events{/number}","events_url":"https://api.github.com/repos/pycage/btrfs-balancer/events","assignees_url":"https://api.github.com/repos/pycage/btrfs-balancer/assignees{/user}","branches_url":"https://api.github.com/repos/pycage/btrfs-balancer/branches{/branch}","tags_url":"https://api.github.com/repos/pycage/btrfs-balancer/tags","blobs_url":"https://api.github.com/repos/pycage/btrfs-balancer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pycage/btrfs-balancer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pycage/btrfs-balancer/git/refs{/sha}","trees_url":"https://api.github.com/repos/pycage/btrfs-balancer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pycage/btrfs-balancer/statuses/{sha}","languages_url":"https://api.github.com/repos/pycage/btrfs-balancer/languages","stargazers_url":"https://api.github.com/repos/pycage/btrfs-balancer/stargazers","contributors_url":"https://api.github.com/repos/pycage/btrfs-balancer/contributors","subscribers_url":"https://api.github.com/repos/pycage/btrfs-balancer/subscribers","subscription_url":"https://api.github.com/repos/pycage/btrfs-balancer/subscription","commits_url":"https://api.github.com/repos/pycage/btrfs-balancer/commits{/sha}","git_commits_url":"https://api.github.com/repos/pycage/btrfs-balancer/git/commits{/sha}","comments_url":"https://api.github.com/repos/pycage/btrfs-balancer/comments{/number}","issue_comment_url":"https://api.github.com/repos/pycage/btrfs-balancer/issues/comments{/number}","contents_url":"https://api.github.com/repos/pycage/btrfs-balancer/contents/{+path}","compare_url":"https://api.github.com/repos/pycage/btrfs-balancer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pycage/btrfs-balancer/merges","archive_url":"https://api.github.com/repos/pycage/btrfs-balancer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pycage/btrfs-balancer/downloads","issues_url":"https://api.github.com/repos/pycage/btrfs-balancer/issues{/number}","pulls_url":"https://api.github.com/repos/pycage/btrfs-balancer/pulls{/number}","milestones_url":"https://api.github.com/repos/pycage/btrfs-balancer/milestones{/number}","notifications_url":"https://api.github.com/repos/pycage/btrfs-balancer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pycage/btrfs-balancer/labels{/name}","releases_url":"https://api.github.com/repos/pycage/btrfs-balancer/releases{/id}","created_at":"2015-02-27T08:59:05Z","updated_at":"2015-02-27T08:59:05Z","pushed_at":"2015-03-01T11:16:33Z","git_url":"git://github.com/pycage/btrfs-balancer.git","ssh_url":"git@github.com:pycage/btrfs-balancer.git","clone_url":"https://github.com/pycage/btrfs-balancer.git","svn_url":"https://github.com/pycage/btrfs-balancer","homepage":null,"size":99,"stargazers_count":0,"watchers_count":0,"language":"Shell","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":"ff2bad137eb6aeeca1d1b8c53b24f8eec2bf640f","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":29346316,"name":"btrfs-balancer","full_name":"sailfishos/btrfs-balancer","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/btrfs-balancer","description":"Systemd service and related tools to run btrfs balance on a filesystem periodically.","fork":false,"url":"https://api.github.com/repos/sailfishos/btrfs-balancer","forks_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/forks","keys_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/teams","hooks_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/hooks","issue_events_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues/events{/number}","events_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/events","assignees_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/assignees{/user}","branches_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/branches{/branch}","tags_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/tags","blobs_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/git/refs{/sha}","trees_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/statuses/{sha}","languages_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/languages","stargazers_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/stargazers","contributors_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/contributors","subscribers_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/subscribers","subscription_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/subscription","commits_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/commits{/sha}","git_commits_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/git/commits{/sha}","comments_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/comments{/number}","issue_comment_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues/comments{/number}","contents_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/contents/{+path}","compare_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/merges","archive_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/downloads","issues_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues{/number}","pulls_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls{/number}","milestones_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/milestones{/number}","notifications_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/labels{/name}","releases_url":"https://api.github.com/repos/sailfishos/btrfs-balancer/releases{/id}","created_at":"2015-01-16T11:46:53Z","updated_at":"2015-01-27T14:49:55Z","pushed_at":"2015-01-27T14:51:07Z","git_url":"git://github.com/sailfishos/btrfs-balancer.git","ssh_url":"git@github.com:sailfishos/btrfs-balancer.git","clone_url":"https://github.com/sailfishos/btrfs-balancer.git","svn_url":"https://github.com/sailfishos/btrfs-balancer","homepage":null,"size":203,"stargazers_count":0,"watchers_count":0,"language":"Shell","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":3,"mirror_url":null,"open_issues_count":1,"forks":3,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6"},"html":{"href":"https://github.com/sailfishos/btrfs-balancer/pull/6"},"issue":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues/6"},"comments":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/issues/6/comments"},"review_comments":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6/comments"},"review_comment":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/pulls/6/commits"},"statuses":{"href":"https://api.github.com/repos/sailfishos/btrfs-balancer/statuses/7dc0a1cb20453902c605e5a1fc1a7d500b98610f"}}}}