{"action":"created","comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/152785701","pull_request_review_id":78699762,"id":152785701,"diff_hunk":"@@ -384,31 +389,73 @@ void AutomatedRssDownloader::on_browseSP_clicked()\n \n void AutomatedRssDownloader::on_exportBtn_clicked()\n {\n-//    if (m_editableRuleList->isEmpty()) {\n-//        QMessageBox::warning(this, tr(\"Invalid action\"), tr(\"The list is empty, there is nothing to export.\"));\n-//        return;\n-//    }\n-//    // Ask for a save path\n-//    QString save_path = QFileDialog::getSaveFileName(this, tr(\"Where would you like to save the list?\"), QDir::homePath(), tr(\"Rules list (*.rssrules)\"));\n-//    if (save_path.isEmpty()) return;\n-//    if (!save_path.endsWith(\".rssrules\", Qt::CaseInsensitive))\n-//        save_path += \".rssrules\";\n-//    if (!m_editableRuleList->serialize(save_path)) {\n-//        QMessageBox::warning(this, tr(\"I/O Error\"), tr(\"Failed to create the destination file\"));\n-//        return;\n-//    }\n+    if (RSS::AutoDownloader::instance()->rules().isEmpty()) {\n+        QMessageBox::warning(this, tr(\"Invalid action\")\n+                             , tr(\"The list is empty, there is nothing to export.\"));\n+        return;\n+    }\n+\n+    QString selectedFilter {m_formatFilterJSON};\n+    QString path = QFileDialog::getSaveFileName(\n+                this, tr(\"Where would you like to save the list?\"), QDir::homePath()\n+                , QString(\"%1;;%2\").arg(m_formatFilterJSON).arg(m_formatFilterLegacy), &selectedFilter);\n+    if (path.isEmpty()) return;\n+\n+    const RSS::AutoDownloader::RulesFileFormat format {\n+        (selectedFilter == m_formatFilterJSON)\n+                ? RSS::AutoDownloader::RulesFileFormat::JSON\n+                : RSS::AutoDownloader::RulesFileFormat::Legacy\n+    };\n+\n+    if (format == RSS::AutoDownloader::RulesFileFormat::JSON) {\n+        if (!path.endsWith(EXT_JSON, Qt::CaseInsensitive))\n+            path += EXT_JSON;\n+    }\n+    else {\n+        if (!path.endsWith(EXT_LEGACY, Qt::CaseInsensitive))\n+            path += EXT_LEGACY;\n+    }\n+\n+    QFile file(path);\n+    if (!file.open(QFile::WriteOnly)\n+            || (file.write(RSS::AutoDownloader::instance()->exportRules(format)) == -1)) {\n+        QMessageBox::critical(\n+                    this, tr(\"I/O Error\")\n+                    , tr(\"Failed to create the destination file. Reason: %1\").arg(file.errorString()));\n+    }\n }\n \n void AutomatedRssDownloader::on_importBtn_clicked()\n {\n-//    // Ask for filter path\n-//    QString load_path = QFileDialog::getOpenFileName(this, tr(\"Please point to the RSS download rules file\"), QDir::homePath(), tr(\"Rules list\") + QString(\" (*.rssrules *.filters)\"));\n-//    if (load_path.isEmpty() || !QFile::exists(load_path)) return;\n-//    // Load it\n-//    if (!m_editableRuleList->unserialize(load_path)) {\n-//        QMessageBox::warning(this, tr(\"Import Error\"), tr(\"Failed to import the selected rules file\"));\n-//        return;\n-//    }\n+    QString selectedFilter {m_formatFilterJSON};\n+    QString path = QFileDialog::getOpenFileName(\n+                this, tr(\"Please point to the RSS download rules file\"), QDir::homePath()","path":"src/gui/rss/automatedrssdownloader.cpp","position":79,"original_position":79,"commit_id":"041a86ef7b04e184ebc83519c799726cfa45e3f8","original_commit_id":"041a86ef7b04e184ebc83519c799726cfa45e3f8","user":{"login":"Chocobo1","id":9395168,"avatar_url":"https://avatars2.githubusercontent.com/u/9395168?v=4","gravatar_id":"","url":"https://api.github.com/users/Chocobo1","html_url":"https://github.com/Chocobo1","followers_url":"https://api.github.com/users/Chocobo1/followers","following_url":"https://api.github.com/users/Chocobo1/following{/other_user}","gists_url":"https://api.github.com/users/Chocobo1/gists{/gist_id}","starred_url":"https://api.github.com/users/Chocobo1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Chocobo1/subscriptions","organizations_url":"https://api.github.com/users/Chocobo1/orgs","repos_url":"https://api.github.com/users/Chocobo1/repos","events_url":"https://api.github.com/users/Chocobo1/events{/privacy}","received_events_url":"https://api.github.com/users/Chocobo1/received_events","type":"User","site_admin":false},"body":"\"Import RSS rules\"?","created_at":"2017-11-23T12:13:28Z","updated_at":"2017-11-23T12:13:28Z","html_url":"https://github.com/qbittorrent/qBittorrent/pull/7832#discussion_r152785701","pull_request_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832","author_association":"MEMBER","_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments/152785701"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/7832#discussion_r152785701"},"pull_request":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832"}}},"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832","id":154230089,"html_url":"https://github.com/qbittorrent/qBittorrent/pull/7832","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/7832.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/7832.patch","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7832","number":7832,"state":"open","locked":false,"title":"Implement Import/Export RSS rules. Closes #7721","user":{"login":"glassez","id":5063477,"avatar_url":"https://avatars3.githubusercontent.com/u/5063477?v=4","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":"","created_at":"2017-11-22T18:45:09Z","updated_at":"2017-11-23T12:13:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ba6acdb7599c28cc9daac2289492450a369e4bdb","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones/41","html_url":"https://github.com/qbittorrent/qBittorrent/milestone/41","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/milestones/41/labels","id":2929946,"number":41,"title":"4.0.2","description":"","creator":{"login":"sledgehammer999","id":273315,"avatar_url":"https://avatars0.githubusercontent.com/u/273315?v=4","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},"open_issues":14,"closed_issues":3,"state":"open","created_at":"2017-11-22T01:53:17Z","updated_at":"2017-11-23T11:43:55Z","due_on":null,"closed_at":null},"commits_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832/commits","review_comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832/comments","review_comment_url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7832/comments","statuses_url":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/041a86ef7b04e184ebc83519c799726cfa45e3f8","head":{"label":"glassez:rss-import","ref":"rss-import","sha":"041a86ef7b04e184ebc83519c799726cfa45e3f8","user":{"login":"glassez","id":5063477,"avatar_url":"https://avatars3.githubusercontent.com/u/5063477?v=4","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},"repo":{"id":11788320,"name":"qBittorrent","full_name":"glassez/qBittorrent","owner":{"login":"glassez","id":5063477,"avatar_url":"https://avatars3.githubusercontent.com/u/5063477?v=4","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},"private":false,"html_url":"https://github.com/glassez/qBittorrent","description":"qBittorrent BitTorrent client","fork":true,"url":"https://api.github.com/repos/glassez/qBittorrent","forks_url":"https://api.github.com/repos/glassez/qBittorrent/forks","keys_url":"https://api.github.com/repos/glassez/qBittorrent/keys{/key_id}","collaborators_url":"https://api.github.com/repos/glassez/qBittorrent/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/glassez/qBittorrent/teams","hooks_url":"https://api.github.com/repos/glassez/qBittorrent/hooks","issue_events_url":"https://api.github.com/repos/glassez/qBittorrent/issues/events{/number}","events_url":"https://api.github.com/repos/glassez/qBittorrent/events","assignees_url":"https://api.github.com/repos/glassez/qBittorrent/assignees{/user}","branches_url":"https://api.github.com/repos/glassez/qBittorrent/branches{/branch}","tags_url":"https://api.github.com/repos/glassez/qBittorrent/tags","blobs_url":"https://api.github.com/repos/glassez/qBittorrent/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/glassez/qBittorrent/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/glassez/qBittorrent/git/refs{/sha}","trees_url":"https://api.github.com/repos/glassez/qBittorrent/git/trees{/sha}","statuses_url":"https://api.github.com/repos/glassez/qBittorrent/statuses/{sha}","languages_url":"https://api.github.com/repos/glassez/qBittorrent/languages","stargazers_url":"https://api.github.com/repos/glassez/qBittorrent/stargazers","contributors_url":"https://api.github.com/repos/glassez/qBittorrent/contributors","subscribers_url":"https://api.github.com/repos/glassez/qBittorrent/subscribers","subscription_url":"https://api.github.com/repos/glassez/qBittorrent/subscription","commits_url":"https://api.github.com/repos/glassez/qBittorrent/commits{/sha}","git_commits_url":"https://api.github.com/repos/glassez/qBittorrent/git/commits{/sha}","comments_url":"https://api.github.com/repos/glassez/qBittorrent/comments{/number}","issue_comment_url":"https://api.github.com/repos/glassez/qBittorrent/issues/comments{/number}","contents_url":"https://api.github.com/repos/glassez/qBittorrent/contents/{+path}","compare_url":"https://api.github.com/repos/glassez/qBittorrent/compare/{base}...{head}","merges_url":"https://api.github.com/repos/glassez/qBittorrent/merges","archive_url":"https://api.github.com/repos/glassez/qBittorrent/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/glassez/qBittorrent/downloads","issues_url":"https://api.github.com/repos/glassez/qBittorrent/issues{/number}","pulls_url":"https://api.github.com/repos/glassez/qBittorrent/pulls{/number}","milestones_url":"https://api.github.com/repos/glassez/qBittorrent/milestones{/number}","notifications_url":"https://api.github.com/repos/glassez/qBittorrent/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/glassez/qBittorrent/labels{/name}","releases_url":"https://api.github.com/repos/glassez/qBittorrent/releases{/id}","deployments_url":"https://api.github.com/repos/glassez/qBittorrent/deployments","created_at":"2013-07-31T10:19:53Z","updated_at":"2017-05-10T10:56:28Z","pushed_at":"2017-11-23T11:39:00Z","git_url":"git://github.com/glassez/qBittorrent.git","ssh_url":"git@github.com:glassez/qBittorrent.git","clone_url":"https://github.com/glassez/qBittorrent.git","svn_url":"https://github.com/glassez/qBittorrent","homepage":"http://www.qbittorrent.org","size":142333,"stargazers_count":2,"watchers_count":2,"language":"C++","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":2,"default_branch":"master"}},"base":{"label":"qbittorrent:master","ref":"master","sha":"342f5f1a09e4cd6c4f22c25ce2111a8fcb7ffa42","user":{"login":"qbittorrent","id":2131270,"avatar_url":"https://avatars2.githubusercontent.com/u/2131270?v=4","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://avatars2.githubusercontent.com/u/2131270?v=4","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}","deployments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/deployments","created_at":"2012-02-04T09:37:46Z","updated_at":"2017-11-23T11:27:06Z","pushed_at":"2017-11-23T11:38:00Z","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":157798,"stargazers_count":3376,"watchers_count":3376,"language":"C++","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":707,"mirror_url":null,"archived":false,"open_issues_count":2453,"forks":707,"open_issues":2453,"watchers":3376,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832"},"html":{"href":"https://github.com/qbittorrent/qBittorrent/pull/7832"},"issue":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7832"},"comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/7832/comments"},"review_comments":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832/comments"},"review_comment":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/7832/commits"},"statuses":{"href":"https://api.github.com/repos/qbittorrent/qBittorrent/statuses/041a86ef7b04e184ebc83519c799726cfa45e3f8"}},"author_association":"MEMBER"}}
{"actor":{"display_login":"Chocobo1"}}