{"action":"created","comment":{"url":"https://api.github.com/repos/opengisch/QField/pulls/comments/211672158","pull_request_review_id":148143838,"id":211672158,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIxMTY3MjE1OA==","diff_hunk":"@@ -0,0 +1,75 @@\n+/***************************************************************************\n+  printlayoutlistmodel.cpp\n+ ---------------------\n+ begin                : 20.8.2018\n+ copyright            : (C) 2018 by david\n+ email                : david at opengisch dot ch\n+ ***************************************************************************\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+ ***************************************************************************/\n+#include \"printlayoutlistmodel.h\"\n+#include <qgsproject.h>\n+\n+PrintLayoutListModel::PrintLayoutListModel(QObject* parent)\n+  : QAbstractListModel( parent )\n+{\n+}\n+\n+QHash<int, QByteArray> PrintLayoutListModel::roleNames() const\n+{\n+  QHash<int, QByteArray> roles = QAbstractListModel::roleNames();\n+  roles[TitleRow]  = \"Title\";\n+  roles[IndexRow] = \"Index\";\n+\n+  return roles;\n+}\n+\n+QgsProject* PrintLayoutListModel::project() const\n+{\n+  return mProject;\n+}\n+\n+void PrintLayoutListModel::setProject( QgsProject* project )\n+{\n+  mProject = project;\n+\n+  reloadModel();\n+}\n+\n+void PrintLayoutListModel::reloadModel()\n+{\n+  beginResetModel();\n+  mPrintLayouts.clear();\n+\n+  for ( const auto &layout : mProject->layoutManager()->printLayouts() )\n+  {\n+    mPrintLayouts.append( PrintLayout( layout->name() ) );\n+  }\n+  endResetModel();\n+\n+}\n+\n+int PrintLayoutListModel::rowCount( const QModelIndex& parent ) const\n+{\n+  Q_UNUSED( parent )\n+  int test = mPrintLayouts.size();\n+  return test;","path":"src/printlayoutlistmodel.cpp","position":61,"original_position":61,"commit_id":"1fa00fd87a5f2755231a97ab260f86341de0ea96","original_commit_id":"1fa00fd87a5f2755231a97ab260f86341de0ea96","user":{"login":"m-kuhn","id":588407,"node_id":"MDQ6VXNlcjU4ODQwNw==","avatar_url":"https://avatars1.githubusercontent.com/u/588407?v=4","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":"Why the test? :)","created_at":"2018-08-21T16:27:09Z","updated_at":"2018-08-21T16:27:09Z","html_url":"https://github.com/opengisch/QField/pull/324#discussion_r211672158","pull_request_url":"https://api.github.com/repos/opengisch/QField/pulls/324","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/opengisch/QField/pulls/comments/211672158"},"html":{"href":"https://github.com/opengisch/QField/pull/324#discussion_r211672158"},"pull_request":{"href":"https://api.github.com/repos/opengisch/QField/pulls/324"}}},"pull_request":{"url":"https://api.github.com/repos/opengisch/QField/pulls/324","id":209880674,"node_id":"MDExOlB1bGxSZXF1ZXN0MjA5ODgwNjc0","html_url":"https://github.com/opengisch/QField/pull/324","diff_url":"https://github.com/opengisch/QField/pull/324.diff","patch_url":"https://github.com/opengisch/QField/pull/324.patch","issue_url":"https://api.github.com/repos/opengisch/QField/issues/324","number":324,"state":"open","locked":false,"title":"Print to PDF","user":{"login":"signedav","id":28384354,"node_id":"MDQ6VXNlcjI4Mzg0MzU0","avatar_url":"https://avatars1.githubusercontent.com/u/28384354?v=4","gravatar_id":"","url":"https://api.github.com/users/signedav","html_url":"https://github.com/signedav","followers_url":"https://api.github.com/users/signedav/followers","following_url":"https://api.github.com/users/signedav/following{/other_user}","gists_url":"https://api.github.com/users/signedav/gists{/gist_id}","starred_url":"https://api.github.com/users/signedav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/signedav/subscriptions","organizations_url":"https://api.github.com/users/signedav/orgs","repos_url":"https://api.github.com/users/signedav/repos","events_url":"https://api.github.com/users/signedav/events{/privacy}","received_events_url":"https://api.github.com/users/signedav/received_events","type":"User","site_admin":false},"body":"When a project has print layouts, they are available on QField as well.\r\n\r\nIt's tested on a mobile phone, that's why the small screen:\r\n![print2](https://user-images.githubusercontent.com/28384354/44413941-ddbcf780-a56c-11e8-8d70-5c424cbdf6a5.gif)\r\n\r\nOn a large amount of layouts, it would be still comfortable to handle.\r\n\r\n![printing](https://user-images.githubusercontent.com/28384354/44414181-70f62d00-a56d-11e8-91c9-9c64af07a8ef.gif)\r\n\r\nSo the basic works. If the print layouts looks the same on device than on the computer needs to be validated still.\r\n\r\nNice things would be: \r\n- Busy indicator (because old devices are slow) - the implementation in this PR is not yet working.\r\n- Temporary file handling (that files are deleted afterwards)\r\n\r\n","created_at":"2018-08-21T16:12:40Z","updated_at":"2018-08-21T16:27:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"cafedc20caac2274ac7d7fad07818d10f31a9249","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/opengisch/QField/pulls/324/commits","review_comments_url":"https://api.github.com/repos/opengisch/QField/pulls/324/comments","review_comment_url":"https://api.github.com/repos/opengisch/QField/pulls/comments{/number}","comments_url":"https://api.github.com/repos/opengisch/QField/issues/324/comments","statuses_url":"https://api.github.com/repos/opengisch/QField/statuses/1fa00fd87a5f2755231a97ab260f86341de0ea96","head":{"label":"opengisch:printtest","ref":"printtest","sha":"1fa00fd87a5f2755231a97ab260f86341de0ea96","user":{"login":"opengisch","id":8892251,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4OTIyNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8892251?v=4","gravatar_id":"","url":"https://api.github.com/users/opengisch","html_url":"https://github.com/opengisch","followers_url":"https://api.github.com/users/opengisch/followers","following_url":"https://api.github.com/users/opengisch/following{/other_user}","gists_url":"https://api.github.com/users/opengisch/gists{/gist_id}","starred_url":"https://api.github.com/users/opengisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengisch/subscriptions","organizations_url":"https://api.github.com/users/opengisch/orgs","repos_url":"https://api.github.com/users/opengisch/repos","events_url":"https://api.github.com/users/opengisch/events{/privacy}","received_events_url":"https://api.github.com/users/opengisch/received_events","type":"Organization","site_admin":false},"repo":{"id":27185284,"node_id":"MDEwOlJlcG9zaXRvcnkyNzE4NTI4NA==","name":"QField","full_name":"opengisch/QField","owner":{"login":"opengisch","id":8892251,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4OTIyNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8892251?v=4","gravatar_id":"","url":"https://api.github.com/users/opengisch","html_url":"https://github.com/opengisch","followers_url":"https://api.github.com/users/opengisch/followers","following_url":"https://api.github.com/users/opengisch/following{/other_user}","gists_url":"https://api.github.com/users/opengisch/gists{/gist_id}","starred_url":"https://api.github.com/users/opengisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengisch/subscriptions","organizations_url":"https://api.github.com/users/opengisch/orgs","repos_url":"https://api.github.com/users/opengisch/repos","events_url":"https://api.github.com/users/opengisch/events{/privacy}","received_events_url":"https://api.github.com/users/opengisch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opengisch/QField","description":"A simplified touch optimized interface for QGIS","fork":false,"url":"https://api.github.com/repos/opengisch/QField","forks_url":"https://api.github.com/repos/opengisch/QField/forks","keys_url":"https://api.github.com/repos/opengisch/QField/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opengisch/QField/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opengisch/QField/teams","hooks_url":"https://api.github.com/repos/opengisch/QField/hooks","issue_events_url":"https://api.github.com/repos/opengisch/QField/issues/events{/number}","events_url":"https://api.github.com/repos/opengisch/QField/events","assignees_url":"https://api.github.com/repos/opengisch/QField/assignees{/user}","branches_url":"https://api.github.com/repos/opengisch/QField/branches{/branch}","tags_url":"https://api.github.com/repos/opengisch/QField/tags","blobs_url":"https://api.github.com/repos/opengisch/QField/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opengisch/QField/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opengisch/QField/git/refs{/sha}","trees_url":"https://api.github.com/repos/opengisch/QField/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opengisch/QField/statuses/{sha}","languages_url":"https://api.github.com/repos/opengisch/QField/languages","stargazers_url":"https://api.github.com/repos/opengisch/QField/stargazers","contributors_url":"https://api.github.com/repos/opengisch/QField/contributors","subscribers_url":"https://api.github.com/repos/opengisch/QField/subscribers","subscription_url":"https://api.github.com/repos/opengisch/QField/subscription","commits_url":"https://api.github.com/repos/opengisch/QField/commits{/sha}","git_commits_url":"https://api.github.com/repos/opengisch/QField/git/commits{/sha}","comments_url":"https://api.github.com/repos/opengisch/QField/comments{/number}","issue_comment_url":"https://api.github.com/repos/opengisch/QField/issues/comments{/number}","contents_url":"https://api.github.com/repos/opengisch/QField/contents/{+path}","compare_url":"https://api.github.com/repos/opengisch/QField/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opengisch/QField/merges","archive_url":"https://api.github.com/repos/opengisch/QField/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opengisch/QField/downloads","issues_url":"https://api.github.com/repos/opengisch/QField/issues{/number}","pulls_url":"https://api.github.com/repos/opengisch/QField/pulls{/number}","milestones_url":"https://api.github.com/repos/opengisch/QField/milestones{/number}","notifications_url":"https://api.github.com/repos/opengisch/QField/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opengisch/QField/labels{/name}","releases_url":"https://api.github.com/repos/opengisch/QField/releases{/id}","deployments_url":"https://api.github.com/repos/opengisch/QField/deployments","created_at":"2014-11-26T16:20:45Z","updated_at":"2018-08-20T14:54:51Z","pushed_at":"2018-08-21T16:12:40Z","git_url":"git://github.com/opengisch/QField.git","ssh_url":"git@github.com:opengisch/QField.git","clone_url":"https://github.com/opengisch/QField.git","svn_url":"https://github.com/opengisch/QField","homepage":"http://www.qfield.org","size":49422,"stargazers_count":96,"watchers_count":96,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":116,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":46,"open_issues":116,"watchers":96,"default_branch":"master"}},"base":{"label":"opengisch:master","ref":"master","sha":"e63d2cb02a47263fad5454e77f6b423a665bdbbb","user":{"login":"opengisch","id":8892251,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4OTIyNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8892251?v=4","gravatar_id":"","url":"https://api.github.com/users/opengisch","html_url":"https://github.com/opengisch","followers_url":"https://api.github.com/users/opengisch/followers","following_url":"https://api.github.com/users/opengisch/following{/other_user}","gists_url":"https://api.github.com/users/opengisch/gists{/gist_id}","starred_url":"https://api.github.com/users/opengisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengisch/subscriptions","organizations_url":"https://api.github.com/users/opengisch/orgs","repos_url":"https://api.github.com/users/opengisch/repos","events_url":"https://api.github.com/users/opengisch/events{/privacy}","received_events_url":"https://api.github.com/users/opengisch/received_events","type":"Organization","site_admin":false},"repo":{"id":27185284,"node_id":"MDEwOlJlcG9zaXRvcnkyNzE4NTI4NA==","name":"QField","full_name":"opengisch/QField","owner":{"login":"opengisch","id":8892251,"node_id":"MDEyOk9yZ2FuaXphdGlvbjg4OTIyNTE=","avatar_url":"https://avatars2.githubusercontent.com/u/8892251?v=4","gravatar_id":"","url":"https://api.github.com/users/opengisch","html_url":"https://github.com/opengisch","followers_url":"https://api.github.com/users/opengisch/followers","following_url":"https://api.github.com/users/opengisch/following{/other_user}","gists_url":"https://api.github.com/users/opengisch/gists{/gist_id}","starred_url":"https://api.github.com/users/opengisch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opengisch/subscriptions","organizations_url":"https://api.github.com/users/opengisch/orgs","repos_url":"https://api.github.com/users/opengisch/repos","events_url":"https://api.github.com/users/opengisch/events{/privacy}","received_events_url":"https://api.github.com/users/opengisch/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/opengisch/QField","description":"A simplified touch optimized interface for QGIS","fork":false,"url":"https://api.github.com/repos/opengisch/QField","forks_url":"https://api.github.com/repos/opengisch/QField/forks","keys_url":"https://api.github.com/repos/opengisch/QField/keys{/key_id}","collaborators_url":"https://api.github.com/repos/opengisch/QField/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/opengisch/QField/teams","hooks_url":"https://api.github.com/repos/opengisch/QField/hooks","issue_events_url":"https://api.github.com/repos/opengisch/QField/issues/events{/number}","events_url":"https://api.github.com/repos/opengisch/QField/events","assignees_url":"https://api.github.com/repos/opengisch/QField/assignees{/user}","branches_url":"https://api.github.com/repos/opengisch/QField/branches{/branch}","tags_url":"https://api.github.com/repos/opengisch/QField/tags","blobs_url":"https://api.github.com/repos/opengisch/QField/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/opengisch/QField/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/opengisch/QField/git/refs{/sha}","trees_url":"https://api.github.com/repos/opengisch/QField/git/trees{/sha}","statuses_url":"https://api.github.com/repos/opengisch/QField/statuses/{sha}","languages_url":"https://api.github.com/repos/opengisch/QField/languages","stargazers_url":"https://api.github.com/repos/opengisch/QField/stargazers","contributors_url":"https://api.github.com/repos/opengisch/QField/contributors","subscribers_url":"https://api.github.com/repos/opengisch/QField/subscribers","subscription_url":"https://api.github.com/repos/opengisch/QField/subscription","commits_url":"https://api.github.com/repos/opengisch/QField/commits{/sha}","git_commits_url":"https://api.github.com/repos/opengisch/QField/git/commits{/sha}","comments_url":"https://api.github.com/repos/opengisch/QField/comments{/number}","issue_comment_url":"https://api.github.com/repos/opengisch/QField/issues/comments{/number}","contents_url":"https://api.github.com/repos/opengisch/QField/contents/{+path}","compare_url":"https://api.github.com/repos/opengisch/QField/compare/{base}...{head}","merges_url":"https://api.github.com/repos/opengisch/QField/merges","archive_url":"https://api.github.com/repos/opengisch/QField/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/opengisch/QField/downloads","issues_url":"https://api.github.com/repos/opengisch/QField/issues{/number}","pulls_url":"https://api.github.com/repos/opengisch/QField/pulls{/number}","milestones_url":"https://api.github.com/repos/opengisch/QField/milestones{/number}","notifications_url":"https://api.github.com/repos/opengisch/QField/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/opengisch/QField/labels{/name}","releases_url":"https://api.github.com/repos/opengisch/QField/releases{/id}","deployments_url":"https://api.github.com/repos/opengisch/QField/deployments","created_at":"2014-11-26T16:20:45Z","updated_at":"2018-08-20T14:54:51Z","pushed_at":"2018-08-21T16:12:40Z","git_url":"git://github.com/opengisch/QField.git","ssh_url":"git@github.com:opengisch/QField.git","clone_url":"https://github.com/opengisch/QField.git","svn_url":"https://github.com/opengisch/QField","homepage":"http://www.qfield.org","size":49422,"stargazers_count":96,"watchers_count":96,"language":"C++","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":46,"mirror_url":null,"archived":false,"open_issues_count":116,"license":{"key":"gpl-2.0","name":"GNU General Public License v2.0","spdx_id":"GPL-2.0","url":"https://api.github.com/licenses/gpl-2.0","node_id":"MDc6TGljZW5zZTg="},"forks":46,"open_issues":116,"watchers":96,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/opengisch/QField/pulls/324"},"html":{"href":"https://github.com/opengisch/QField/pull/324"},"issue":{"href":"https://api.github.com/repos/opengisch/QField/issues/324"},"comments":{"href":"https://api.github.com/repos/opengisch/QField/issues/324/comments"},"review_comments":{"href":"https://api.github.com/repos/opengisch/QField/pulls/324/comments"},"review_comment":{"href":"https://api.github.com/repos/opengisch/QField/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/opengisch/QField/pulls/324/commits"},"statuses":{"href":"https://api.github.com/repos/opengisch/QField/statuses/1fa00fd87a5f2755231a97ab260f86341de0ea96"}},"author_association":"CONTRIBUTOR"}}
{"actor":{"display_login":"m-kuhn"}}