diff --git a/job.cpp b/job.cpp --- a/job.cpp +++ b/job.cpp @@ -116,8 +116,19 @@ /* extra parameters */ QString cppcheckParameters(parameters.parameters); - if (!cppcheckParameters.isEmpty()) - args.append(cppcheckParameters); + if (!cppcheckParameters.isEmpty()) { + bool inside = (cppcheckParameters.at(0) == '"'); // true if the first character is " + QStringList tmplist = cppcheckParameters.split(QRegExp("\""), QString::SkipEmptyParts); // Split by " and skip empty strings + foreach (const QString& s, tmplist) { + if (inside) // If 's' is inside quotes ... + args.append(s); // ... get the whole string + else // If 's' is outside quotes ... + args.append(s.split(" ", QString::SkipEmptyParts)); // ... get the splitted string + + inside = !inside; + } + // args.append(QStringLiteral(" ") + cppcheckParameters); + } if (parameters.checkStyle) args.append("--enable=style");