{"action":"created","comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/47441817","id":47441817,"diff_hunk":"@@ -37,37 +37,23 @@\n #include \"utils/misc.h\"\n #include \"utils/fs.h\"\n #include \"preferences.h\"\n+#include \"logger.h\"\n #include \"filesystemwatcher.h\"\n #include \"bittorrent/session.h\"\n #include \"scanfoldersmodel.h\"\n \n-namespace\n+struct ScanFoldersModel::PathData\n {\n-    const int PathColumn = 0;\n-    const int DownloadAtTorrentColumn = 1;\n-    const int DownloadPath = 2;\n-}\n-\n-class ScanFoldersModel::PathData\n-{\n-public:\n-    PathData(const QString &path)\n-        : path(path)\n-        , downloadAtPath(false)\n-        , downloadPath(path)\n+    PathData(const QString &watchPath, const PathType &type, const QString &downloadPath)\n+        : m_watchPath(watchPath)","path":"src/base/scanfoldersmodel.cpp","position":25,"original_position":25,"commit_id":"e34f2334bee6e9e66104c2b1196a7c5f4059502a","original_commit_id":"e34f2334bee6e9e66104c2b1196a7c5f4059502a","user":{"login":"glassez","id":5063477,"avatar_url":"https://avatars.githubusercontent.com/u/5063477?v=3","gravatar_id":"","url":"https://api.github.com/users/glassez","html_url":"https://github.com/glassez","followers_url":"https://api.github.com/users/glassez/followers","following_url":"https://api.github.com/users/glassez/following{/other_user}","gists_url":"https://api.github.com/users/glassez/gists{/gist_id}","starred_url":"https://api.github.com/users/glassez/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/glassez/subscriptions","organizations_url":"https://api.github.com/users/glassez/orgs","repos_url":"https://api.github.com/users/glassez/repos","events_url":"https://api.github.com/users/glassez/events{/privacy}","received_events_url":"https://api.github.com/users/glassez/received_events","type":"User","site_admin":false},"body":"Shouldn't we use m_ prefix for private member variables only?","created_at":"2015-12-13T08:31:57Z","updated_at":"2015-12-13T08:31:57Z","html_url":"https://github.com/qbittorrent/qBittorrent/pull/4349#discussion_r47441817","pull_request_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349","_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/47441817"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/4349#discussion_r47441817"},"pull_request":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349"}}},"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349","id":53486679,"html_url":"https://github.com/qbittorrent/qBittorrent/pull/4349","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/4349.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/4349.patch","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4349","number":4349,"state":"open","locked":false,"title":"Improve the \"Watch folders\" UI. Closes #4300.","user":{"login":"sledgehammer999","id":273315,"avatar_url":"https://avatars.githubusercontent.com/u/273315?v=3","gravatar_id":"","url":"https://api.github.com/users/sledgehammer999","html_url":"https://github.com/sledgehammer999","followers_url":"https://api.github.com/users/sledgehammer999/followers","following_url":"https://api.github.com/users/sledgehammer999/following{/other_user}","gists_url":"https://api.github.com/users/sledgehammer999/gists{/gist_id}","starred_url":"https://api.github.com/users/sledgehammer999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledgehammer999/subscriptions","organizations_url":"https://api.github.com/users/sledgehammer999/orgs","repos_url":"https://api.github.com/users/sledgehammer999/repos","events_url":"https://api.github.com/users/sledgehammer999/events{/privacy}","received_events_url":"https://api.github.com/users/sledgehammer999/received_events","type":"User","site_admin":false},"body":"The old behavior for watch folders was to download to \"default path\" if the \"Download Here\" wasn't checked. It never asked the user for a path.\r\n\r\nI have disabled the WebUI code. I can't code it. Help is very welcome.\r\n\r\nThis works fine with Qt4. For some reason Qt5 crashes when the \"Choose a directory\" dialog is closed. I cannot understand why. I hope someone can find the reason.\r\n\r\nThe preferences are saved in a \"weird\" way now. It saves the watch folders as stringlist.\r\nThen it saves the download preferences as stringlist too. However, the first 2 options are of type int and the 3rd is a string(ie the download path). When saving the integers (enum values) are converted to string and when restoring they are read as strings but converted back to enum values.\r\nIf you can propose a better way, I'm all ears.\r\n\r\nPlan for future: Now any path added via the options window is being watched by the fs_watcher even if the options window isn't accepted by the user yet. I plan to change this after this commit is finalized.\r\n\r\nAnd finally here is a screenshot:\r\n![untitled](https://cloud.githubusercontent.com/assets/273315/11764106/f398a876-a12b-11e5-8d55-9fb34ad9c4f7.jpg)\r\n","created_at":"2015-12-12T21:59:20Z","updated_at":"2015-12-13T08:31:57Z","closed_at":null,"merged_at":null,"merge_commit_sha":"603d413490b5f69c53c3f1b0a1260c7246f98732","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349/commits","review_comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349/comments","review_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4349/comments","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/e34f2334bee6e9e66104c2b1196a7c5f4059502a","head":{"label":"sledgehammer999:watch_folders","ref":"watch_folders","sha":"e34f2334bee6e9e66104c2b1196a7c5f4059502a","user":{"login":"sledgehammer999","id":273315,"avatar_url":"https://avatars.githubusercontent.com/u/273315?v=3","gravatar_id":"","url":"https://api.github.com/users/sledgehammer999","html_url":"https://github.com/sledgehammer999","followers_url":"https://api.github.com/users/sledgehammer999/followers","following_url":"https://api.github.com/users/sledgehammer999/following{/other_user}","gists_url":"https://api.github.com/users/sledgehammer999/gists{/gist_id}","starred_url":"https://api.github.com/users/sledgehammer999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledgehammer999/subscriptions","organizations_url":"https://api.github.com/users/sledgehammer999/orgs","repos_url":"https://api.github.com/users/sledgehammer999/repos","events_url":"https://api.github.com/users/sledgehammer999/events{/privacy}","received_events_url":"https://api.github.com/users/sledgehammer999/received_events","type":"User","site_admin":false},"repo":{"id":5818634,"name":"qBittorrent","full_name":"sledgehammer999/qBittorrent","owner":{"login":"sledgehammer999","id":273315,"avatar_url":"https://avatars.githubusercontent.com/u/273315?v=3","gravatar_id":"","url":"https://api.github.com/users/sledgehammer999","html_url":"https://github.com/sledgehammer999","followers_url":"https://api.github.com/users/sledgehammer999/followers","following_url":"https://api.github.com/users/sledgehammer999/following{/other_user}","gists_url":"https://api.github.com/users/sledgehammer999/gists{/gist_id}","starred_url":"https://api.github.com/users/sledgehammer999/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sledgehammer999/subscriptions","organizations_url":"https://api.github.com/users/sledgehammer999/orgs","repos_url":"https://api.github.com/users/sledgehammer999/repos","events_url":"https://api.github.com/users/sledgehammer999/events{/privacy}","received_events_url":"https://api.github.com/users/sledgehammer999/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/sledgehammer999/qBittorrent","description":"qBittorrent BitTorrent client","fork":true,"url":"https://api.github.com/repos/sledgehammer999/qBittorrent","forks_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/forks","keys_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/teams","hooks_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/events","assignees_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/tags","blobs_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/subscription","commits_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/merges","archive_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/downloads","issues_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/sledgehammer999/qBittorrent/releases{/id}","created_at":"2012-09-15T08:20:30Z","updated_at":"2015-05-02T22:37:33Z","pushed_at":"2015-12-12T21:40:06Z","git_url":"git://github.com/sledgehammer999/qBittorrent.git","ssh_url":"git@github.com:sledgehammer999/qBittorrent.git","clone_url":"https://github.com/sledgehammer999/qBittorrent.git","svn_url":"https://github.com/sledgehammer999/qBittorrent","homepage":"http://www.qbittorrent.org","size":117516,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":2,"mirror_url":null,"open_issues_count":0,"forks":2,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"qbittorrent:master","ref":"master","sha":"ebe6d1b603cc4db6b315a7f7fa2e82dc5c3579f8","user":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars.githubusercontent.com/u/2131270?v=3","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"repo":{"id":3351871,"name":"qBittorrent","full_name":"qbittorrent/qBittorrent","owner":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars.githubusercontent.com/u/2131270?v=3","gravatar_id":"","url":"https://api.github.com/users/qbittorrent","html_url":"https://github.com/qbittorrent","followers_url":"https://api.github.com/users/qbittorrent/followers","following_url":"https://api.github.com/users/qbittorrent/following{/other_user}","gists_url":"https://api.github.com/users/qbittorrent/gists{/gist_id}","starred_url":"https://api.github.com/users/qbittorrent/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/qbittorrent/subscriptions","organizations_url":"https://api.github.com/users/qbittorrent/orgs","repos_url":"https://api.github.com/users/qbittorrent/repos","events_url":"https://api.github.com/users/qbittorrent/events{/privacy}","received_events_url":"https://api.github.com/users/qbittorrent/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/qbittorrent/qBittorrent","description":"qBittorrent BitTorrent client","fork":false,"url":"https://api.github.com/repos/qbittorrent/qBittorrent","forks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/forks","keys_url":"https://api.github.com/repos/qbittorrent/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/qbittorrent/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/qbittorrent/qBittorrent/teams","hooks_url":"https://api.github.com/repos/qbittorrent/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/events","assignees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/qbittorrent/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/tags","blobs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/qbittorrent/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/qbittorrent/qBittorrent/subscription","commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/qbittorrent/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/qbittorrent/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/qbittorrent/qBittorrent/merges","archive_url":"https://api.github.com/repos/qbittorrent/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/qbittorrent/qBittorrent/downloads","issues_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/qbittorrent/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/qbittorrent/qBittorrent/releases{/id}","created_at":"2012-02-04T09:37:46Z","updated_at":"2015-12-12T06:42:05Z","pushed_at":"2015-12-12T21:59:20Z","git_url":"git://github.com/qbittorrent/qBittorrent.git","ssh_url":"git@github.com:qbittorrent/qBittorrent.git","clone_url":"https://github.com/qbittorrent/qBittorrent.git","svn_url":"https://github.com/qbittorrent/qBittorrent","homepage":"http://www.qbittorrent.org","size":120929,"stargazers_count":1379,"watchers_count":1379,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":388,"mirror_url":null,"open_issues_count":1217,"forks":388,"open_issues":1217,"watchers":1379,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/4349"},"issue":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4349"},"comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4349/comments"},"review_comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349/comments"},"review_comment":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4349/commits"},"statuses":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/e34f2334bee6e9e66104c2b1196a7c5f4059502a"}}}}