forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.12'
Change-Id: Ibd37fd7aedbd0bcb1db56f92e6477abf9c9ab686
This commit is contained in:
@@ -169,8 +169,8 @@ public:
|
|||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString m_version;
|
|
||||||
QString m_file;
|
QString m_file;
|
||||||
|
QString m_version;
|
||||||
QString m_desc;
|
QString m_desc;
|
||||||
QString m_vendor;
|
QString m_vendor;
|
||||||
QString m_url;
|
QString m_url;
|
||||||
@@ -497,7 +497,7 @@ DeviceSelection DeviceSelectionView::buildSelection(const DeviceSelectionItem *i
|
|||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
} while (item = item->parentPackItem());
|
} while ((item = item->parentPackItem()));
|
||||||
return selection;
|
return selection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -373,11 +373,6 @@ bool UvscClient::fetchStackFrames(quint32 taskId, quint64 address, GdbMi &data)
|
|||||||
if (!checkConnection())
|
if (!checkConnection())
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
iSTKENUM istkenum = {};
|
|
||||||
istkenum.task = taskId;
|
|
||||||
istkenum.isFull = true;
|
|
||||||
istkenum.hasExtended = true;
|
|
||||||
|
|
||||||
std::vector<STACKENUM> stackenums;
|
std::vector<STACKENUM> stackenums;
|
||||||
const bool success = enumerateStack(taskId, stackenums);
|
const bool success = enumerateStack(taskId, stackenums);
|
||||||
if (!success) {
|
if (!success) {
|
||||||
|
@@ -1486,14 +1486,19 @@ bool GitClient::synchronousParentRevisions(const QString &workingDirectory,
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Short SHA1, author, subject
|
|
||||||
static const char defaultShortLogFormatC[] = "%h (%an \"%s";
|
|
||||||
static const int maxShortLogLength = 120;
|
|
||||||
|
|
||||||
QString GitClient::synchronousShortDescription(const QString &workingDirectory, const QString &revision) const
|
QString GitClient::synchronousShortDescription(const QString &workingDirectory, const QString &revision) const
|
||||||
{
|
{
|
||||||
|
// HACK: The hopefully rare "_-_" will be replaced by quotes in the output,
|
||||||
|
// leaving it in breaks command line quoting on Windows, see QTCREATORBUG-23208.
|
||||||
|
const QString quoteReplacement = "_-_";
|
||||||
|
|
||||||
// Short SHA1, author, subject
|
// Short SHA1, author, subject
|
||||||
QString output = synchronousShortDescription(workingDirectory, revision, defaultShortLogFormatC);
|
const QString defaultShortLogFormat = "%h (%an " + quoteReplacement + "%s";
|
||||||
|
const int maxShortLogLength = 120;
|
||||||
|
|
||||||
|
// Short SHA 1, author, subject
|
||||||
|
QString output = synchronousShortDescription(workingDirectory, revision, defaultShortLogFormat);
|
||||||
|
output.replace(quoteReplacement, "\"");
|
||||||
if (output != revision) {
|
if (output != revision) {
|
||||||
if (output.length() > maxShortLogLength) {
|
if (output.length() > maxShortLogLength) {
|
||||||
output.truncate(maxShortLogLength);
|
output.truncate(maxShortLogLength);
|
||||||
@@ -3108,6 +3113,8 @@ void GitClient::push(const QString &workingDirectory, const QStringList &pushArg
|
|||||||
this, [this, command, workingDirectory, pushArgs](bool success) {
|
this, [this, command, workingDirectory, pushArgs](bool success) {
|
||||||
if (!success) {
|
if (!success) {
|
||||||
switch (static_cast<PushFailure>(command->cookie().toInt())) {
|
switch (static_cast<PushFailure>(command->cookie().toInt())) {
|
||||||
|
case Unknown:
|
||||||
|
break;
|
||||||
case NonFastForward: {
|
case NonFastForward: {
|
||||||
const QColor warnColor = Utils::creatorTheme()->color(Theme::TextColorError);
|
const QColor warnColor = Utils::creatorTheme()->color(Theme::TextColorError);
|
||||||
if (QMessageBox::question(
|
if (QMessageBox::question(
|
||||||
|
@@ -80,6 +80,7 @@ enum StashFlag {
|
|||||||
};
|
};
|
||||||
|
|
||||||
enum PushFailure {
|
enum PushFailure {
|
||||||
|
Unknown,
|
||||||
NonFastForward,
|
NonFastForward,
|
||||||
NoRemoteBranch
|
NoRemoteBranch
|
||||||
};
|
};
|
||||||
|
@@ -919,6 +919,14 @@ GitPluginPrivate::GitPluginPrivate()
|
|||||||
m_gerritPlugin->initialize(remoteRepositoryMenu);
|
m_gerritPlugin->initialize(remoteRepositoryMenu);
|
||||||
m_gerritPlugin->updateActions(currentState());
|
m_gerritPlugin->updateActions(currentState());
|
||||||
m_gerritPlugin->addToLocator(m_commandLocator);
|
m_gerritPlugin->addToLocator(m_commandLocator);
|
||||||
|
|
||||||
|
connect(VcsOutputWindow::instance(), &VcsOutputWindow::referenceClicked,
|
||||||
|
this, [this](const QString &name) {
|
||||||
|
const VcsBasePluginState state = currentState();
|
||||||
|
QTC_ASSERT(state.hasTopLevel(), return);
|
||||||
|
m_gitClient.show(state.topLevel(), name);
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitPluginPrivate::diffCurrentFile()
|
void GitPluginPrivate::diffCurrentFile()
|
||||||
|
@@ -109,11 +109,6 @@ static NimbleMetadata parseMetadata(const QString &nimblePath, const QString &wo
|
|||||||
NimbleBuildSystem::NimbleBuildSystem(Target *target)
|
NimbleBuildSystem::NimbleBuildSystem(Target *target)
|
||||||
: BuildSystem(target), m_projectScanner(target->project())
|
: BuildSystem(target), m_projectScanner(target->project())
|
||||||
{
|
{
|
||||||
// Not called in parseProject due to nimble behavior to create temporary
|
|
||||||
// files in project directory. This creation in turn stimulate the fs watcher
|
|
||||||
// that in turn causes project parsing (thus a loop if invoke in parseProject).
|
|
||||||
// For this reason we call this function manually during project creation
|
|
||||||
// See https://github.com/nim-lang/nimble/issues/720
|
|
||||||
m_projectScanner.watchProjectFilePath();
|
m_projectScanner.watchProjectFilePath();
|
||||||
|
|
||||||
connect(&m_projectScanner, &NimProjectScanner::fileChanged, this, [this](const QString &path) {
|
connect(&m_projectScanner, &NimProjectScanner::fileChanged, this, [this](const QString &path) {
|
||||||
@@ -126,8 +121,11 @@ NimbleBuildSystem::NimbleBuildSystem(Target *target)
|
|||||||
|
|
||||||
connect(&m_projectScanner, &NimProjectScanner::finished, this, &NimbleBuildSystem::updateProject);
|
connect(&m_projectScanner, &NimProjectScanner::finished, this, &NimbleBuildSystem::updateProject);
|
||||||
|
|
||||||
connect(&m_projectScanner, &NimProjectScanner::directoryChanged, this, [this] {
|
connect(&m_projectScanner, &NimProjectScanner::directoryChanged, this, [this] (const QString &directory){
|
||||||
if (!isWaitingForParse())
|
// Workaround for nimble creating temporary files in project root directory
|
||||||
|
// when querying the list of tasks.
|
||||||
|
// See https://github.com/nim-lang/nimble/issues/720
|
||||||
|
if (directory != projectDirectory().toString())
|
||||||
requestDelayedParse();
|
requestDelayedParse();
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -151,8 +149,8 @@ void NimbleBuildSystem::updateProject()
|
|||||||
QList<BuildTargetInfo> targets = Utils::transform(m_metadata.bin, [&](const QString &bin){
|
QList<BuildTargetInfo> targets = Utils::transform(m_metadata.bin, [&](const QString &bin){
|
||||||
BuildTargetInfo info = {};
|
BuildTargetInfo info = {};
|
||||||
info.displayName = bin;
|
info.displayName = bin;
|
||||||
info.targetFilePath = binDir.pathAppended(HostOsInfo::withExecutableSuffix(bin));
|
info.targetFilePath = binDir.pathAppended(bin);
|
||||||
info.projectFilePath = srcDir.pathAppended(bin).stringAppended(".nim");
|
info.projectFilePath = projectFilePath();
|
||||||
info.workingDirectory = binDir;
|
info.workingDirectory = binDir;
|
||||||
info.buildKey = bin;
|
info.buildKey = bin;
|
||||||
return info;
|
return info;
|
||||||
|
@@ -53,7 +53,7 @@ public:
|
|||||||
signals:
|
signals:
|
||||||
void finished();
|
void finished();
|
||||||
void requestReparse();
|
void requestReparse();
|
||||||
void directoryChanged();
|
void directoryChanged(const QString &path);
|
||||||
void fileChanged(const QString &path);
|
void fileChanged(const QString &path);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
@@ -30,17 +30,24 @@
|
|||||||
|
|
||||||
namespace VcsBase {
|
namespace VcsBase {
|
||||||
|
|
||||||
VcsOutputFormatter::VcsOutputFormatter() : m_urlRegexp("https?://\\S*") {}
|
VcsOutputFormatter::VcsOutputFormatter() :
|
||||||
|
m_urlRegexp("https?://\\S*"),
|
||||||
|
m_referenceRegexp("(v[0-9]+\\.[0-9]+\\.[0-9]+[\\-A-Za-z0-9]*)" // v0.1.2-beta3
|
||||||
|
"|([0-9a-f]{6,}(?:\\.\\.[0-9a-f]{6,})?)") // 789acf or 123abc..456cde
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
void VcsOutputFormatter::appendMessage(const QString &text, Utils::OutputFormat format)
|
void VcsOutputFormatter::appendMessage(const QString &text, Utils::OutputFormat format)
|
||||||
{
|
{
|
||||||
QString out = text;
|
const QRegularExpressionMatch urlMatch = m_urlRegexp.match(text);
|
||||||
const QRegularExpressionMatch match = m_urlRegexp.match(text);
|
const QRegularExpressionMatch referenceMatch = m_referenceRegexp.match(text);
|
||||||
if (match.hasMatch()) {
|
|
||||||
|
auto append = [this](const QRegularExpressionMatch &match,
|
||||||
|
QString text, Utils::OutputFormat format) {
|
||||||
const QTextCharFormat normalFormat = charFormat(format);
|
const QTextCharFormat normalFormat = charFormat(format);
|
||||||
OutputFormatter::appendMessage(text.left(match.capturedStart()), format);
|
OutputFormatter::appendMessage(text.left(match.capturedStart()), format);
|
||||||
QTextCursor tc = plainTextEdit()->textCursor();
|
QTextCursor tc = plainTextEdit()->textCursor();
|
||||||
QStringRef url = match.capturedRef();
|
QStringView url = match.capturedView();
|
||||||
int end = match.capturedEnd();
|
int end = match.capturedEnd();
|
||||||
while (url.rbegin()->isPunct()) {
|
while (url.rbegin()->isPunct()) {
|
||||||
url.chop(1);
|
url.chop(1);
|
||||||
@@ -50,14 +57,22 @@ void VcsOutputFormatter::appendMessage(const QString &text, Utils::OutputFormat
|
|||||||
tc.insertText(url.toString(), linkFormat(normalFormat, url.toString()));
|
tc.insertText(url.toString(), linkFormat(normalFormat, url.toString()));
|
||||||
tc.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
|
tc.movePosition(QTextCursor::End, QTextCursor::MoveAnchor);
|
||||||
OutputFormatter::appendMessage(text.mid(end), format);
|
OutputFormatter::appendMessage(text.mid(end), format);
|
||||||
} else {
|
};
|
||||||
|
|
||||||
|
if (urlMatch.hasMatch())
|
||||||
|
append(urlMatch, text, format);
|
||||||
|
else if (referenceMatch.hasMatch())
|
||||||
|
append(referenceMatch, text, format);
|
||||||
|
else
|
||||||
OutputFormatter::appendMessage(text, format);
|
OutputFormatter::appendMessage(text, format);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
void VcsOutputFormatter::handleLink(const QString &href)
|
void VcsOutputFormatter::handleLink(const QString &href)
|
||||||
{
|
{
|
||||||
|
if (href.startsWith("http://") || href.startsWith("https://"))
|
||||||
QDesktopServices::openUrl(QUrl(href));
|
QDesktopServices::openUrl(QUrl(href));
|
||||||
|
else if (!href.isEmpty())
|
||||||
|
emit referenceClicked(href);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -31,14 +31,19 @@ namespace VcsBase {
|
|||||||
|
|
||||||
class VcsOutputFormatter : public Utils::OutputFormatter
|
class VcsOutputFormatter : public Utils::OutputFormatter
|
||||||
{
|
{
|
||||||
|
Q_OBJECT
|
||||||
public:
|
public:
|
||||||
VcsOutputFormatter();
|
VcsOutputFormatter();
|
||||||
~VcsOutputFormatter() override = default;
|
~VcsOutputFormatter() override = default;
|
||||||
void appendMessage(const QString &text, Utils::OutputFormat format) override;
|
void appendMessage(const QString &text, Utils::OutputFormat format) override;
|
||||||
void handleLink(const QString &href) override;
|
void handleLink(const QString &href) override;
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void referenceClicked(const QString &reference);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
const QRegularExpression m_urlRegexp;
|
const QRegularExpression m_urlRegexp;
|
||||||
|
const QRegularExpression m_referenceRegexp;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@@ -102,6 +102,7 @@ public:
|
|||||||
void appendLines(const QString &s, const QString &repository = QString());
|
void appendLines(const QString &s, const QString &repository = QString());
|
||||||
void appendLinesWithStyle(const QString &s, VcsOutputWindow::MessageStyle style,
|
void appendLinesWithStyle(const QString &s, VcsOutputWindow::MessageStyle style,
|
||||||
const QString &repository = QString());
|
const QString &repository = QString());
|
||||||
|
VcsOutputFormatter *formatter();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void contextMenuEvent(QContextMenuEvent *event) override;
|
void contextMenuEvent(QContextMenuEvent *event) override;
|
||||||
@@ -247,6 +248,11 @@ void OutputWindowPlainTextEdit::appendLinesWithStyle(const QString &s,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
VcsOutputFormatter *OutputWindowPlainTextEdit::formatter()
|
||||||
|
{
|
||||||
|
return m_formatter;
|
||||||
|
}
|
||||||
|
|
||||||
void OutputWindowPlainTextEdit::setFormat(VcsOutputWindow::MessageStyle style)
|
void OutputWindowPlainTextEdit::setFormat(VcsOutputWindow::MessageStyle style)
|
||||||
{
|
{
|
||||||
m_formatter->setBoldFontEnabled(style == VcsOutputWindow::Command);
|
m_formatter->setBoldFontEnabled(style == VcsOutputWindow::Command);
|
||||||
@@ -305,6 +311,8 @@ VcsOutputWindow::VcsOutputWindow()
|
|||||||
connect(this, &IOutputPane::resetZoom, &d->widget, &Core::OutputWindow::resetZoom);
|
connect(this, &IOutputPane::resetZoom, &d->widget, &Core::OutputWindow::resetZoom);
|
||||||
connect(TextEditor::TextEditorSettings::instance(), &TextEditor::TextEditorSettings::behaviorSettingsChanged,
|
connect(TextEditor::TextEditorSettings::instance(), &TextEditor::TextEditorSettings::behaviorSettingsChanged,
|
||||||
this, updateBehaviorSettings);
|
this, updateBehaviorSettings);
|
||||||
|
connect(d->widget.formatter(), &VcsOutputFormatter::referenceClicked,
|
||||||
|
VcsOutputWindow::instance(), &VcsOutputWindow::referenceClicked);
|
||||||
}
|
}
|
||||||
|
|
||||||
static QString filterPasswordFromUrls(const QString &input)
|
static QString filterPasswordFromUrls(const QString &input)
|
||||||
|
@@ -76,6 +76,9 @@ public:
|
|||||||
Message, // A blue message text (e.g. "command has finished successfully")
|
Message, // A blue message text (e.g. "command has finished successfully")
|
||||||
};
|
};
|
||||||
|
|
||||||
|
signals:
|
||||||
|
void referenceClicked(const QString &reference);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
static void setRepository(const QString &);
|
static void setRepository(const QString &);
|
||||||
static void clearRepository();
|
static void clearRepository();
|
||||||
|
Reference in New Issue
Block a user