From 4230f00cb0657415dcc99f801db69142dba584e7 Mon Sep 17 00:00:00 2001 From: kapitainsky Date: Sun, 23 Feb 2020 07:15:48 +0000 Subject: [PATCH] further improved rclone options parsing - #79 thank you @myelsukov for your contribution --- src/job_options.cpp | 2 +- src/main_window.cpp | 2 +- src/utils.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/job_options.cpp b/src/job_options.cpp index 45b3ee91..47e2ea76 100644 --- a/src/job_options.cpp +++ b/src/job_options.cpp @@ -138,7 +138,7 @@ QStringList JobOptions::getOptions() const { // should generate "--option-1" "--option-2=\"arg1 arg2\"" "--option-3" "arg3" for (QString arg : extra.split(QRegExp(" (?=[^\"]*(\"[^\"]*\"[^\"]*)*$)"))) { if (!arg.isEmpty()) { - list << arg; + list << arg.replace("\"", ""); } } } diff --git a/src/main_window.cpp b/src/main_window.cpp index 6ed82e4d..ba7891ad 100644 --- a/src/main_window.cpp +++ b/src/main_window.cpp @@ -1202,7 +1202,7 @@ void MainWindow::addMount(const QString &remote, const QString &folder) { // should generate "--option-1" "--option-2=\"arg1 arg2\"" "--option-3" "arg3" for (QString arg : opt.split(QRegExp(" (?=[^\"]*(\"[^\"]*\"[^\"]*)*$)"))) { if (!arg.isEmpty()) { - args << arg; + args << arg.replace("\"", ""); } } } diff --git a/src/utils.cpp b/src/utils.cpp index 412cac81..92a746c9 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -279,7 +279,7 @@ QStringList GetDefaultRcloneOptionsList() { // should generate "--option-1" "--option-2=\"arg1 arg2\"" "--option-3" "arg3" for (QString arg : defaultRcloneOptions.split(QRegExp(" (?=[^\"]*(\"[^\"]*\"[^\"]*)*$)"))) { if (!arg.isEmpty()) { - defaultRcloneOptionsList << arg; + defaultRcloneOptionsList << arg.replace("\"", ""); } } }