forked from qt-creator/qt-creator
Utils: Move process arguments class out of QtcProcess
The main QtcProcess interface is nowadays a CommandLine, with no explicit references left to QtcProcess::Arguments and related static helper functions, so it only clutters the QtcProcess class interface So move these items out of QtcProcess, later potentially to a separate file pair. Change-Id: I45c300b656f5b30e2e2717232c855fdd97c2d1d7 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -102,7 +102,7 @@ struct SftpSession::SftpSessionPrivate
|
||||
|
||||
// The second newline forces the prompt to appear after the command has finished.
|
||||
sftpProc.write(commandString(activeCommand.type) + ' '
|
||||
+ QtcProcess::Arguments::createUnixArgs(activeCommand.paths)
|
||||
+ ProcessArgs::createUnixArgs(activeCommand.paths)
|
||||
.toString().toLocal8Bit() + "\n\n");
|
||||
}
|
||||
};
|
||||
|
||||
@@ -151,7 +151,7 @@ void SftpTransfer::doStart()
|
||||
for (const QString &dir : d->dirsToCreate()) {
|
||||
switch (d->transferType) {
|
||||
case Internal::FileTransferType::Upload:
|
||||
batchFile.write("-mkdir " + QtcProcess::quoteArgUnix(dir).toLocal8Bit() + '\n');
|
||||
batchFile.write("-mkdir " + ProcessArgs::quoteArgUnix(dir).toLocal8Bit() + '\n');
|
||||
break;
|
||||
case Internal::FileTransferType::Download:
|
||||
if (!QDir::root().mkpath(dir)) {
|
||||
@@ -169,14 +169,14 @@ void SftpTransfer::doStart()
|
||||
QFileInfo fi(f.sourceFile);
|
||||
if (fi.isSymLink()) {
|
||||
link = true;
|
||||
batchFile.write("-rm " + QtcProcess::quoteArgUnix(f.targetFile).toLocal8Bit()
|
||||
batchFile.write("-rm " + ProcessArgs::quoteArgUnix(f.targetFile).toLocal8Bit()
|
||||
+ '\n');
|
||||
sourceFileOrLinkTarget = fi.dir().relativeFilePath(fi.symLinkTarget()); // see QTBUG-5817.
|
||||
}
|
||||
}
|
||||
batchFile.write(d->transferCommand(link) + ' '
|
||||
+ QtcProcess::quoteArgUnix(sourceFileOrLinkTarget).toLocal8Bit() + ' '
|
||||
+ QtcProcess::quoteArgUnix(f.targetFile).toLocal8Bit() + '\n');
|
||||
+ ProcessArgs::quoteArgUnix(sourceFileOrLinkTarget).toLocal8Bit() + ' '
|
||||
+ ProcessArgs::quoteArgUnix(f.targetFile).toLocal8Bit() + '\n');
|
||||
}
|
||||
d->sftpProc.setStandardInputFile(batchFile.fileName());
|
||||
d->sftpProc.start(sftpBinary.toString(), d->connectionArgs);
|
||||
|
||||
Reference in New Issue
Block a user