forked from qt-creator/qt-creator
Merge "Merge remote-tracking branch 'origin/4.14'"
This commit is contained in:
Binary file not shown.
Before Width: | Height: | Size: 51 KiB After Width: | Height: | Size: 18 KiB |
BIN
doc/qtcreator/images/qtquick-rtf-editor.png
Normal file
BIN
doc/qtcreator/images/qtquick-rtf-editor.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.5 KiB |
BIN
doc/qtcreator/images/qtquick-text-rtf.gif
Normal file
BIN
doc/qtcreator/images/qtquick-text-rtf.gif
Normal file
Binary file not shown.
After Width: | Height: | Size: 299 KiB |
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2019 The Qt Company Ltd.
|
** Copyright (C) 2021 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -70,7 +70,7 @@
|
|||||||
|
|
||||||
By default, the project .pro file is passed to the tools as an argument. To
|
By default, the project .pro file is passed to the tools as an argument. To
|
||||||
specify other command line arguments for the tools, select \uicontrol Tools >
|
specify other command line arguments for the tools, select \uicontrol Tools >
|
||||||
\uicontrol External > \uicontrol Configure}.
|
\uicontrol External > \uicontrol Configure.
|
||||||
|
|
||||||
To open TS files in Qt Linguist, right-click a TS file in the
|
To open TS files in Qt Linguist, right-click a TS file in the
|
||||||
\uicontrol Projects or \uicontrol {File System} view and select
|
\uicontrol Projects or \uicontrol {File System} view and select
|
||||||
@@ -106,6 +106,11 @@
|
|||||||
|
|
||||||
\image qtcreator-external-tools.png
|
\image qtcreator-external-tools.png
|
||||||
|
|
||||||
|
Select the \inlineimage replace.png
|
||||||
|
(\uicontrol {Variables}) button in a field to select from a list of
|
||||||
|
\l{Using Qt Creator Variables}{variables} that are available in a
|
||||||
|
particular context.
|
||||||
|
|
||||||
To configure external tools:
|
To configure external tools:
|
||||||
|
|
||||||
\list 1
|
\list 1
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
**
|
**
|
||||||
** Copyright (C) 2020 The Qt Company Ltd.
|
** Copyright (C) 2021 The Qt Company Ltd.
|
||||||
** Contact: https://www.qt.io/licensing/
|
** Contact: https://www.qt.io/licensing/
|
||||||
**
|
**
|
||||||
** This file is part of the Qt Creator documentation.
|
** This file is part of the Qt Creator documentation.
|
||||||
@@ -47,6 +47,30 @@
|
|||||||
To create a label with a background, use the \l Label type from the
|
To create a label with a background, use the \l Label type from the
|
||||||
Qt Quick Controls module.
|
Qt Quick Controls module.
|
||||||
|
|
||||||
|
\section1 Using Rich Text
|
||||||
|
|
||||||
|
You can use rich text in the \l Text and \l TextInput components. To
|
||||||
|
open the rich text editor, select the \inlineimage icons/edit.png
|
||||||
|
(\uicontrol Edit) button next to the \uicontrol Text field in
|
||||||
|
\uicontrol Properties.
|
||||||
|
|
||||||
|
\image qtquick-text-rtf.gif "Editing text in the rich text editor"
|
||||||
|
|
||||||
|
In the rich text editor, you can:
|
||||||
|
|
||||||
|
\list
|
||||||
|
\li Emphasize text
|
||||||
|
\li Create hyperlinks
|
||||||
|
\li Align text
|
||||||
|
\li Create bulleted and numbered lists
|
||||||
|
\li Specify text color
|
||||||
|
\li Select text font
|
||||||
|
\li Set font size
|
||||||
|
\li Create tables
|
||||||
|
\endlist
|
||||||
|
|
||||||
|
\image qtquick-rtf-editor.png "Text formatted as rich text in the editor"
|
||||||
|
|
||||||
\section1 Typography
|
\section1 Typography
|
||||||
|
|
||||||
For each string that you enter in the \uicontrol Text field, you can
|
For each string that you enter in the \uicontrol Text field, you can
|
||||||
|
@@ -242,7 +242,11 @@ def qdump__std__list(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdump__std__list__QNX(d, value):
|
def qdump__std__list__QNX(d, value):
|
||||||
|
try:
|
||||||
|
_ = value["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||||
(proxy, head, size) = value.split("ppp")
|
(proxy, head, size) = value.split("ppp")
|
||||||
|
except Exception:
|
||||||
|
(head, size) = value.split("pp")
|
||||||
d.putItemCount(size, 1000)
|
d.putItemCount(size, 1000)
|
||||||
|
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
@@ -330,7 +334,11 @@ def qdump__std__map(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdump_std__map__helper(d, value):
|
def qdump_std__map__helper(d, value):
|
||||||
|
try:
|
||||||
|
_ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"]
|
||||||
(proxy, head, size) = value.split("ppp")
|
(proxy, head, size) = value.split("ppp")
|
||||||
|
except Exception:
|
||||||
|
(head, size) = value.split("pp")
|
||||||
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
||||||
d.putItemCount(size)
|
d.putItemCount(size)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
@@ -505,7 +513,11 @@ def qdump__std__set(d, value):
|
|||||||
|
|
||||||
|
|
||||||
def qdump__std__set__QNX(d, value):
|
def qdump__std__set__QNX(d, value):
|
||||||
|
try:
|
||||||
|
_ = value["_Mypair"]["_Myval2"]["_Myval2"]["_Myproxy"]
|
||||||
(proxy, head, size) = value.split("ppp")
|
(proxy, head, size) = value.split("ppp")
|
||||||
|
except Exception:
|
||||||
|
(head, size) = value.split("pp")
|
||||||
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
d.check(0 <= size and size <= 100 * 1000 * 1000)
|
||||||
d.putItemCount(size)
|
d.putItemCount(size)
|
||||||
if d.isExpanded():
|
if d.isExpanded():
|
||||||
@@ -744,9 +756,9 @@ def qdumpHelper__std__string__QNX(d, value, charType, format):
|
|||||||
|
|
||||||
def qdumpHelper__std__string__MSVC(d, value, charType, format):
|
def qdumpHelper__std__string__MSVC(d, value, charType, format):
|
||||||
try:
|
try:
|
||||||
|
_ = value["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||||
(proxy, buffer, size, alloc) = value.split("p16spp")
|
(proxy, buffer, size, alloc) = value.split("p16spp")
|
||||||
d.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
|
except Exception:
|
||||||
except RuntimeError:
|
|
||||||
proxy = None
|
proxy = None
|
||||||
(buffer, size, alloc) = value.split("16spp")
|
(buffer, size, alloc) = value.split("16spp")
|
||||||
d.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
|
d.check(0 <= size and size <= alloc and alloc <= 100 * 1000 * 1000)
|
||||||
@@ -1128,21 +1140,21 @@ def qdumpHelper__std__vector__libcxx(d, value):
|
|||||||
def qdumpHelper__std__vector__msvc(d, value):
|
def qdumpHelper__std__vector__msvc(d, value):
|
||||||
inner_type = value.type[0]
|
inner_type = value.type[0]
|
||||||
if inner_type.name == "bool":
|
if inner_type.name == "bool":
|
||||||
proxy1, proxy2, start, finish, alloc, size = value.split("pppppi")
|
|
||||||
try:
|
try:
|
||||||
d.check(0 <= size and size <= 1000 * 1000 * 1000)
|
_ = value["_Myproxy"]
|
||||||
d.check(finish <= alloc)
|
proxy1, proxy2, start, finish, alloc, size = value.split("pppppi")
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
start, finish, alloc, size = value.split("pppi")
|
start, finish, alloc, size = value.split("pppi")
|
||||||
|
d.check(0 <= size and size <= 1000 * 1000 * 1000)
|
||||||
qdumpHelper__std__vector__bool(d, start, size, inner_type)
|
qdumpHelper__std__vector__bool(d, start, size, inner_type)
|
||||||
else:
|
else:
|
||||||
proxy, start, finish, alloc = value.split("pppp")
|
|
||||||
size = (finish - start) // inner_type.size()
|
|
||||||
try:
|
try:
|
||||||
d.check(0 <= size and size <= 1000 * 1000 * 1000)
|
_ = value["_Mypair"]["_Myval2"]["_Myproxy"]
|
||||||
d.check(finish <= alloc)
|
proxy, start, finish, alloc = value.split("pppp")
|
||||||
except RuntimeError:
|
except RuntimeError:
|
||||||
start, finish, alloc = value.split("ppp")
|
start, finish, alloc = value.split("ppp")
|
||||||
|
size = (finish - start) // inner_type.size()
|
||||||
|
d.check(0 <= size and size <= 1000 * 1000 * 1000)
|
||||||
qdumpHelper__std__vector__nonbool(d, start, finish, alloc, inner_type)
|
qdumpHelper__std__vector__nonbool(d, start, finish, alloc, inner_type)
|
||||||
|
|
||||||
|
|
||||||
|
@@ -154,7 +154,7 @@ void SftpTransfer::doStart()
|
|||||||
batchFile.write("-mkdir " + QtcProcess::quoteArgUnix(dir).toLocal8Bit() + '\n');
|
batchFile.write("-mkdir " + QtcProcess::quoteArgUnix(dir).toLocal8Bit() + '\n');
|
||||||
break;
|
break;
|
||||||
case Internal::FileTransferType::Download:
|
case Internal::FileTransferType::Download:
|
||||||
if (!QDir::root().mkdir(dir)) {
|
if (!QDir::root().mkpath(dir)) {
|
||||||
emitError(tr("Failed to create local directory \"%1\".")
|
emitError(tr("Failed to create local directory \"%1\".")
|
||||||
.arg(QDir::toNativeSeparators(dir)));
|
.arg(QDir::toNativeSeparators(dir)));
|
||||||
return;
|
return;
|
||||||
@@ -163,7 +163,7 @@ void SftpTransfer::doStart()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (const FileToTransfer &f : d->files) {
|
for (const FileToTransfer &f : d->files) {
|
||||||
QString sourceFileOrLinkTarget;
|
QString sourceFileOrLinkTarget = f.sourceFile;
|
||||||
bool link = false;
|
bool link = false;
|
||||||
if (d->transferType == Internal::FileTransferType::Upload) {
|
if (d->transferType == Internal::FileTransferType::Upload) {
|
||||||
QFileInfo fi(f.sourceFile);
|
QFileInfo fi(f.sourceFile);
|
||||||
@@ -172,8 +172,6 @@ void SftpTransfer::doStart()
|
|||||||
batchFile.write("-rm " + QtcProcess::quoteArgUnix(f.targetFile).toLocal8Bit()
|
batchFile.write("-rm " + QtcProcess::quoteArgUnix(f.targetFile).toLocal8Bit()
|
||||||
+ '\n');
|
+ '\n');
|
||||||
sourceFileOrLinkTarget = fi.dir().relativeFilePath(fi.symLinkTarget()); // see QTBUG-5817.
|
sourceFileOrLinkTarget = fi.dir().relativeFilePath(fi.symLinkTarget()); // see QTBUG-5817.
|
||||||
} else {
|
|
||||||
sourceFileOrLinkTarget = f.sourceFile;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
batchFile.write(d->transferCommand(link) + ' '
|
batchFile.write(d->transferCommand(link) + ' '
|
||||||
|
@@ -329,7 +329,9 @@ OutputLineParser::Result OutputFormatter::handleMessage(const QString &text, Out
|
|||||||
QList<OutputLineParser *> &involvedParsers)
|
QList<OutputLineParser *> &involvedParsers)
|
||||||
{
|
{
|
||||||
// We only invoke the line parsers for stdout and stderr
|
// We only invoke the line parsers for stdout and stderr
|
||||||
if (format != StdOutFormat && format != StdErrFormat)
|
// Bad: on Windows we may get stdout and stdErr only as DebugFormat as e.g. GUI applications
|
||||||
|
// print them Windows-internal and we retrieve this separately
|
||||||
|
if (format != StdOutFormat && format != StdErrFormat && format != DebugFormat)
|
||||||
return OutputLineParser::Status::NotHandled;
|
return OutputLineParser::Status::NotHandled;
|
||||||
const OutputLineParser * const oldNextParser = d->nextParser;
|
const OutputLineParser * const oldNextParser = d->nextParser;
|
||||||
if (d->nextParser) {
|
if (d->nextParser) {
|
||||||
|
@@ -498,6 +498,7 @@ void ProjectTreeWidget::setCurrentItem(Node *node)
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
m_view->clearSelection();
|
m_view->clearSelection();
|
||||||
|
m_view->setCurrentIndex({});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -235,6 +235,11 @@ void DebugView::selectedNodesChanged(const QList<ModelNode> &selectedNodes /*sel
|
|||||||
|
|
||||||
message << lineBreak;
|
message << lineBreak;
|
||||||
|
|
||||||
|
for (const SignalHandlerProperty &property : selectedNode.signalProperties())
|
||||||
|
message << property << lineBreak;
|
||||||
|
|
||||||
|
message << lineBreak;
|
||||||
|
|
||||||
if (selectedNode.metaInfo().isValid()) {
|
if (selectedNode.metaInfo().isValid()) {
|
||||||
for (const NodeMetaInfo &metaInfo : selectedNode.metaInfo().classHierarchy())
|
for (const NodeMetaInfo &metaInfo : selectedNode.metaInfo().classHierarchy())
|
||||||
message << metaInfo.typeName() << lineBreak;
|
message << metaInfo.typeName() << lineBreak;
|
||||||
|
@@ -34,6 +34,16 @@
|
|||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
using namespace QtSupport;
|
using namespace QtSupport;
|
||||||
|
|
||||||
|
static QString format(const QString &fileName, int lineNo, const QString &msg)
|
||||||
|
{
|
||||||
|
if (lineNo > 0)
|
||||||
|
return QString::fromLatin1("%1(%2): %3").arg(fileName, QString::number(lineNo), msg);
|
||||||
|
else if (!fileName.isEmpty())
|
||||||
|
return QString::fromLatin1("%1: %2").arg(fileName, msg);
|
||||||
|
else
|
||||||
|
return msg;
|
||||||
|
}
|
||||||
|
|
||||||
ProMessageHandler::ProMessageHandler(bool verbose, bool exact)
|
ProMessageHandler::ProMessageHandler(bool verbose, bool exact)
|
||||||
: m_verbose(verbose)
|
: m_verbose(verbose)
|
||||||
, m_exact(exact)
|
, m_exact(exact)
|
||||||
@@ -54,8 +64,12 @@ void ProMessageHandler::message(int type, const QString &msg, const QString &fil
|
|||||||
{
|
{
|
||||||
if ((type & CategoryMask) == ErrorMessage && ((type & SourceMask) == SourceParser || m_verbose)) {
|
if ((type & CategoryMask) == ErrorMessage && ((type & SourceMask) == SourceParser || m_verbose)) {
|
||||||
// parse error in qmake files
|
// parse error in qmake files
|
||||||
|
if (m_exact) {
|
||||||
TaskHub::addTask(
|
TaskHub::addTask(
|
||||||
BuildSystemTask(Task::Error, msg, Utils::FilePath::fromString(fileName), lineNo));
|
BuildSystemTask(Task::Error, msg, Utils::FilePath::fromString(fileName), lineNo));
|
||||||
|
} else {
|
||||||
|
appendMessage(format(fileName, lineNo, msg));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -64,9 +78,9 @@ void ProMessageHandler::fileMessage(int type, const QString &msg)
|
|||||||
// message(), warning() or error() calls in qmake files
|
// message(), warning() or error() calls in qmake files
|
||||||
if (!m_verbose)
|
if (!m_verbose)
|
||||||
return;
|
return;
|
||||||
if (type == QMakeHandler::ErrorMessage)
|
if (m_exact && type == QMakeHandler::ErrorMessage)
|
||||||
TaskHub::addTask(BuildSystemTask(Task::Error, msg));
|
TaskHub::addTask(BuildSystemTask(Task::Error, msg));
|
||||||
else if (type == QMakeHandler::WarningMessage)
|
else if (m_exact && type == QMakeHandler::WarningMessage)
|
||||||
TaskHub::addTask(BuildSystemTask(Task::Warning, msg));
|
TaskHub::addTask(BuildSystemTask(Task::Warning, msg));
|
||||||
else
|
else
|
||||||
appendMessage(msg);
|
appendMessage(msg);
|
||||||
|
@@ -49,7 +49,7 @@ namespace Internal {
|
|||||||
|
|
||||||
OutputLineParser::Result QtTestParser::handleLine(const QString &line, OutputFormat type)
|
OutputLineParser::Result QtTestParser::handleLine(const QString &line, OutputFormat type)
|
||||||
{
|
{
|
||||||
if (type != StdOutFormat)
|
if (type != StdOutFormat && type != DebugFormat)
|
||||||
return Status::NotHandled;
|
return Status::NotHandled;
|
||||||
|
|
||||||
const QString theLine = rightTrimmed(line);
|
const QString theLine = rightTrimmed(line);
|
||||||
|
@@ -3682,7 +3682,7 @@ void TextEditorWidgetPrivate::highlightSearchResults(const QTextBlock &block, co
|
|||||||
.toTextCharFormat(C_SEARCH_RESULT).background().color().darker(120);
|
.toTextCharFormat(C_SEARCH_RESULT).background().color().darker(120);
|
||||||
|
|
||||||
while (idx < text.length()) {
|
while (idx < text.length()) {
|
||||||
const QRegularExpressionMatch match = m_searchExpr.match(text, idx + 1);
|
const QRegularExpressionMatch match = m_searchExpr.match(text, idx + l + 1);
|
||||||
if (!match.hasMatch())
|
if (!match.hasMatch())
|
||||||
break;
|
break;
|
||||||
idx = match.capturedStart();
|
idx = match.capturedStart();
|
||||||
|
Submodule src/shared/qbs updated: 8621465db2...01a8b6e119
@@ -197,3 +197,13 @@ extend_qtc_executable(qml2puppet
|
|||||||
designersupportdelegate.h
|
designersupportdelegate.h
|
||||||
qmlprivategate_56.cpp qmlprivategate.h
|
qmlprivategate_56.cpp qmlprivategate.h
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(DEFINED MULTILANGUAGE_SUPPORT_SUBDIRECTORY)
|
||||||
|
add_subdirectory(${MULTILANGUAGE_SUPPORT_SUBDIRECTORY} multilanguagesupport_static_build)
|
||||||
|
endif()
|
||||||
|
|
||||||
|
extend_qtc_executable(qml2puppet
|
||||||
|
CONDITION TARGET QtCreator::multilanguage-support
|
||||||
|
DEPENDS QtCreator::multilanguage-support
|
||||||
|
FEATURE_INFO "multilanguage-support in qml2puppet"
|
||||||
|
)
|
||||||
|
@@ -28,6 +28,7 @@
|
|||||||
#include <ssh/sshconnection.h>
|
#include <ssh/sshconnection.h>
|
||||||
#include <ssh/sshremoteprocessrunner.h>
|
#include <ssh/sshremoteprocessrunner.h>
|
||||||
#include <ssh/sshsettings.h>
|
#include <ssh/sshsettings.h>
|
||||||
|
#include <utils/algorithm.h>
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/temporarydirectory.h>
|
#include <utils/temporarydirectory.h>
|
||||||
|
|
||||||
@@ -371,12 +372,15 @@ void tst_Ssh::sftp()
|
|||||||
// Create and upload 1000 small files and one big file
|
// Create and upload 1000 small files and one big file
|
||||||
QTemporaryDir dirForFilesToUpload;
|
QTemporaryDir dirForFilesToUpload;
|
||||||
QTemporaryDir dirForFilesToDownload;
|
QTemporaryDir dirForFilesToDownload;
|
||||||
|
QTemporaryDir dir2ForFilesToDownload;
|
||||||
QVERIFY2(dirForFilesToUpload.isValid(), qPrintable(dirForFilesToUpload.errorString()));
|
QVERIFY2(dirForFilesToUpload.isValid(), qPrintable(dirForFilesToUpload.errorString()));
|
||||||
QVERIFY2(dirForFilesToDownload.isValid(), qPrintable(dirForFilesToDownload.errorString()));
|
QVERIFY2(dirForFilesToDownload.isValid(), qPrintable(dirForFilesToDownload.errorString()));
|
||||||
|
QVERIFY2(dir2ForFilesToDownload.isValid(), qPrintable(dirForFilesToDownload.errorString()));
|
||||||
static const auto getRemoteFilePath = [](const QString &localFileName) {
|
static const auto getRemoteFilePath = [](const QString &localFileName) {
|
||||||
return QString("/tmp/").append(localFileName).append(".upload");
|
return QString("/tmp/").append(localFileName).append(".upload");
|
||||||
};
|
};
|
||||||
const auto getDownloadFilePath = [&dirForFilesToDownload](const QString &localFileName) {
|
const auto getDownloadFilePath = [](const QTemporaryDir &dirForFilesToDownload,
|
||||||
|
const QString &localFileName) {
|
||||||
return QString(dirForFilesToDownload.path()).append('/').append(localFileName);
|
return QString(dirForFilesToDownload.path()).append('/').append(localFileName);
|
||||||
};
|
};
|
||||||
FilesToTransfer filesToUpload;
|
FilesToTransfer filesToUpload;
|
||||||
@@ -464,7 +468,7 @@ void tst_Ssh::sftp()
|
|||||||
for (const QString &fileName : allUploadedFileNames) {
|
for (const QString &fileName : allUploadedFileNames) {
|
||||||
const QString localFilePath = dirForFilesToUpload.path() + '/' + fileName;
|
const QString localFilePath = dirForFilesToUpload.path() + '/' + fileName;
|
||||||
const QString remoteFilePath = getRemoteFilePath(fileName);
|
const QString remoteFilePath = getRemoteFilePath(fileName);
|
||||||
const QString downloadFilePath = getDownloadFilePath(fileName);
|
const QString downloadFilePath = getDownloadFilePath(dirForFilesToDownload, fileName);
|
||||||
const SftpJobId downloadJob = sftpChannel->downloadFile(remoteFilePath, downloadFilePath);
|
const SftpJobId downloadJob = sftpChannel->downloadFile(remoteFilePath, downloadFilePath);
|
||||||
QVERIFY(downloadJob != SftpInvalidJob);
|
QVERIFY(downloadJob != SftpInvalidJob);
|
||||||
jobs << downloadJob;
|
jobs << downloadJob;
|
||||||
@@ -477,10 +481,13 @@ void tst_Ssh::sftp()
|
|||||||
QVERIFY(jobs.empty());
|
QVERIFY(jobs.empty());
|
||||||
|
|
||||||
// Compare contents of uploaded and downloaded files
|
// Compare contents of uploaded and downloaded files
|
||||||
|
bool success;
|
||||||
|
const auto compareFiles = [&](const QTemporaryDir &downloadDir) {
|
||||||
|
success = false;
|
||||||
for (const QString &fileName : allUploadedFileNames) {
|
for (const QString &fileName : allUploadedFileNames) {
|
||||||
QFile originalFile(dirForFilesToUpload.path() + '/' + fileName);
|
QFile originalFile(dirForFilesToUpload.path() + '/' + fileName);
|
||||||
QVERIFY2(originalFile.open(QIODevice::ReadOnly), qPrintable(originalFile.errorString()));
|
QVERIFY2(originalFile.open(QIODevice::ReadOnly), qPrintable(originalFile.errorString()));
|
||||||
QFile downloadedFile(dirForFilesToDownload.path() + '/' + fileName);
|
QFile downloadedFile(getDownloadFilePath(downloadDir, fileName));
|
||||||
QVERIFY2(downloadedFile.open(QIODevice::ReadOnly),
|
QVERIFY2(downloadedFile.open(QIODevice::ReadOnly),
|
||||||
qPrintable(downloadedFile.errorString()));
|
qPrintable(downloadedFile.errorString()));
|
||||||
QVERIFY(originalFile.fileName() != downloadedFile.fileName());
|
QVERIFY(originalFile.fileName() != downloadedFile.fileName());
|
||||||
@@ -495,6 +502,34 @@ void tst_Ssh::sftp()
|
|||||||
bytesLeft -= bytesToRead;
|
bytesLeft -= bytesToRead;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
success = true;
|
||||||
|
};
|
||||||
|
compareFiles(dirForFilesToDownload);
|
||||||
|
QVERIFY(success);
|
||||||
|
|
||||||
|
// The same again, with a non-interactive download.
|
||||||
|
FilesToTransfer filesToDownload = Utils::transform(filesToUpload, [&](const FileToTransfer &fileToUpload) {
|
||||||
|
return FileToTransfer(fileToUpload.targetFile,
|
||||||
|
getDownloadFilePath(dir2ForFilesToDownload,
|
||||||
|
QFileInfo(fileToUpload.sourceFile).fileName()));
|
||||||
|
});
|
||||||
|
const SftpTransferPtr download = connection.createDownload(filesToDownload,
|
||||||
|
FileTransferErrorHandling::Abort);
|
||||||
|
connect(download.get(), &SftpTransfer::done, [&jobError, &loop](const QString &error) {
|
||||||
|
jobError = error;
|
||||||
|
loop.quit();
|
||||||
|
});
|
||||||
|
QObject::connect(&timer, &QTimer::timeout, &loop, &QEventLoop::quit);
|
||||||
|
timer.setSingleShot(true);
|
||||||
|
timer.setInterval(30 * 1000);
|
||||||
|
timer.start();
|
||||||
|
download->start();
|
||||||
|
loop.exec();
|
||||||
|
QVERIFY(timer.isActive());
|
||||||
|
timer.stop();
|
||||||
|
QVERIFY2(jobError.isEmpty(), qPrintable(jobError));
|
||||||
|
compareFiles(dir2ForFilesToDownload);
|
||||||
|
QVERIFY(success);
|
||||||
|
|
||||||
// Remove the uploaded files on the remote system
|
// Remove the uploaded files on the remote system
|
||||||
timer.setInterval((params.timeout + 5) * 1000);
|
timer.setInterval((params.timeout + 5) * 1000);
|
||||||
|
Reference in New Issue
Block a user