forked from qt-creator/qt-creator
Remove spaces in initializer lists
Format initializer lists code style like. Change-Id: Ib82c235e4ba7dc75ee96a7abc0c47eff7b0a9013 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -102,7 +102,7 @@ static bool insertQuote(const QChar ch, const BackwardsScanner &tk)
|
|||||||
return tk.text(index) == "operator";
|
return tk.text(index) == "operator";
|
||||||
|
|
||||||
// Insert matching quote after identifier when identifier is a known literal prefixes
|
// Insert matching quote after identifier when identifier is a known literal prefixes
|
||||||
static const QStringList stringLiteralPrefixes = { "L", "U", "u", "u8", "R"};
|
static const QStringList stringLiteralPrefixes = {"L", "U", "u", "u8", "R"};
|
||||||
return token.kind() == CPlusPlus::T_IDENTIFIER
|
return token.kind() == CPlusPlus::T_IDENTIFIER
|
||||||
&& stringLiteralPrefixes.contains(tk.text(index));
|
&& stringLiteralPrefixes.contains(tk.text(index));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -840,7 +840,7 @@ void Preprocessor::handleDefined(PPToken *tk)
|
|||||||
|
|
||||||
void Preprocessor::pushToken(Preprocessor::PPToken *tk)
|
void Preprocessor::pushToken(Preprocessor::PPToken *tk)
|
||||||
{
|
{
|
||||||
const PPToken currentTokenBuffer[] = { *tk };
|
const PPToken currentTokenBuffer[] = {*tk};
|
||||||
m_state.pushTokenBuffer(currentTokenBuffer, currentTokenBuffer + 1, 0);
|
m_state.pushTokenBuffer(currentTokenBuffer, currentTokenBuffer + 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -313,19 +313,19 @@ void DiagramSceneController::dropNewElement(const QString &newElementId, const Q
|
|||||||
auto package = new MPackage();
|
auto package = new MPackage();
|
||||||
newName = tr("New Package");
|
newName = tr("New Package");
|
||||||
if (!stereotype.isEmpty())
|
if (!stereotype.isEmpty())
|
||||||
package->setStereotypes({ stereotype });
|
package->setStereotypes({stereotype});
|
||||||
newObject = package;
|
newObject = package;
|
||||||
} else if (newElementId == QLatin1String(ELEMENT_TYPE_COMPONENT)) {
|
} else if (newElementId == QLatin1String(ELEMENT_TYPE_COMPONENT)) {
|
||||||
auto component = new MComponent();
|
auto component = new MComponent();
|
||||||
newName = tr("New Component");
|
newName = tr("New Component");
|
||||||
if (!stereotype.isEmpty())
|
if (!stereotype.isEmpty())
|
||||||
component->setStereotypes({ stereotype });
|
component->setStereotypes({stereotype});
|
||||||
newObject = component;
|
newObject = component;
|
||||||
} else if (newElementId == QLatin1String(ELEMENT_TYPE_CLASS)) {
|
} else if (newElementId == QLatin1String(ELEMENT_TYPE_CLASS)) {
|
||||||
auto klass = new MClass();
|
auto klass = new MClass();
|
||||||
newName = tr("New Class");
|
newName = tr("New Class");
|
||||||
if (!stereotype.isEmpty())
|
if (!stereotype.isEmpty())
|
||||||
klass->setStereotypes({ stereotype });
|
klass->setStereotypes({stereotype});
|
||||||
newObject = klass;
|
newObject = klass;
|
||||||
} else if (newElementId == QLatin1String(ELEMENT_TYPE_ITEM)) {
|
} else if (newElementId == QLatin1String(ELEMENT_TYPE_ITEM)) {
|
||||||
auto item = new MItem();
|
auto item = new MItem();
|
||||||
|
|||||||
@@ -492,34 +492,34 @@ private:
|
|||||||
class IdsThatShouldNotBeUsedInDesigner : public QStringList
|
class IdsThatShouldNotBeUsedInDesigner : public QStringList
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
IdsThatShouldNotBeUsedInDesigner() : QStringList({ "top",
|
IdsThatShouldNotBeUsedInDesigner() : QStringList({"top",
|
||||||
"bottom",
|
"bottom",
|
||||||
"left",
|
"left",
|
||||||
"right",
|
"right",
|
||||||
"width",
|
"width",
|
||||||
"height",
|
"height",
|
||||||
"x",
|
"x",
|
||||||
"y",
|
"y",
|
||||||
"opacity",
|
"opacity",
|
||||||
"parent",
|
"parent",
|
||||||
"item",
|
"item",
|
||||||
"flow",
|
"flow",
|
||||||
"color",
|
"color",
|
||||||
"margin",
|
"margin",
|
||||||
"padding",
|
"padding",
|
||||||
"border",
|
"border",
|
||||||
"font",
|
"font",
|
||||||
"text",
|
"text",
|
||||||
"source",
|
"source",
|
||||||
"state",
|
"state",
|
||||||
"visible",
|
"visible",
|
||||||
"focus",
|
"focus",
|
||||||
"data",
|
"data",
|
||||||
"clip",
|
"clip",
|
||||||
"layer",
|
"layer",
|
||||||
"scale",
|
"scale",
|
||||||
"enabled",
|
"enabled",
|
||||||
"anchors"})
|
"anchors"})
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -550,13 +550,13 @@ class UnsupportedTypesByVisualDesigner : public QStringList
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnsupportedTypesByVisualDesigner() : QStringList({"Transform",
|
UnsupportedTypesByVisualDesigner() : QStringList({"Transform",
|
||||||
"Timer",
|
"Timer",
|
||||||
"Rotation",
|
"Rotation",
|
||||||
"Scale",
|
"Scale",
|
||||||
"Translate",
|
"Translate",
|
||||||
"Package",
|
"Package",
|
||||||
"Particles",
|
"Particles",
|
||||||
"Dialog"})
|
"Dialog"})
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -566,18 +566,18 @@ class UnsupportedTypesByQmlUi : public QStringList
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
UnsupportedTypesByQmlUi() : QStringList({"Binding",
|
UnsupportedTypesByQmlUi() : QStringList({"Binding",
|
||||||
"ShaderEffect",
|
"ShaderEffect",
|
||||||
"ShaderEffectSource",
|
"ShaderEffectSource",
|
||||||
"Component",
|
"Component",
|
||||||
"Loader",
|
"Loader",
|
||||||
"Transition",
|
"Transition",
|
||||||
"PropertyAnimation",
|
"PropertyAnimation",
|
||||||
"SequentialAnimation",
|
"SequentialAnimation",
|
||||||
"PropertyAnimation",
|
"PropertyAnimation",
|
||||||
"SequentialAnimation",
|
"SequentialAnimation",
|
||||||
"ParallelAnimation",
|
"ParallelAnimation",
|
||||||
"NumberAnimation",
|
"NumberAnimation",
|
||||||
"Drawer"})
|
"Drawer"})
|
||||||
{
|
{
|
||||||
append(UnsupportedTypesByVisualDesigner());
|
append(UnsupportedTypesByVisualDesigner());
|
||||||
}
|
}
|
||||||
@@ -1627,8 +1627,8 @@ bool Check::visit(CallExpression *ast)
|
|||||||
|
|
||||||
// We have to allow the translation functions
|
// We have to allow the translation functions
|
||||||
|
|
||||||
const QStringList translationFunctions = { "qsTr", "qsTrId", "qsTranslate",
|
const QStringList translationFunctions = {"qsTr", "qsTrId", "qsTranslate",
|
||||||
"qsTrNoOp", "qsTrIdNoOp", "qsTranslateNoOp" };
|
"qsTrNoOp", "qsTrIdNoOp", "qsTranslateNoOp"};
|
||||||
|
|
||||||
const bool isTranslationFunction = translationFunctions.contains(name);
|
const bool isTranslationFunction = translationFunctions.contains(name);
|
||||||
|
|
||||||
|
|||||||
@@ -647,10 +647,10 @@ QString PluginDumper::resolvePlugin(const QDir &qmldirPath, const QString &qmldi
|
|||||||
QString prefix;
|
QString prefix;
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||||
// try a qmake-style debug build first
|
// try a qmake-style debug build first
|
||||||
validSuffixList = QStringList({ "d.dll", ".dll" });
|
validSuffixList = QStringList({"d.dll", ".dll"});
|
||||||
} else if (Utils::HostOsInfo::isMacHost()) {
|
} else if (Utils::HostOsInfo::isMacHost()) {
|
||||||
// try a qmake-style debug build first
|
// try a qmake-style debug build first
|
||||||
validSuffixList = QStringList({ "_debug.dylib", ".dylib", ".so", ".bundle", "lib" });
|
validSuffixList = QStringList({"_debug.dylib", ".dylib", ".so", ".bundle", "lib"});
|
||||||
} else {
|
} else {
|
||||||
// Examples of valid library names:
|
// Examples of valid library names:
|
||||||
// libfoo.so
|
// libfoo.so
|
||||||
|
|||||||
@@ -58,13 +58,13 @@ const struct {
|
|||||||
SshRemoteProcess::Signal signalEnum;
|
SshRemoteProcess::Signal signalEnum;
|
||||||
const char * const signalString;
|
const char * const signalString;
|
||||||
} signalMap[] = {
|
} signalMap[] = {
|
||||||
{ SshRemoteProcess::AbrtSignal, "ABRT" }, { SshRemoteProcess::AlrmSignal, "ALRM" },
|
{SshRemoteProcess::AbrtSignal, "ABRT"}, {SshRemoteProcess::AlrmSignal, "ALRM"},
|
||||||
{ SshRemoteProcess::FpeSignal, "FPE" }, { SshRemoteProcess::HupSignal, "HUP" },
|
{SshRemoteProcess::FpeSignal, "FPE"}, {SshRemoteProcess::HupSignal, "HUP"},
|
||||||
{ SshRemoteProcess::IllSignal, "ILL" }, { SshRemoteProcess::IntSignal, "INT" },
|
{SshRemoteProcess::IllSignal, "ILL"}, {SshRemoteProcess::IntSignal, "INT"},
|
||||||
{ SshRemoteProcess::KillSignal, "KILL" }, { SshRemoteProcess::PipeSignal, "PIPE" },
|
{SshRemoteProcess::KillSignal, "KILL"}, {SshRemoteProcess::PipeSignal, "PIPE"},
|
||||||
{ SshRemoteProcess::QuitSignal, "QUIT" }, { SshRemoteProcess::SegvSignal, "SEGV" },
|
{SshRemoteProcess::QuitSignal, "QUIT"}, {SshRemoteProcess::SegvSignal, "SEGV"},
|
||||||
{ SshRemoteProcess::TermSignal, "TERM" }, { SshRemoteProcess::Usr1Signal, "USR1" },
|
{SshRemoteProcess::TermSignal, "TERM"}, {SshRemoteProcess::Usr1Signal, "USR1"},
|
||||||
{ SshRemoteProcess::Usr2Signal, "USR2" }
|
{SshRemoteProcess::Usr2Signal, "USR2"}
|
||||||
};
|
};
|
||||||
|
|
||||||
SshRemoteProcess::SshRemoteProcess(const QByteArray &command, quint32 channelId,
|
SshRemoteProcess::SshRemoteProcess(const QByteArray &command, quint32 channelId,
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ int TimelineNotesModel::add(int modelId, int timelineIndex, const QString &text)
|
|||||||
Q_D(TimelineNotesModel);
|
Q_D(TimelineNotesModel);
|
||||||
const TimelineModel *model = d->timelineModels.value(modelId);
|
const TimelineModel *model = d->timelineModels.value(modelId);
|
||||||
int typeId = model->typeId(timelineIndex);
|
int typeId = model->typeId(timelineIndex);
|
||||||
TimelineNotesModelPrivate::Note note = { text, modelId, timelineIndex };
|
TimelineNotesModelPrivate::Note note = {text, modelId, timelineIndex};
|
||||||
d->data << note;
|
d->data << note;
|
||||||
d->modified = true;
|
d->modified = true;
|
||||||
emit changed(typeId, modelId, timelineIndex);
|
emit changed(typeId, modelId, timelineIndex);
|
||||||
|
|||||||
@@ -101,7 +101,7 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
|
|||||||
}
|
}
|
||||||
pcmd = QLatin1String("/bin/sh");
|
pcmd = QLatin1String("/bin/sh");
|
||||||
pargs = QtcProcess::Arguments::createUnixArgs(
|
pargs = QtcProcess::Arguments::createUnixArgs(
|
||||||
QStringList({ "-c", (QtcProcess::quoteArg(program) + ' ' + args) }));
|
QStringList({"-c", (QtcProcess::quoteArg(program) + ' ' + args)}));
|
||||||
}
|
}
|
||||||
|
|
||||||
QtcProcess::SplitError qerr;
|
QtcProcess::SplitError qerr;
|
||||||
|
|||||||
@@ -475,9 +475,9 @@ FileSaver::FileSaver(const QString &filename, QIODevice::OpenMode mode)
|
|||||||
if (HostOsInfo::isWindowsHost()) {
|
if (HostOsInfo::isWindowsHost()) {
|
||||||
// Taken from: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
// Taken from: https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx
|
||||||
static const QStringList reservedNames
|
static const QStringList reservedNames
|
||||||
= { "CON", "PRN", "AUX", "NUL",
|
= {"CON", "PRN", "AUX", "NUL",
|
||||||
"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
|
"COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9",
|
||||||
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9" };
|
"LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"};
|
||||||
const QString fn = QFileInfo(filename).baseName().toUpper();
|
const QString fn = QFileInfo(filename).baseName().toUpper();
|
||||||
for (const QString &rn : reservedNames) {
|
for (const QString &rn : reservedNames) {
|
||||||
if (fn == rn) {
|
if (fn == rn) {
|
||||||
|
|||||||
@@ -660,7 +660,7 @@ bool QtcProcess::prepareCommand(const QString &command, const QString &arguments
|
|||||||
return false;
|
return false;
|
||||||
*outCmd = QLatin1String("/bin/sh");
|
*outCmd = QLatin1String("/bin/sh");
|
||||||
*outArgs = Arguments::createUnixArgs(
|
*outArgs = Arguments::createUnixArgs(
|
||||||
QStringList({ "-c", (quoteArg(command) + ' ' + arguments) }));
|
QStringList({"-c", (quoteArg(command) + ' ' + arguments)}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@@ -1039,7 +1039,7 @@ bool QtcProcess::expandMacros(QString *cmd, AbstractMacroExpander *mx, OsType os
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// !Windows
|
// !Windows
|
||||||
MxState state = { MxBasic, false };
|
MxState state = {MxBasic, false};
|
||||||
QStack<MxState> sstack;
|
QStack<MxState> sstack;
|
||||||
QStack<MxSave> ostack;
|
QStack<MxSave> ostack;
|
||||||
|
|
||||||
@@ -1085,7 +1085,7 @@ bool QtcProcess::expandMacros(QString *cmd, AbstractMacroExpander *mx, OsType os
|
|||||||
if (str.unicode()[pos + 1].unicode() == '(') {
|
if (str.unicode()[pos + 1].unicode() == '(') {
|
||||||
// $(( starts a math expression. This may also be a $( ( in fact,
|
// $(( starts a math expression. This may also be a $( ( in fact,
|
||||||
// so we push the current string and offset on a stack so we can retry.
|
// so we push the current string and offset on a stack so we can retry.
|
||||||
MxSave sav = { str, pos + 2, varPos };
|
MxSave sav = {str, pos + 2, varPos};
|
||||||
ostack.push(sav);
|
ostack.push(sav);
|
||||||
state.current = MxMath;
|
state.current = MxMath;
|
||||||
pos += 2;
|
pos += 2;
|
||||||
@@ -1315,7 +1315,7 @@ bool QtcProcess::ArgIterator::next()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
MxState state = { MxBasic, false };
|
MxState state = {MxBasic, false};
|
||||||
QStack<MxState> sstack;
|
QStack<MxState> sstack;
|
||||||
QStack<int> ostack;
|
QStack<int> ostack;
|
||||||
bool hadWord = false;
|
bool hadWord = false;
|
||||||
|
|||||||
@@ -700,7 +700,7 @@ static QString checkBinary(const QDir &dir, const QString &binary)
|
|||||||
case OsTypeOther:
|
case OsTypeOther:
|
||||||
break;
|
break;
|
||||||
case OsTypeWindows: {
|
case OsTypeWindows: {
|
||||||
static const char *windowsExtensions[] = {".cmd", ".bat", ".exe", ".com" };
|
static const char *windowsExtensions[] = {".cmd", ".bat", ".exe", ".com"};
|
||||||
// Check the Windows extensions using the order
|
// Check the Windows extensions using the order
|
||||||
const int windowsExtensionCount = sizeof(windowsExtensions)/sizeof(const char*);
|
const int windowsExtensionCount = sizeof(windowsExtensions)/sizeof(const char*);
|
||||||
for (int e = 0; e < windowsExtensionCount; e ++) {
|
for (int e = 0; e < windowsExtensionCount; e ++) {
|
||||||
|
|||||||
@@ -272,44 +272,44 @@ QPalette Theme::palette() const
|
|||||||
QPalette::ColorGroup paletteColorGroup;
|
QPalette::ColorGroup paletteColorGroup;
|
||||||
bool setColorRoleAsBrush;
|
bool setColorRoleAsBrush;
|
||||||
} mapping[] = {
|
} mapping[] = {
|
||||||
{ PaletteWindow, QPalette::Window, QPalette::All, false},
|
{PaletteWindow, QPalette::Window, QPalette::All, false},
|
||||||
{ PaletteWindowDisabled, QPalette::Window, QPalette::Disabled, false},
|
{PaletteWindowDisabled, QPalette::Window, QPalette::Disabled, false},
|
||||||
{ PaletteWindowText, QPalette::WindowText, QPalette::All, true},
|
{PaletteWindowText, QPalette::WindowText, QPalette::All, true},
|
||||||
{ PaletteWindowTextDisabled, QPalette::WindowText, QPalette::Disabled, true},
|
{PaletteWindowTextDisabled, QPalette::WindowText, QPalette::Disabled, true},
|
||||||
{ PaletteBase, QPalette::Base, QPalette::All, false},
|
{PaletteBase, QPalette::Base, QPalette::All, false},
|
||||||
{ PaletteBaseDisabled, QPalette::Base, QPalette::Disabled, false},
|
{PaletteBaseDisabled, QPalette::Base, QPalette::Disabled, false},
|
||||||
{ PaletteAlternateBase, QPalette::AlternateBase, QPalette::All, false},
|
{PaletteAlternateBase, QPalette::AlternateBase, QPalette::All, false},
|
||||||
{ PaletteAlternateBaseDisabled, QPalette::AlternateBase, QPalette::Disabled, false},
|
{PaletteAlternateBaseDisabled, QPalette::AlternateBase, QPalette::Disabled, false},
|
||||||
{ PaletteToolTipBase, QPalette::ToolTipBase, QPalette::All, true},
|
{PaletteToolTipBase, QPalette::ToolTipBase, QPalette::All, true},
|
||||||
{ PaletteToolTipBaseDisabled, QPalette::ToolTipBase, QPalette::Disabled, true},
|
{PaletteToolTipBaseDisabled, QPalette::ToolTipBase, QPalette::Disabled, true},
|
||||||
{ PaletteToolTipText, QPalette::ToolTipText, QPalette::All, false},
|
{PaletteToolTipText, QPalette::ToolTipText, QPalette::All, false},
|
||||||
{ PaletteToolTipTextDisabled, QPalette::ToolTipText, QPalette::Disabled, false},
|
{PaletteToolTipTextDisabled, QPalette::ToolTipText, QPalette::Disabled, false},
|
||||||
{ PaletteText, QPalette::Text, QPalette::All, true},
|
{PaletteText, QPalette::Text, QPalette::All, true},
|
||||||
{ PaletteTextDisabled, QPalette::Text, QPalette::Disabled, true},
|
{PaletteTextDisabled, QPalette::Text, QPalette::Disabled, true},
|
||||||
{ PaletteButton, QPalette::Button, QPalette::All, false},
|
{PaletteButton, QPalette::Button, QPalette::All, false},
|
||||||
{ PaletteButtonDisabled, QPalette::Button, QPalette::Disabled, false},
|
{PaletteButtonDisabled, QPalette::Button, QPalette::Disabled, false},
|
||||||
{ PaletteButtonText, QPalette::ButtonText, QPalette::All, true},
|
{PaletteButtonText, QPalette::ButtonText, QPalette::All, true},
|
||||||
{ PaletteButtonTextDisabled, QPalette::ButtonText, QPalette::Disabled, true},
|
{PaletteButtonTextDisabled, QPalette::ButtonText, QPalette::Disabled, true},
|
||||||
{ PaletteBrightText, QPalette::BrightText, QPalette::All, false},
|
{PaletteBrightText, QPalette::BrightText, QPalette::All, false},
|
||||||
{ PaletteBrightTextDisabled, QPalette::BrightText, QPalette::Disabled, false},
|
{PaletteBrightTextDisabled, QPalette::BrightText, QPalette::Disabled, false},
|
||||||
{ PaletteHighlight, QPalette::Highlight, QPalette::All, true},
|
{PaletteHighlight, QPalette::Highlight, QPalette::All, true},
|
||||||
{ PaletteHighlightDisabled, QPalette::Highlight, QPalette::Disabled, true},
|
{PaletteHighlightDisabled, QPalette::Highlight, QPalette::Disabled, true},
|
||||||
{ PaletteHighlightedText, QPalette::HighlightedText, QPalette::All, true},
|
{PaletteHighlightedText, QPalette::HighlightedText, QPalette::All, true},
|
||||||
{ PaletteHighlightedTextDisabled, QPalette::HighlightedText, QPalette::Disabled, true},
|
{PaletteHighlightedTextDisabled, QPalette::HighlightedText, QPalette::Disabled, true},
|
||||||
{ PaletteLink, QPalette::Link, QPalette::All, false},
|
{PaletteLink, QPalette::Link, QPalette::All, false},
|
||||||
{ PaletteLinkDisabled, QPalette::Link, QPalette::Disabled, false},
|
{PaletteLinkDisabled, QPalette::Link, QPalette::Disabled, false},
|
||||||
{ PaletteLinkVisited, QPalette::LinkVisited, QPalette::All, false},
|
{PaletteLinkVisited, QPalette::LinkVisited, QPalette::All, false},
|
||||||
{ PaletteLinkVisitedDisabled, QPalette::LinkVisited, QPalette::Disabled, false},
|
{PaletteLinkVisitedDisabled, QPalette::LinkVisited, QPalette::Disabled, false},
|
||||||
{ PaletteLight, QPalette::Light, QPalette::All, false},
|
{PaletteLight, QPalette::Light, QPalette::All, false},
|
||||||
{ PaletteLightDisabled, QPalette::Light, QPalette::Disabled, false},
|
{PaletteLightDisabled, QPalette::Light, QPalette::Disabled, false},
|
||||||
{ PaletteMidlight, QPalette::Midlight, QPalette::All, false},
|
{PaletteMidlight, QPalette::Midlight, QPalette::All, false},
|
||||||
{ PaletteMidlightDisabled, QPalette::Midlight, QPalette::Disabled, false},
|
{PaletteMidlightDisabled, QPalette::Midlight, QPalette::Disabled, false},
|
||||||
{ PaletteDark, QPalette::Dark, QPalette::All, false},
|
{PaletteDark, QPalette::Dark, QPalette::All, false},
|
||||||
{ PaletteDarkDisabled, QPalette::Dark, QPalette::Disabled, false},
|
{PaletteDarkDisabled, QPalette::Dark, QPalette::Disabled, false},
|
||||||
{ PaletteMid, QPalette::Mid, QPalette::All, false},
|
{PaletteMid, QPalette::Mid, QPalette::All, false},
|
||||||
{ PaletteMidDisabled, QPalette::Mid, QPalette::Disabled, false},
|
{PaletteMidDisabled, QPalette::Mid, QPalette::Disabled, false},
|
||||||
{ PaletteShadow, QPalette::Shadow, QPalette::All, false},
|
{PaletteShadow, QPalette::Shadow, QPalette::All, false},
|
||||||
{ PaletteShadowDisabled, QPalette::Shadow, QPalette::Disabled, false}
|
{PaletteShadowDisabled, QPalette::Shadow, QPalette::Disabled, false}
|
||||||
};
|
};
|
||||||
|
|
||||||
for (auto entry: mapping) {
|
for (auto entry: mapping) {
|
||||||
|
|||||||
@@ -355,8 +355,8 @@ QAbstractItemModel *AndroidBuildApkStep::keystoreCertificates()
|
|||||||
|
|
||||||
CertificatesModel *model = nullptr;
|
CertificatesModel *model = nullptr;
|
||||||
QStringList params
|
QStringList params
|
||||||
= { QLatin1String("-list"), QLatin1String("-v"), QLatin1String("-keystore"),
|
= {QLatin1String("-list"), QLatin1String("-v"), QLatin1String("-keystore"),
|
||||||
m_keystorePath.toUserOutput(), QLatin1String("-storepass") };
|
m_keystorePath.toUserOutput(), QLatin1String("-storepass")};
|
||||||
|
|
||||||
params << m_keystorePasswd;
|
params << m_keystorePasswd;
|
||||||
params << QLatin1String("-J-Duser.language=en");
|
params << QLatin1String("-J-Duser.language=en");
|
||||||
|
|||||||
@@ -378,7 +378,7 @@ void AndroidConfig::updateAvailableSdkPlatforms() const
|
|||||||
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
|
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
|
||||||
SynchronousProcessResponse response
|
SynchronousProcessResponse response
|
||||||
= proc.runBlocking(androidToolPath().toString(),
|
= proc.runBlocking(androidToolPath().toString(),
|
||||||
QStringList({ "list", "target" })); // list available AVDs
|
QStringList({"list", "target"})); // list available AVDs
|
||||||
if (response.result != SynchronousProcessResponse::Finished)
|
if (response.result != SynchronousProcessResponse::Finished)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -668,7 +668,7 @@ bool AndroidConfig::removeAVD(const QString &name) const
|
|||||||
proc.setTimeoutS(5);
|
proc.setTimeoutS(5);
|
||||||
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
|
proc.setProcessEnvironment(androidToolEnvironment().toProcessEnvironment());
|
||||||
SynchronousProcessResponse response
|
SynchronousProcessResponse response
|
||||||
= proc.runBlocking(androidToolPath().toString(), QStringList({ "delete", "avd", "-n", name }));
|
= proc.runBlocking(androidToolPath().toString(), QStringList({"delete", "avd", "-n", name}));
|
||||||
return response.result == SynchronousProcessResponse::Finished && response.exitCode == 0;
|
return response.result == SynchronousProcessResponse::Finished && response.exitCode == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -684,7 +684,7 @@ QVector<AndroidDeviceInfo> AndroidConfig::androidVirtualDevices(const QString &a
|
|||||||
SynchronousProcess proc;
|
SynchronousProcess proc;
|
||||||
proc.setTimeoutS(20);
|
proc.setTimeoutS(20);
|
||||||
proc.setProcessEnvironment(environment.toProcessEnvironment());
|
proc.setProcessEnvironment(environment.toProcessEnvironment());
|
||||||
SynchronousProcessResponse response = proc.run(androidTool, { "list", "avd" }); // list available AVDs
|
SynchronousProcessResponse response = proc.run(androidTool, {"list", "avd"}); // list available AVDs
|
||||||
if (response.result != SynchronousProcessResponse::Finished)
|
if (response.result != SynchronousProcessResponse::Finished)
|
||||||
return devices;
|
return devices;
|
||||||
|
|
||||||
@@ -1350,7 +1350,7 @@ QStringList AndroidDeviceInfo::adbSelector(const QString &serialNumber)
|
|||||||
{
|
{
|
||||||
if (serialNumber.startsWith(QLatin1String("????")))
|
if (serialNumber.startsWith(QLatin1String("????")))
|
||||||
return QStringList("-d");
|
return QStringList("-d");
|
||||||
return QStringList({ "-s", serialNumber });
|
return QStringList({"-s", serialNumber});
|
||||||
}
|
}
|
||||||
|
|
||||||
const AndroidConfig &AndroidConfigurations::currentConfig()
|
const AndroidConfig &AndroidConfigurations::currentConfig()
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ QList<BuildStepInfo> AndroidDeployQtStepFactory::availableSteps(BuildStepList *p
|
|||||||
|| parent->contains(AndroidDeployQtStep::Id))
|
|| parent->contains(AndroidDeployQtStep::Id))
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return {{ AndroidDeployQtStep::Id, tr("Deploy to Android device or emulator") }};
|
return {{AndroidDeployQtStep::Id, tr("Deploy to Android device or emulator")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
ProjectExplorer::BuildStep *AndroidDeployQtStepFactory::create(ProjectExplorer::BuildStepList *parent, Core::Id id)
|
ProjectExplorer::BuildStep *AndroidDeployQtStepFactory::create(ProjectExplorer::BuildStepList *parent, Core::Id id)
|
||||||
|
|||||||
@@ -408,8 +408,8 @@ bool AndroidManager::checkKeystorePassword(const QString &keystorePath, const QS
|
|||||||
bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const QString &keystorePasswd, const QString &alias, const QString &certificatePasswd)
|
bool AndroidManager::checkCertificatePassword(const QString &keystorePath, const QString &keystorePasswd, const QString &alias, const QString &certificatePasswd)
|
||||||
{
|
{
|
||||||
// assumes that the keystore password is correct
|
// assumes that the keystore password is correct
|
||||||
QStringList arguments = { "-certreq", "-keystore", keystorePath,
|
QStringList arguments = {"-certreq", "-keystore", keystorePath,
|
||||||
"--storepass", keystorePasswd, "-alias", alias, "-keypass" };
|
"--storepass", keystorePasswd, "-alias", alias, "-keypass"};
|
||||||
if (certificatePasswd.isEmpty())
|
if (certificatePasswd.isEmpty())
|
||||||
arguments << keystorePasswd;
|
arguments << keystorePasswd;
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -977,8 +977,8 @@ void AndroidManifestEditorWidget::parseApplication(QXmlStreamReader &reader, QXm
|
|||||||
writer.writeStartElement(reader.name().toString());
|
writer.writeStartElement(reader.name().toString());
|
||||||
|
|
||||||
QXmlStreamAttributes attributes = reader.attributes();
|
QXmlStreamAttributes attributes = reader.attributes();
|
||||||
QStringList keys = { QLatin1String("android:label") };
|
QStringList keys = {QLatin1String("android:label")};
|
||||||
QStringList values = { m_appNameLineEdit->text() };
|
QStringList values = {m_appNameLineEdit->text()};
|
||||||
bool ensureIconAttribute = !m_lIconPath.isEmpty()
|
bool ensureIconAttribute = !m_lIconPath.isEmpty()
|
||||||
|| !m_mIconPath.isEmpty()
|
|| !m_mIconPath.isEmpty()
|
||||||
|| !m_hIconPath.isEmpty();
|
|| !m_hIconPath.isEmpty();
|
||||||
|
|||||||
@@ -140,5 +140,5 @@ QSet<Core::Id> AndroidQtVersion::availableFeatures() const
|
|||||||
|
|
||||||
QSet<Core::Id> AndroidQtVersion::targetDeviceTypes() const
|
QSet<Core::Id> AndroidQtVersion::targetDeviceTypes() const
|
||||||
{
|
{
|
||||||
return { Constants::ANDROID_DEVICE_TYPE };
|
return {Constants::ANDROID_DEVICE_TYPE};
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,9 +68,9 @@ void Android::Internal::AndroidSignalOperation::adbFindRunAsFinished(int exitCod
|
|||||||
this, &AndroidSignalOperation::adbKillFinished);
|
this, &AndroidSignalOperation::adbKillFinished);
|
||||||
m_state = Kill;
|
m_state = Kill;
|
||||||
m_timeout->start();
|
m_timeout->start();
|
||||||
m_adbProcess->start(m_adbPath, QStringList({ "shell", "run-as", runAs, "kill",
|
m_adbProcess->start(m_adbPath, QStringList({"shell", "run-as", runAs, "kill",
|
||||||
QString("-%1").arg(m_signal),
|
QString("-%1").arg(m_signal),
|
||||||
QString::number(m_pid) }));
|
QString::number(m_pid)}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -266,7 +266,7 @@ AndroidToolChainFactory::AndroidToolChainFactory()
|
|||||||
|
|
||||||
QSet<Core::Id> Android::Internal::AndroidToolChainFactory::supportedLanguages() const
|
QSet<Core::Id> Android::Internal::AndroidToolChainFactory::supportedLanguages() const
|
||||||
{
|
{
|
||||||
return { ProjectExplorer::Constants::CXX_LANGUAGE_ID };
|
return {ProjectExplorer::Constants::CXX_LANGUAGE_ID};
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<ToolChain *> AndroidToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
QList<ToolChain *> AndroidToolChainFactory::autoDetect(const QList<ToolChain *> &alreadyKnown)
|
||||||
@@ -303,8 +303,8 @@ QList<AndroidToolChainFactory::AndroidToolChainInformation> AndroidToolChainFact
|
|||||||
int idx = versionRegExp.indexIn(fileName);
|
int idx = versionRegExp.indexIn(fileName);
|
||||||
if (idx == -1)
|
if (idx == -1)
|
||||||
continue;
|
continue;
|
||||||
for (const Core::Id lang : { ProjectExplorer::Constants::CXX_LANGUAGE_ID,
|
for (const Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID,
|
||||||
ProjectExplorer::Constants::C_LANGUAGE_ID }) {
|
ProjectExplorer::Constants::C_LANGUAGE_ID}) {
|
||||||
AndroidToolChainInformation ati;
|
AndroidToolChainInformation ati;
|
||||||
ati.language = lang;
|
ati.language = lang;
|
||||||
ati.version = fileName.mid(idx + 1);
|
ati.version = fileName.mid(idx + 1);
|
||||||
@@ -401,7 +401,7 @@ AndroidToolChainFactory::autodetectToolChainsForNdk(const FileName &ndkPath,
|
|||||||
if (abi.architecture() == Abi::UnknownArchitecture) // e.g. mipsel which is not yet supported
|
if (abi.architecture() == Abi::UnknownArchitecture) // e.g. mipsel which is not yet supported
|
||||||
continue;
|
continue;
|
||||||
QList<AndroidToolChain *> toolChainBundle;
|
QList<AndroidToolChain *> toolChainBundle;
|
||||||
for (Core::Id lang : { ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID }) {
|
for (Core::Id lang : {ProjectExplorer::Constants::CXX_LANGUAGE_ID, ProjectExplorer::Constants::C_LANGUAGE_ID}) {
|
||||||
FileName compilerPath = AndroidConfigurations::currentConfig().gccPath(abi, lang, version);
|
FileName compilerPath = AndroidConfigurations::currentConfig().gccPath(abi, lang, version);
|
||||||
|
|
||||||
AndroidToolChain *tc = findToolChain(compilerPath, lang, alreadyKnown);
|
AndroidToolChain *tc = findToolChain(compilerPath, lang, alreadyKnown);
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ AvdDialog::AvdDialog(int minApiLevel, const QString &targetArch, const AndroidCo
|
|||||||
m_hideTipTimer.setSingleShot(true);
|
m_hideTipTimer.setSingleShot(true);
|
||||||
|
|
||||||
if (targetArch.isEmpty())
|
if (targetArch.isEmpty())
|
||||||
m_avdDialog.abiComboBox->addItems(QStringList({ "armeabi-v7a", "armeabi", "x86", "mips" }));
|
m_avdDialog.abiComboBox->addItems(QStringList({"armeabi-v7a", "armeabi", "x86", "mips"}));
|
||||||
else
|
else
|
||||||
m_avdDialog.abiComboBox->addItems(QStringList(targetArch));
|
m_avdDialog.abiComboBox->addItems(QStringList(targetArch));
|
||||||
|
|
||||||
|
|||||||
@@ -167,10 +167,10 @@ void AutoTestUnitTests::testCodeParserSwitchStartup_data()
|
|||||||
QTest::addColumn<QList<int> >("expectedUnnamedQuickTestsCount");
|
QTest::addColumn<QList<int> >("expectedUnnamedQuickTestsCount");
|
||||||
QTest::addColumn<QList<int> >("expectedDataTagsCount");
|
QTest::addColumn<QList<int> >("expectedDataTagsCount");
|
||||||
|
|
||||||
QStringList projects = QStringList({ m_tmpDir->path() + "/plain/plain.pro",
|
QStringList projects = QStringList({m_tmpDir->path() + "/plain/plain.pro",
|
||||||
m_tmpDir->path() + "/mixed_atp/mixed_atp.pro",
|
m_tmpDir->path() + "/mixed_atp/mixed_atp.pro",
|
||||||
m_tmpDir->path() + "/plain/plain.qbs",
|
m_tmpDir->path() + "/plain/plain.qbs",
|
||||||
m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs" });
|
m_tmpDir->path() + "/mixed_atp/mixed_atp.qbs"});
|
||||||
|
|
||||||
QList<int> expectedAutoTests = QList<int>() << 1 << 4 << 1 << 4;
|
QList<int> expectedAutoTests = QList<int>() << 1 << 4 << 1 << 4;
|
||||||
QList<int> expectedNamedQuickTests = QList<int>() << 0 << 5 << 0 << 5;
|
QList<int> expectedNamedQuickTests = QList<int>() << 0 << 5 << 0 << 5;
|
||||||
|
|||||||
@@ -311,8 +311,8 @@ TestTreeItem *GTestTreeItem::findChildByNameStateAndFile(const QString &name,
|
|||||||
|
|
||||||
QString GTestTreeItem::nameSuffix() const
|
QString GTestTreeItem::nameSuffix() const
|
||||||
{
|
{
|
||||||
static QString markups[] = { QCoreApplication::translate("GTestTreeItem", "parameterized"),
|
static QString markups[] = {QCoreApplication::translate("GTestTreeItem", "parameterized"),
|
||||||
QCoreApplication::translate("GTestTreeItem", "typed") };
|
QCoreApplication::translate("GTestTreeItem", "typed")};
|
||||||
QString suffix;
|
QString suffix;
|
||||||
if (m_state & Parameterized)
|
if (m_state & Parameterized)
|
||||||
suffix = QString(" [") + markups[0];
|
suffix = QString(" [") + markups[0];
|
||||||
|
|||||||
@@ -135,12 +135,12 @@ QtTestOutputReader::QtTestOutputReader(const QFutureInterface<TestResultPtr> &fu
|
|||||||
|
|
||||||
void QtTestOutputReader::processOutput(const QByteArray &outputLine)
|
void QtTestOutputReader::processOutput(const QByteArray &outputLine)
|
||||||
{
|
{
|
||||||
static QStringList validEndTags = { QStringLiteral("Incident"),
|
static QStringList validEndTags = {QStringLiteral("Incident"),
|
||||||
QStringLiteral("Message"),
|
QStringLiteral("Message"),
|
||||||
QStringLiteral("BenchmarkResult"),
|
QStringLiteral("BenchmarkResult"),
|
||||||
QStringLiteral("QtVersion"),
|
QStringLiteral("QtVersion"),
|
||||||
QStringLiteral("QtBuild"),
|
QStringLiteral("QtBuild"),
|
||||||
QStringLiteral("QTestVersion") };
|
QStringLiteral("QTestVersion")};
|
||||||
|
|
||||||
if (m_className.isEmpty() && outputLine.trimmed().isEmpty())
|
if (m_className.isEmpty() && outputLine.trimmed().isEmpty())
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ static bool includesQtTest(const CPlusPlus::Document::Ptr &doc, const CPlusPlus:
|
|||||||
{
|
{
|
||||||
static QStringList expectedHeaderPrefixes
|
static QStringList expectedHeaderPrefixes
|
||||||
= Utils::HostOsInfo::isMacHost()
|
= Utils::HostOsInfo::isMacHost()
|
||||||
? QStringList({ "QtTest.framework/Headers", "QtTest" }) : QStringList({ "QtTest" });
|
? QStringList({"QtTest.framework/Headers", "QtTest"}) : QStringList({"QtTest"});
|
||||||
|
|
||||||
const QList<CPlusPlus::Document::Include> includes = doc->resolvedIncludes();
|
const QList<CPlusPlus::Document::Include> includes = doc->resolvedIncludes();
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static QStringList specialFunctions({ "initTestCase", "cleanupTestCase", "init", "cleanup" });
|
static QStringList specialFunctions({"initTestCase", "cleanupTestCase", "init", "cleanup"});
|
||||||
|
|
||||||
/************************** Cpp Test Symbol Visitor ***************************/
|
/************************** Cpp Test Symbol Visitor ***************************/
|
||||||
|
|
||||||
|
|||||||
@@ -57,8 +57,8 @@ static bool includesQtQuickTest(const CPlusPlus::Document::Ptr &doc,
|
|||||||
{
|
{
|
||||||
static QStringList expectedHeaderPrefixes
|
static QStringList expectedHeaderPrefixes
|
||||||
= Utils::HostOsInfo::isMacHost()
|
= Utils::HostOsInfo::isMacHost()
|
||||||
? QStringList({ "QtQuickTest.framework/Headers", "QtQuickTest" })
|
? QStringList({"QtQuickTest.framework/Headers", "QtQuickTest"})
|
||||||
: QStringList({ "QtQuickTest" });
|
: QStringList({"QtQuickTest"});
|
||||||
|
|
||||||
const QList<CPlusPlus::Document::Include> includes = doc->resolvedIncludes();
|
const QList<CPlusPlus::Document::Include> includes = doc->resolvedIncludes();
|
||||||
|
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
namespace Autotest {
|
namespace Autotest {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
|
||||||
static QStringList specialFunctions({ "initTestCase", "cleanupTestCase", "init", "cleanup" });
|
static QStringList specialFunctions({"initTestCase", "cleanupTestCase", "init", "cleanup"});
|
||||||
|
|
||||||
TestQmlVisitor::TestQmlVisitor(QmlJS::Document::Ptr doc)
|
TestQmlVisitor::TestQmlVisitor(QmlJS::Document::Ptr doc)
|
||||||
: m_currentDoc(doc)
|
: m_currentDoc(doc)
|
||||||
|
|||||||
@@ -317,7 +317,7 @@ void TestNavigationWidget::onRunThisTestTriggered(TestRunner::Mode runMode)
|
|||||||
|
|
||||||
if (configuration) {
|
if (configuration) {
|
||||||
TestRunner *runner = TestRunner::instance();
|
TestRunner *runner = TestRunner::instance();
|
||||||
runner->setSelectedTests( {configuration} );
|
runner->setSelectedTests({configuration});
|
||||||
runner->prepareToRunTests(runMode);
|
runner->prepareToRunTests(runMode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -229,7 +229,7 @@ QWidget *TestResultsPane::outputWidget(QWidget *parent)
|
|||||||
|
|
||||||
QList<QWidget *> TestResultsPane::toolBarWidgets() const
|
QList<QWidget *> TestResultsPane::toolBarWidgets() const
|
||||||
{
|
{
|
||||||
return { m_expandCollapse, m_runAll, m_runSelected, m_stopTestRun, m_filterButton };
|
return {m_expandCollapse, m_runAll, m_runSelected, m_stopTestRun, m_filterButton};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString TestResultsPane::displayName() const
|
QString TestResultsPane::displayName() const
|
||||||
|
|||||||
@@ -63,7 +63,7 @@ QList<BuildStepInfo> AutogenStepFactory::availableSteps(BuildStepList *parent) c
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
QString display = tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.");
|
QString display = tr("Autogen", "Display name for AutotoolsProjectManager::AutogenStep id.");
|
||||||
return {{ AUTOGEN_STEP_ID, display }};
|
return {{AUTOGEN_STEP_ID, display}};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AutogenStepFactory::create(BuildStepList *parent, Core::Id id)
|
BuildStep *AutogenStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
|
|||||||
@@ -62,7 +62,7 @@ QList<BuildStepInfo> AutoreconfStepFactory::availableSteps(BuildStepList *parent
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
QString display = tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.");
|
QString display = tr("Autoreconf", "Display name for AutotoolsProjectManager::AutoreconfStep id.");
|
||||||
return {{ AUTORECONF_STEP_ID, display }};
|
return {{AUTORECONF_STEP_ID, display}};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *AutoreconfStepFactory::create(BuildStepList *parent, Core::Id id)
|
BuildStep *AutoreconfStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ QList<BuildStepInfo> ConfigureStepFactory::availableSteps(BuildStepList *parent)
|
|||||||
return {};
|
return {};
|
||||||
|
|
||||||
QString display = tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.");
|
QString display = tr("Configure", "Display name for AutotoolsProjectManager::ConfigureStep id.");
|
||||||
return {{ CONFIGURE_STEP_ID, display }};
|
return {{CONFIGURE_STEP_ID, display}};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *ConfigureStepFactory::create(BuildStepList *parent, Core::Id id)
|
BuildStep *ConfigureStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
|
|||||||
@@ -400,7 +400,7 @@ QStringList MakefileParser::targetValues(bool *hasVariables)
|
|||||||
|
|
||||||
void MakefileParser::appendHeader(QStringList &list, const QDir &dir, const QString &fileName)
|
void MakefileParser::appendHeader(QStringList &list, const QDir &dir, const QString &fileName)
|
||||||
{
|
{
|
||||||
const char *const headerExtensions[] = { ".h", ".hh", ".hg", ".hxx", ".hpp", 0 };
|
const char *const headerExtensions[] = {".h", ".hh", ".hg", ".hxx", ".hpp", 0};
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (headerExtensions[i] != 0) {
|
while (headerExtensions[i] != 0) {
|
||||||
const QString headerFile = fileName + QLatin1String(headerExtensions[i]);
|
const QString headerFile = fileName + QLatin1String(headerExtensions[i]);
|
||||||
|
|||||||
@@ -67,7 +67,7 @@ QList<BuildStepInfo> MakeStepFactory::availableSteps(BuildStepList *parent) cons
|
|||||||
if (parent->target()->project()->id() != AUTOTOOLS_PROJECT_ID)
|
if (parent->target()->project()->id() != AUTOTOOLS_PROJECT_ID)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return {{ MAKE_STEP_ID, tr("Make", "Display name for AutotoolsProjectManager::MakeStep id.") }};
|
return {{MAKE_STEP_ID, tr("Make", "Display name for AutotoolsProjectManager::MakeStep id.")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
|
BuildStep *MakeStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
|
|||||||
@@ -155,11 +155,11 @@ bool GdbServerProvider::operator==(const GdbServerProvider &other) const
|
|||||||
QVariantMap GdbServerProvider::toMap() const
|
QVariantMap GdbServerProvider::toMap() const
|
||||||
{
|
{
|
||||||
return {
|
return {
|
||||||
{ QLatin1String(idKeyC), m_id },
|
{QLatin1String(idKeyC), m_id},
|
||||||
{ QLatin1String(displayNameKeyC), m_displayName },
|
{QLatin1String(displayNameKeyC), m_displayName},
|
||||||
{ QLatin1String(startupModeKeyC), m_startupMode },
|
{QLatin1String(startupModeKeyC), m_startupMode},
|
||||||
{ QLatin1String(initCommandsKeyC), m_initCommands },
|
{QLatin1String(initCommandsKeyC), m_initCommands},
|
||||||
{ QLatin1String(resetCommandsKeyC), m_resetCommands }
|
{QLatin1String(resetCommandsKeyC), m_resetCommands}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,9 +59,9 @@ static GdbServerProviderManager *m_instance = 0;
|
|||||||
GdbServerProviderManager::GdbServerProviderManager(QObject *parent)
|
GdbServerProviderManager::GdbServerProviderManager(QObject *parent)
|
||||||
: QObject(parent)
|
: QObject(parent)
|
||||||
, m_configFile(settingsFileName(QLatin1String(fileNameKeyC)))
|
, m_configFile(settingsFileName(QLatin1String(fileNameKeyC)))
|
||||||
, m_factories({ new DefaultGdbServerProviderFactory,
|
, m_factories({new DefaultGdbServerProviderFactory,
|
||||||
new OpenOcdGdbServerProviderFactory,
|
new OpenOcdGdbServerProviderFactory,
|
||||||
new StLinkUtilGdbServerProviderFactory })
|
new StLinkUtilGdbServerProviderFactory})
|
||||||
{
|
{
|
||||||
m_writer = new Utils::PersistentSettingsWriter(
|
m_writer = new Utils::PersistentSettingsWriter(
|
||||||
m_configFile, QLatin1String("QtCreatorGdbServerProviders"));
|
m_configFile, QLatin1String("QtCreatorGdbServerProviders"));
|
||||||
|
|||||||
@@ -817,7 +817,7 @@ void BinEditorWidget::paintEvent(QPaintEvent *e)
|
|||||||
|
|
||||||
QString itemString(m_bytesPerLine*3, QLatin1Char(' '));
|
QString itemString(m_bytesPerLine*3, QLatin1Char(' '));
|
||||||
QChar *itemStringData = itemString.data();
|
QChar *itemStringData = itemString.data();
|
||||||
char changedString[160] = { false };
|
char changedString[160] = {false};
|
||||||
QTC_ASSERT((size_t)m_bytesPerLine < sizeof(changedString), return);
|
QTC_ASSERT((size_t)m_bytesPerLine < sizeof(changedString), return);
|
||||||
const char *hex = "0123456789abcdef";
|
const char *hex = "0123456789abcdef";
|
||||||
|
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ bool isWarningOrNote(ClangBackEnd::DiagnosticSeverity severity)
|
|||||||
bool isBlackListedDiagnostic(const ClangBackEnd::DiagnosticContainer &diagnostic,
|
bool isBlackListedDiagnostic(const ClangBackEnd::DiagnosticContainer &diagnostic,
|
||||||
bool isHeaderFile)
|
bool isHeaderFile)
|
||||||
{
|
{
|
||||||
static const Utf8StringVector blackList {
|
static const Utf8StringVector blackList{
|
||||||
Utf8StringLiteral("warning: #pragma once in main file"),
|
Utf8StringLiteral("warning: #pragma once in main file"),
|
||||||
Utf8StringLiteral("warning: #include_next in primary source file")
|
Utf8StringLiteral("warning: #include_next in primary source file")
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ private:
|
|||||||
ClangStaticAnalyzerDiagnosticModel::ClangStaticAnalyzerDiagnosticModel(QObject *parent)
|
ClangStaticAnalyzerDiagnosticModel::ClangStaticAnalyzerDiagnosticModel(QObject *parent)
|
||||||
: Utils::TreeModel<>(parent)
|
: Utils::TreeModel<>(parent)
|
||||||
{
|
{
|
||||||
setHeader({ tr("Issue"), tr("Location") });
|
setHeader({tr("Issue"), tr("Location")});
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClangStaticAnalyzerDiagnosticModel::addDiagnostics(const QList<Diagnostic> &diagnostics)
|
void ClangStaticAnalyzerDiagnosticModel::addDiagnostics(const QList<Diagnostic> &diagnostics)
|
||||||
|
|||||||
@@ -140,7 +140,7 @@ ClangStaticAnalyzerTool::ClangStaticAnalyzerTool(QObject *parent)
|
|||||||
|
|
||||||
Debugger::registerPerspective(ClangStaticAnalyzerPerspectiveId, new Perspective(
|
Debugger::registerPerspective(ClangStaticAnalyzerPerspectiveId, new Perspective(
|
||||||
tr("Clang Static Analyzer"),
|
tr("Clang Static Analyzer"),
|
||||||
{{ ClangStaticAnalyzerDockId, m_diagnosticView, {}, Perspective::SplitVertical }}
|
{{ClangStaticAnalyzerDockId, m_diagnosticView, {}, Perspective::SplitVertical}}
|
||||||
));
|
));
|
||||||
|
|
||||||
ActionDescription desc;
|
ActionDescription desc;
|
||||||
|
|||||||
@@ -1795,7 +1795,7 @@ static QString baseName(const QString &fileName)
|
|||||||
bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName)
|
bool ClearCasePlugin::vcsAdd(const QString &workingDir, const QString &fileName)
|
||||||
{
|
{
|
||||||
return ccFileOp(workingDir, tr("ClearCase Add File %1").arg(baseName(fileName)),
|
return ccFileOp(workingDir, tr("ClearCase Add File %1").arg(baseName(fileName)),
|
||||||
QStringList({ "mkelem", "-ci" }), fileName);
|
QStringList({"mkelem", "-ci"}), fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName)
|
bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileName)
|
||||||
@@ -1806,7 +1806,7 @@ bool ClearCasePlugin::vcsDelete(const QString &workingDir, const QString &fileNa
|
|||||||
return true;
|
return true;
|
||||||
|
|
||||||
return ccFileOp(workingDir, tr("ClearCase Remove File %1").arg(baseName(fileName)),
|
return ccFileOp(workingDir, tr("ClearCase Remove File %1").arg(baseName(fileName)),
|
||||||
QStringList({ "rmname", "-force" }), fileName);
|
QStringList({"rmname", "-force"}), fileName);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ClearCasePlugin::vcsMove(const QString &workingDir, const QString &from, const QString &to)
|
bool ClearCasePlugin::vcsMove(const QString &workingDir, const QString &from, const QString &to)
|
||||||
|
|||||||
@@ -156,7 +156,7 @@ void BuildDirManager::maybeForceReparseOnceReaderReady()
|
|||||||
const QByteArray CMAKE_CXX_COMPILER_KEY = "CMAKE_CXX_COMPILER";
|
const QByteArray CMAKE_CXX_COMPILER_KEY = "CMAKE_CXX_COMPILER";
|
||||||
|
|
||||||
const QByteArrayList criticalKeys
|
const QByteArrayList criticalKeys
|
||||||
= { GENERATOR_KEY, CMAKE_COMMAND_KEY, CMAKE_C_COMPILER_KEY, CMAKE_CXX_COMPILER_KEY };
|
= {GENERATOR_KEY, CMAKE_COMMAND_KEY, CMAKE_C_COMPILER_KEY, CMAKE_CXX_COMPILER_KEY};
|
||||||
|
|
||||||
const CMakeConfig currentConfig = parsedConfiguration();
|
const CMakeConfig currentConfig = parsedConfiguration();
|
||||||
|
|
||||||
|
|||||||
@@ -598,22 +598,22 @@ CMakeBuildInfo *CMakeBuildConfigurationFactory::createBuildInfo(const ProjectExp
|
|||||||
info->typeName = tr("Build");
|
info->typeName = tr("Build");
|
||||||
break;
|
break;
|
||||||
case BuildTypeDebug:
|
case BuildTypeDebug:
|
||||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "Debug") };
|
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Debug")};
|
||||||
info->typeName = tr("Debug");
|
info->typeName = tr("Debug");
|
||||||
info->buildType = BuildConfiguration::Debug;
|
info->buildType = BuildConfiguration::Debug;
|
||||||
break;
|
break;
|
||||||
case BuildTypeRelease:
|
case BuildTypeRelease:
|
||||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "Release") };
|
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "Release")};
|
||||||
info->typeName = tr("Release");
|
info->typeName = tr("Release");
|
||||||
info->buildType = BuildConfiguration::Release;
|
info->buildType = BuildConfiguration::Release;
|
||||||
break;
|
break;
|
||||||
case BuildTypeMinSizeRel:
|
case BuildTypeMinSizeRel:
|
||||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "MinSizeRel") };
|
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "MinSizeRel")};
|
||||||
info->typeName = tr("Minimum Size Release");
|
info->typeName = tr("Minimum Size Release");
|
||||||
info->buildType = BuildConfiguration::Release;
|
info->buildType = BuildConfiguration::Release;
|
||||||
break;
|
break;
|
||||||
case BuildTypeRelWithDebInfo:
|
case BuildTypeRelWithDebInfo:
|
||||||
buildTypeItem = { CMakeConfigItem("CMAKE_BUILD_TYPE", "RelWithDebInfo") };
|
buildTypeItem = {CMakeConfigItem("CMAKE_BUILD_TYPE", "RelWithDebInfo")};
|
||||||
info->typeName = tr("Release with Debug Information");
|
info->typeName = tr("Release with Debug Information");
|
||||||
info->buildType = BuildConfiguration::Profile;
|
info->buildType = BuildConfiguration::Profile;
|
||||||
break;
|
break;
|
||||||
|
|||||||
@@ -526,8 +526,8 @@ QList<BuildStepInfo> CMakeBuildStepFactory::availableSteps(BuildStepList *parent
|
|||||||
if (parent->target()->project()->id() != Constants::CMAKEPROJECT_ID)
|
if (parent->target()->project()->id() != Constants::CMAKEPROJECT_ID)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return {{ Constants::CMAKE_BUILD_STEP_ID,
|
return {{Constants::CMAKE_BUILD_STEP_ID,
|
||||||
tr("Build", "Display name for CMakeProjectManager::CMakeBuildStep id.") }};
|
tr("Build", "Display name for CMakeProjectManager::CMakeBuildStep id.")}};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *CMakeBuildStepFactory::create(BuildStepList *parent, Core::Id id)
|
BuildStep *CMakeBuildStepFactory::create(BuildStepList *parent, Core::Id id)
|
||||||
|
|||||||
@@ -47,7 +47,7 @@ namespace Internal {
|
|||||||
namespace {
|
namespace {
|
||||||
int distance(const FileName &targetDirectory, const FileName &fileName)
|
int distance(const FileName &targetDirectory, const FileName &fileName)
|
||||||
{
|
{
|
||||||
const QString commonParent = commonPath(QStringList({ targetDirectory.toString(), fileName.toString() }));
|
const QString commonParent = commonPath(QStringList({targetDirectory.toString(), fileName.toString()}));
|
||||||
return targetDirectory.toString().mid(commonParent.size()).count('/')
|
return targetDirectory.toString().mid(commonParent.size()).count('/')
|
||||||
+ fileName.toString().mid(commonParent.size()).count('/');
|
+ fileName.toString().mid(commonParent.size()).count('/');
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ CMakeConfigItem::CMakeConfigItem() = default;
|
|||||||
CMakeConfigItem::CMakeConfigItem(const CMakeConfigItem &other) :
|
CMakeConfigItem::CMakeConfigItem(const CMakeConfigItem &other) :
|
||||||
key(other.key), type(other.type), isAdvanced(other.isAdvanced),
|
key(other.key), type(other.type), isAdvanced(other.isAdvanced),
|
||||||
value(other.value), documentation(other.documentation), values(other.values)
|
value(other.value), documentation(other.documentation), values(other.values)
|
||||||
{ }
|
{}
|
||||||
|
|
||||||
CMakeConfigItem::CMakeConfigItem(const QByteArray &k, Type t,
|
CMakeConfigItem::CMakeConfigItem(const QByteArray &k, Type t,
|
||||||
const QByteArray &d, const QByteArray &v) :
|
const QByteArray &d, const QByteArray &v) :
|
||||||
@@ -372,34 +372,34 @@ void CMakeProjectPlugin::testCMakeSplitValue_data()
|
|||||||
<< "" << true << QStringList();
|
<< "" << true << QStringList();
|
||||||
|
|
||||||
QTest::newRow("single path")
|
QTest::newRow("single path")
|
||||||
<< "C:/something" << false << QStringList({ "C:/something" });
|
<< "C:/something" << false << QStringList({"C:/something"});
|
||||||
QTest::newRow("single path, keep empty")
|
QTest::newRow("single path, keep empty")
|
||||||
<< "C:/something" << true << QStringList({ "C:/something" });
|
<< "C:/something" << true << QStringList({"C:/something"});
|
||||||
|
|
||||||
QTest::newRow(";single path")
|
QTest::newRow(";single path")
|
||||||
<< ";C:/something" << false << QStringList({ "C:/something" });
|
<< ";C:/something" << false << QStringList({"C:/something"});
|
||||||
QTest::newRow(";single path, keep empty")
|
QTest::newRow(";single path, keep empty")
|
||||||
<< ";C:/something" << true << QStringList({ "", "C:/something" });
|
<< ";C:/something" << true << QStringList({"", "C:/something"});
|
||||||
|
|
||||||
QTest::newRow("single path;")
|
QTest::newRow("single path;")
|
||||||
<< "C:/something;" << false << QStringList({ "C:/something" });
|
<< "C:/something;" << false << QStringList({"C:/something"});
|
||||||
QTest::newRow("single path;, keep empty")
|
QTest::newRow("single path;, keep empty")
|
||||||
<< "C:/something;" << true << QStringList({ "C:/something", "" });
|
<< "C:/something;" << true << QStringList({"C:/something", ""});
|
||||||
|
|
||||||
QTest::newRow("single path\\;")
|
QTest::newRow("single path\\;")
|
||||||
<< "C:/something\\;" << false << QStringList({ "C:/something;" });
|
<< "C:/something\\;" << false << QStringList({"C:/something;"});
|
||||||
QTest::newRow("single path\\;, keep empty")
|
QTest::newRow("single path\\;, keep empty")
|
||||||
<< "C:/something\\;" << true << QStringList({ "C:/something;" });
|
<< "C:/something\\;" << true << QStringList({"C:/something;"});
|
||||||
|
|
||||||
QTest::newRow("single path\\;;second path")
|
QTest::newRow("single path\\;;second path")
|
||||||
<< "C:/something\\;;/second/path" << false << QStringList({ "C:/something;", "/second/path" });
|
<< "C:/something\\;;/second/path" << false << QStringList({"C:/something;", "/second/path"});
|
||||||
QTest::newRow("single path\\;;second path, keep empty")
|
QTest::newRow("single path\\;;second path, keep empty")
|
||||||
<< "C:/something\\;;/second/path" << true << QStringList({ "C:/something;", "/second/path" });
|
<< "C:/something\\;;/second/path" << true << QStringList({"C:/something;", "/second/path"});
|
||||||
|
|
||||||
QTest::newRow("single path;;second path")
|
QTest::newRow("single path;;second path")
|
||||||
<< "C:/something;;/second/path" << false << QStringList({ "C:/something", "/second/path" });
|
<< "C:/something;;/second/path" << false << QStringList({"C:/something", "/second/path"});
|
||||||
QTest::newRow("single path;;second path, keep empty")
|
QTest::newRow("single path;;second path, keep empty")
|
||||||
<< "C:/something;;/second/path" << true << QStringList({ "C:/something", "", "/second/path" });
|
<< "C:/something;;/second/path" << true << QStringList({"C:/something", "", "/second/path"});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeProjectPlugin::testCMakeSplitValue()
|
void CMakeProjectPlugin::testCMakeSplitValue()
|
||||||
|
|||||||
@@ -267,7 +267,7 @@ void CMakeGeneratorKitInformation::set(Kit *k,
|
|||||||
const QString &generator, const QString &extraGenerator,
|
const QString &generator, const QString &extraGenerator,
|
||||||
const QString &platform, const QString &toolset)
|
const QString &platform, const QString &toolset)
|
||||||
{
|
{
|
||||||
GeneratorInfo info = { generator, extraGenerator, platform, toolset };
|
GeneratorInfo info = {generator, extraGenerator, platform, toolset};
|
||||||
setGeneratorInfo(k, info);
|
setGeneratorInfo(k, info);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -311,7 +311,7 @@ QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const
|
|||||||
k->addToEnvironment(env);
|
k->addToEnvironment(env);
|
||||||
const Utils::FileName ninjaExec = env.searchInPath(QLatin1String("ninja"));
|
const Utils::FileName ninjaExec = env.searchInPath(QLatin1String("ninja"));
|
||||||
if (!ninjaExec.isEmpty())
|
if (!ninjaExec.isEmpty())
|
||||||
return GeneratorInfo({ QString("Ninja"), extraGenerator, QString(), QString() }).toVariant();
|
return GeneratorInfo({QString("Ninja"), extraGenerator, QString(), QString()}).toVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Utils::HostOsInfo::isWindowsHost()) {
|
if (Utils::HostOsInfo::isWindowsHost()) {
|
||||||
@@ -341,7 +341,7 @@ QVariant CMakeGeneratorKitInformation::defaultValue(const Kit *k) const
|
|||||||
if (it == known.constEnd())
|
if (it == known.constEnd())
|
||||||
return QVariant();
|
return QVariant();
|
||||||
|
|
||||||
return GeneratorInfo({ it->name, extraGenerator, QString(), QString() }).toVariant();
|
return GeneratorInfo({it->name, extraGenerator, QString(), QString()}).toVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<Task> CMakeGeneratorKitInformation::validate(const Kit *k) const
|
QList<Task> CMakeGeneratorKitInformation::validate(const Kit *k) const
|
||||||
@@ -407,9 +407,9 @@ void CMakeGeneratorKitInformation::fix(Kit *k)
|
|||||||
dv.fromVariant(defaultValue(k));
|
dv.fromVariant(defaultValue(k));
|
||||||
setGeneratorInfo(k, dv);
|
setGeneratorInfo(k, dv);
|
||||||
} else {
|
} else {
|
||||||
const GeneratorInfo dv = { info.generator, info.extraGenerator,
|
const GeneratorInfo dv = {info.generator, info.extraGenerator,
|
||||||
it->supportsPlatform ? info.platform : QString(),
|
it->supportsPlatform ? info.platform : QString(),
|
||||||
it->supportsToolset ? info.toolset : QString() };
|
it->supportsToolset ? info.toolset : QString()};
|
||||||
setGeneratorInfo(k, dv);
|
setGeneratorInfo(k, dv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -456,8 +456,8 @@ QStringList CMakeProject::filesGeneratedFrom(const QString &sourceFile) const
|
|||||||
} else if (fi.suffix() == "scxml") {
|
} else if (fi.suffix() == "scxml") {
|
||||||
generatedFilePath += "/";
|
generatedFilePath += "/";
|
||||||
generatedFilePath += QDir::cleanPath(fi.completeBaseName());
|
generatedFilePath += QDir::cleanPath(fi.completeBaseName());
|
||||||
return QStringList({ generatedFilePath + ".h",
|
return QStringList({generatedFilePath + ".h",
|
||||||
generatedFilePath + ".cpp" });
|
generatedFilePath + ".cpp"});
|
||||||
} else {
|
} else {
|
||||||
// TODO: Other types will be added when adapters for their compilers become available.
|
// TODO: Other types will be added when adapters for their compilers become available.
|
||||||
return QStringList();
|
return QStringList();
|
||||||
|
|||||||
@@ -226,7 +226,7 @@ QVector<CMakeToolChainData> extractToolChainsFromCache(const CMakeConfig &config
|
|||||||
if (!i.key.startsWith("CMAKE_") || !i.key.endsWith("_COMPILER"))
|
if (!i.key.startsWith("CMAKE_") || !i.key.endsWith("_COMPILER"))
|
||||||
continue;
|
continue;
|
||||||
const QByteArray language = i.key.mid(6, i.key.count() - 6 - 9); // skip "CMAKE_" and "_COMPILER"
|
const QByteArray language = i.key.mid(6, i.key.count() - 6 - 9); // skip "CMAKE_" and "_COMPILER"
|
||||||
result.append({ language, Utils::FileName::fromUtf8(i.value) });
|
result.append({language, Utils::FileName::fromUtf8(i.value)});
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -278,7 +278,7 @@ QList<void *> CMakeProjectImporter::examineDirectory(const Utils::FileName &impo
|
|||||||
data->toolChains = extractToolChainsFromCache(config);
|
data->toolChains = extractToolChainsFromCache(config);
|
||||||
|
|
||||||
qCInfo(cmInputLog()) << "Offering to import" << importPath.toUserOutput();
|
qCInfo(cmInputLog()) << "Offering to import" << importPath.toUserOutput();
|
||||||
return { static_cast<void *>(data.release()) };
|
return {static_cast<void *>(data.release())};
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
|
bool CMakeProjectImporter::matchKit(void *directoryData, const Kit *k) const
|
||||||
@@ -442,7 +442,7 @@ void CMakeProjectPlugin::testCMakeProjectImporterQt_data()
|
|||||||
<< QStringList() << QString();
|
<< QStringList() << QString();
|
||||||
|
|
||||||
QTest::newRow("Qt4")
|
QTest::newRow("Qt4")
|
||||||
<< QStringList({ QString::fromLatin1("QT_QMAKE_EXECUTABLE=/usr/bin/xxx/qmake") })
|
<< QStringList({QString::fromLatin1("QT_QMAKE_EXECUTABLE=/usr/bin/xxx/qmake")})
|
||||||
<< "/usr/bin/xxx/qmake";
|
<< "/usr/bin/xxx/qmake";
|
||||||
|
|
||||||
// Everything else will require Qt installations!
|
// Everything else will require Qt installations!
|
||||||
@@ -477,29 +477,29 @@ void CMakeProjectPlugin::testCMakeProjectImporterToolChain_data()
|
|||||||
QTest::newRow("Unrelated input")
|
QTest::newRow("Unrelated input")
|
||||||
<< QStringList("CMAKE_SOMETHING_ELSE=/tmp") << QByteArrayList() << QStringList();
|
<< QStringList("CMAKE_SOMETHING_ELSE=/tmp") << QByteArrayList() << QStringList();
|
||||||
QTest::newRow("CXX compiler")
|
QTest::newRow("CXX compiler")
|
||||||
<< QStringList({ "CMAKE_CXX_COMPILER=/usr/bin/g++" })
|
<< QStringList({"CMAKE_CXX_COMPILER=/usr/bin/g++"})
|
||||||
<< QByteArrayList({ "CXX" })
|
<< QByteArrayList({"CXX"})
|
||||||
<< QStringList({ "/usr/bin/g++" });
|
<< QStringList({"/usr/bin/g++"});
|
||||||
QTest::newRow("CXX compiler, C compiler")
|
QTest::newRow("CXX compiler, C compiler")
|
||||||
<< QStringList({ "CMAKE_CXX_COMPILER=/usr/bin/g++", "CMAKE_C_COMPILER=/usr/bin/clang" })
|
<< QStringList({"CMAKE_CXX_COMPILER=/usr/bin/g++", "CMAKE_C_COMPILER=/usr/bin/clang"})
|
||||||
<< QByteArrayList({ "CXX", "C" })
|
<< QByteArrayList({"CXX", "C"})
|
||||||
<< QStringList({ "/usr/bin/g++", "/usr/bin/clang" });
|
<< QStringList({"/usr/bin/g++", "/usr/bin/clang"});
|
||||||
QTest::newRow("CXX compiler, C compiler, strange compiler")
|
QTest::newRow("CXX compiler, C compiler, strange compiler")
|
||||||
<< QStringList({ "CMAKE_CXX_COMPILER=/usr/bin/g++",
|
<< QStringList({"CMAKE_CXX_COMPILER=/usr/bin/g++",
|
||||||
"CMAKE_C_COMPILER=/usr/bin/clang",
|
"CMAKE_C_COMPILER=/usr/bin/clang",
|
||||||
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler" })
|
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler"})
|
||||||
<< QByteArrayList({ "CXX", "C", "STRANGE_LANGUAGE" })
|
<< QByteArrayList({"CXX", "C", "STRANGE_LANGUAGE"})
|
||||||
<< QStringList({ "/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler" });
|
<< QStringList({"/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler"});
|
||||||
QTest::newRow("CXX compiler, C compiler, strange compiler (with junk)")
|
QTest::newRow("CXX compiler, C compiler, strange compiler (with junk)")
|
||||||
<< QStringList({ "FOO=test",
|
<< QStringList({"FOO=test",
|
||||||
"CMAKE_CXX_COMPILER=/usr/bin/g++",
|
"CMAKE_CXX_COMPILER=/usr/bin/g++",
|
||||||
"CMAKE_BUILD_TYPE=debug",
|
"CMAKE_BUILD_TYPE=debug",
|
||||||
"CMAKE_C_COMPILER=/usr/bin/clang",
|
"CMAKE_C_COMPILER=/usr/bin/clang",
|
||||||
"SOMETHING_COMPILER=/usr/bin/something",
|
"SOMETHING_COMPILER=/usr/bin/something",
|
||||||
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler",
|
"CMAKE_STRANGE_LANGUAGE_COMPILER=/tmp/strange/compiler",
|
||||||
"BAR=more test" })
|
"BAR=more test"})
|
||||||
<< QByteArrayList({ "CXX", "C", "STRANGE_LANGUAGE" })
|
<< QByteArrayList({"CXX", "C", "STRANGE_LANGUAGE"})
|
||||||
<< QStringList({ "/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler" });
|
<< QStringList({"/usr/bin/g++", "/usr/bin/clang", "/tmp/strange/compiler"});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMakeProjectPlugin::testCMakeProjectImporterToolChain()
|
void CMakeProjectPlugin::testCMakeProjectImporterToolChain()
|
||||||
|
|||||||
@@ -341,7 +341,7 @@ CMakeToolItemConfigWidget::CMakeToolItemConfigWidget(CMakeToolItemModel *model)
|
|||||||
m_binaryChooser->setExpectedKind(PathChooser::ExistingCommand);
|
m_binaryChooser->setExpectedKind(PathChooser::ExistingCommand);
|
||||||
m_binaryChooser->setMinimumWidth(400);
|
m_binaryChooser->setMinimumWidth(400);
|
||||||
m_binaryChooser->setHistoryCompleter(QLatin1String("Cmake.Command.History"));
|
m_binaryChooser->setHistoryCompleter(QLatin1String("Cmake.Command.History"));
|
||||||
m_binaryChooser->setCommandVersionArguments({ "--version" });
|
m_binaryChooser->setCommandVersionArguments({"--version"});
|
||||||
|
|
||||||
m_autoRunCheckBox = new QCheckBox;
|
m_autoRunCheckBox = new QCheckBox;
|
||||||
m_autoRunCheckBox->setText(tr("Autorun CMake"));
|
m_autoRunCheckBox->setText(tr("Autorun CMake"));
|
||||||
|
|||||||
@@ -172,19 +172,19 @@ TextEditor::Keywords CMakeTool::keywords()
|
|||||||
{
|
{
|
||||||
if (m_functions.isEmpty()) {
|
if (m_functions.isEmpty()) {
|
||||||
Utils::SynchronousProcessResponse response;
|
Utils::SynchronousProcessResponse response;
|
||||||
response = run({ "--help-command-list" });
|
response = run({"--help-command-list"});
|
||||||
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
||||||
m_functions = response.stdOut().split('\n');
|
m_functions = response.stdOut().split('\n');
|
||||||
|
|
||||||
response = run({ "--help-commands" });
|
response = run({"--help-commands"});
|
||||||
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
||||||
parseFunctionDetailsOutput(response.stdOut());
|
parseFunctionDetailsOutput(response.stdOut());
|
||||||
|
|
||||||
response = run({ "--help-property-list" });
|
response = run({"--help-property-list"});
|
||||||
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
if (response.result == Utils::SynchronousProcessResponse::Finished)
|
||||||
m_variables = parseVariableOutput(response.stdOut());
|
m_variables = parseVariableOutput(response.stdOut());
|
||||||
|
|
||||||
response = run({ "--help-variable-list" });
|
response = run({"--help-variable-list"});
|
||||||
if (response.result == Utils::SynchronousProcessResponse::Finished) {
|
if (response.result == Utils::SynchronousProcessResponse::Finished) {
|
||||||
m_variables.append(parseVariableOutput(response.stdOut()));
|
m_variables.append(parseVariableOutput(response.stdOut()));
|
||||||
m_variables = Utils::filteredUnique(m_variables);
|
m_variables = Utils::filteredUnique(m_variables);
|
||||||
@@ -354,7 +354,7 @@ QStringList CMakeTool::parseVariableOutput(const QString &output)
|
|||||||
|
|
||||||
void CMakeTool::fetchGeneratorsFromHelp() const
|
void CMakeTool::fetchGeneratorsFromHelp() const
|
||||||
{
|
{
|
||||||
Utils::SynchronousProcessResponse response = run({ "--help" });
|
Utils::SynchronousProcessResponse response = run({"--help"});
|
||||||
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -406,7 +406,7 @@ void CMakeTool::fetchGeneratorsFromHelp() const
|
|||||||
|
|
||||||
void CMakeTool::fetchVersionFromVersionOutput() const
|
void CMakeTool::fetchVersionFromVersionOutput() const
|
||||||
{
|
{
|
||||||
Utils::SynchronousProcessResponse response = run({ "--version" });
|
Utils::SynchronousProcessResponse response = run({"--version" });
|
||||||
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -427,7 +427,7 @@ void CMakeTool::fetchVersionFromVersionOutput() const
|
|||||||
|
|
||||||
void CMakeTool::fetchFromCapabilities() const
|
void CMakeTool::fetchFromCapabilities() const
|
||||||
{
|
{
|
||||||
Utils::SynchronousProcessResponse response = run({ "-E", "capabilities" }, true);
|
Utils::SynchronousProcessResponse response = run({"-E", "capabilities" }, true);
|
||||||
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
if (response.result != Utils::SynchronousProcessResponse::Finished)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ ServerMode::ServerMode(const Environment &env,
|
|||||||
m_socketName = QString::fromLatin1("\\\\.\\pipe\\") + QUuid::createUuid().toString();
|
m_socketName = QString::fromLatin1("\\\\.\\pipe\\") + QUuid::createUuid().toString();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
const QStringList args = QStringList({ "-E", "server", "--pipe=" + m_socketName });
|
const QStringList args = QStringList({"-E", "server", "--pipe=" + m_socketName});
|
||||||
|
|
||||||
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
connect(m_cmakeProcess.get(), &QtcProcess::started, this, [this]() { m_connectionTimer.start(); });
|
||||||
connect(m_cmakeProcess.get(),
|
connect(m_cmakeProcess.get(),
|
||||||
@@ -168,7 +168,7 @@ void ServerMode::sendRequest(const QString &type, const QVariantMap &extra, cons
|
|||||||
data.insert(TYPE_KEY, type);
|
data.insert(TYPE_KEY, type);
|
||||||
const QVariant realCookie = cookie.isNull() ? QVariant(m_requestCounter) : cookie;
|
const QVariant realCookie = cookie.isNull() ? QVariant(m_requestCounter) : cookie;
|
||||||
data.insert(COOKIE_KEY, realCookie);
|
data.insert(COOKIE_KEY, realCookie);
|
||||||
m_expectedReplies.push_back({ type, realCookie });
|
m_expectedReplies.push_back({type, realCookie});
|
||||||
|
|
||||||
QJsonObject object = QJsonObject::fromVariantMap(data);
|
QJsonObject object = QJsonObject::fromVariantMap(data);
|
||||||
QJsonDocument document;
|
QJsonDocument document;
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ void CommandMappings::setPageTitle(const QString &s)
|
|||||||
|
|
||||||
void CommandMappings::setTargetHeader(const QString &s)
|
void CommandMappings::setTargetHeader(const QString &s)
|
||||||
{
|
{
|
||||||
d->commandList->setHeaderLabels({ tr("Command"), tr("Label"), s});
|
d->commandList->setHeaderLabels({tr("Command"), tr("Label"), s});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CommandMappings::filterChanged(const QString &f)
|
void CommandMappings::filterChanged(const QString &f)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ namespace Internal {
|
|||||||
|
|
||||||
ShortcutButton::ShortcutButton(QWidget *parent)
|
ShortcutButton::ShortcutButton(QWidget *parent)
|
||||||
: QPushButton(parent)
|
: QPushButton(parent)
|
||||||
, m_key({{ 0, 0, 0, 0 }})
|
, m_key({{0, 0, 0, 0}})
|
||||||
{
|
{
|
||||||
// Using ShortcutButton::tr() as workaround for QTBUG-34128
|
// Using ShortcutButton::tr() as workaround for QTBUG-34128
|
||||||
setToolTip(ShortcutButton::tr("Click and type the new key sequence."));
|
setToolTip(ShortcutButton::tr("Click and type the new key sequence."));
|
||||||
|
|||||||
@@ -116,7 +116,7 @@ static QVector<QString> splitInTwoLines(const QString &text, const QFontMetrics
|
|||||||
if (splitPos < 0) {
|
if (splitPos < 0) {
|
||||||
splitLines[0] = fontMetrics.elidedText(text, Qt::ElideRight,
|
splitLines[0] = fontMetrics.elidedText(text, Qt::ElideRight,
|
||||||
availableWidth);
|
availableWidth);
|
||||||
QString common = Utils::commonPrefix(QStringList({ splitLines[0], text }));
|
QString common = Utils::commonPrefix(QStringList({splitLines[0], text}));
|
||||||
splitLines[1] = text.mid(common.length());
|
splitLines[1] = text.mid(common.length());
|
||||||
// elide the second line even if it fits, since it is cut off in mid-word
|
// elide the second line even if it fits, since it is cut off in mid-word
|
||||||
while (fontMetrics.width(QChar(0x2026) /*'...'*/ + splitLines[1]) > availableWidth
|
while (fontMetrics.width(QChar(0x2026) /*'...'*/ + splitLines[1]) > availableWidth
|
||||||
|
|||||||
@@ -340,8 +340,8 @@ QWidget *SearchResultWindow::outputWidget(QWidget *)
|
|||||||
*/
|
*/
|
||||||
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
|
QList<QWidget*> SearchResultWindow::toolBarWidgets() const
|
||||||
{
|
{
|
||||||
return { d->m_expandCollapseButton, d->m_spacer,
|
return {d->m_expandCollapseButton, d->m_spacer,
|
||||||
d->m_historyLabel, d->m_spacer2, d->m_recentSearchesBox };
|
d->m_historyLabel, d->m_spacer2, d->m_recentSearchesBox};
|
||||||
}
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
|
|||||||
@@ -94,9 +94,9 @@ void Core::Internal::CorePlugin::test_basefilefilter_data()
|
|||||||
|
|
||||||
const QChar pathSeparator = QDir::separator();
|
const QChar pathSeparator = QDir::separator();
|
||||||
const MyTestDataDir testDir(QLatin1String("testdata_basic"));
|
const MyTestDataDir testDir(QLatin1String("testdata_basic"));
|
||||||
const QStringList testFiles({ QDir::fromNativeSeparators(testDir.file("file.cpp")),
|
const QStringList testFiles({QDir::fromNativeSeparators(testDir.file("file.cpp")),
|
||||||
QDir::fromNativeSeparators(testDir.file("main.cpp")),
|
QDir::fromNativeSeparators(testDir.file("main.cpp")),
|
||||||
QDir::fromNativeSeparators(testDir.file("subdir/main.cpp")) });
|
QDir::fromNativeSeparators(testDir.file("subdir/main.cpp"))});
|
||||||
QStringList testFilesShort;
|
QStringList testFilesShort;
|
||||||
foreach (const QString &file, testFiles)
|
foreach (const QString &file, testFiles)
|
||||||
testFilesShort << Utils::FileUtils::shortNativePath(Utils::FileName::fromString(file));
|
testFilesShort << Utils::FileUtils::shortNativePath(Utils::FileName::fromString(file));
|
||||||
|
|||||||
@@ -281,7 +281,7 @@ void LocatorSettingsPage::restoreFilterStates()
|
|||||||
|
|
||||||
void LocatorSettingsPage::initializeModel()
|
void LocatorSettingsPage::initializeModel()
|
||||||
{
|
{
|
||||||
m_model->setHeader(QStringList({ tr("Name"), tr("Prefix"), tr("Default") }));
|
m_model->setHeader(QStringList({tr("Name"), tr("Prefix"), tr("Default")}));
|
||||||
m_model->setHeaderToolTip(QStringList({
|
m_model->setHeaderToolTip(QStringList({
|
||||||
QString(),
|
QString(),
|
||||||
ILocatorFilter::msgPrefixToolTip(),
|
ILocatorFilter::msgPrefixToolTip(),
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ static void addThemesFromPath(const QString &path, QList<ThemeEntry> *themes)
|
|||||||
{
|
{
|
||||||
static const QLatin1String extension("*.creatortheme");
|
static const QLatin1String extension("*.creatortheme");
|
||||||
QDir themeDir(path);
|
QDir themeDir(path);
|
||||||
themeDir.setNameFilters({ extension });
|
themeDir.setNameFilters({extension});
|
||||||
themeDir.setFilter(QDir::Files);
|
themeDir.setFilter(QDir::Files);
|
||||||
const QStringList themeList = themeDir.entryList();
|
const QStringList themeList = themeDir.entryList();
|
||||||
foreach (const QString &fileName, themeList) {
|
foreach (const QString &fileName, themeList) {
|
||||||
|
|||||||
@@ -550,46 +550,46 @@ void CorePlugin::testVcsManager_data()
|
|||||||
QTest::addColumn<QStringList>("results");
|
QTest::addColumn<QStringList>("results");
|
||||||
|
|
||||||
QTest::newRow("A and B next to each other")
|
QTest::newRow("A and B next to each other")
|
||||||
<< QStringList({ "a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a" })
|
<< QStringList({"a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a"})
|
||||||
<< QStringList({ "b:b", "b/3:b", "b/4:b" })
|
<< QStringList({"b:b", "b/3:b", "b/4:b"})
|
||||||
<< QStringList({ ":::-", // empty directory to look up
|
<< QStringList({":::-", // empty directory to look up
|
||||||
"c:::*", // Neither in A nor B
|
"c:::*", // Neither in A nor B
|
||||||
"a:a:A:*", // in A
|
"a:a:A:*", // in A
|
||||||
"b:b:B:*", // in B
|
"b:b:B:*", // in B
|
||||||
"b/3:b:B:*", // in B
|
"b/3:b:B:*", // in B
|
||||||
"b/4:b:B:*", // in B
|
"b/4:b:B:*", // in B
|
||||||
"a/1:a:A:*", // in A
|
"a/1:a:A:*", // in A
|
||||||
"a/2:a:A:*", // in A
|
"a/2:a:A:*", // in A
|
||||||
":::-", // empty directory to look up
|
":::-", // empty directory to look up
|
||||||
"a/2/5/6:a:A:*", // in A
|
"a/2/5/6:a:A:*", // in A
|
||||||
"a/2/5:a:A:-", // in A (cached from before!)
|
"a/2/5:a:A:-", // in A (cached from before!)
|
||||||
// repeat: These need to come from the cache now:
|
// repeat: These need to come from the cache now:
|
||||||
"c:::-", // Neither in A nor B
|
"c:::-", // Neither in A nor B
|
||||||
"a:a:A:-", // in A
|
"a:a:A:-", // in A
|
||||||
"b:b:B:-", // in B
|
"b:b:B:-", // in B
|
||||||
"b/3:b:B:-", // in B
|
"b/3:b:B:-", // in B
|
||||||
"b/4:b:B:-", // in B
|
"b/4:b:B:-", // in B
|
||||||
"a/1:a:A:-", // in A
|
"a/1:a:A:-", // in A
|
||||||
"a/2:a:A:-", // in A
|
"a/2:a:A:-", // in A
|
||||||
"a/2/5/6:a:A:-", // in A
|
"a/2/5/6:a:A:-", // in A
|
||||||
"a/2/5:a:A:-" // in A
|
"a/2/5:a:A:-" // in A
|
||||||
});
|
});
|
||||||
QTest::newRow("B in A")
|
QTest::newRow("B in A")
|
||||||
<< QStringList({ "a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a" })
|
<< QStringList({"a:a", "a/1:a", "a/2:a", "a/2/5:a", "a/2/5/6:a"})
|
||||||
<< QStringList({ "a/1/b:a/1/b", "a/1/b/3:a/1/b", "a/1/b/4:a/1/b", "a/1/b/3/5:a/1/b",
|
<< QStringList({"a/1/b:a/1/b", "a/1/b/3:a/1/b", "a/1/b/4:a/1/b", "a/1/b/3/5:a/1/b",
|
||||||
"a/1/b/3/5/6:a/1/b" })
|
"a/1/b/3/5/6:a/1/b"})
|
||||||
<< QStringList({ "a:a:A:*", // in A
|
<< QStringList({"a:a:A:*", // in A
|
||||||
"c:::*", // Neither in A nor B
|
"c:::*", // Neither in A nor B
|
||||||
"a/3:::*", // Neither in A nor B
|
"a/3:::*", // Neither in A nor B
|
||||||
"a/1/b/x:::*", // Neither in A nor B
|
"a/1/b/x:::*", // Neither in A nor B
|
||||||
"a/1/b:a/1/b:B:*", // in B
|
"a/1/b:a/1/b:B:*", // in B
|
||||||
"a/1:a:A:*", // in A
|
"a/1:a:A:*", // in A
|
||||||
"a/1/b/../../2:a:A:*" // in A
|
"a/1/b/../../2:a:A:*" // in A
|
||||||
});
|
});
|
||||||
QTest::newRow("A and B") // first one wins...
|
QTest::newRow("A and B") // first one wins...
|
||||||
<< QStringList({ "a:a", "a/1:a", "a/2:a" })
|
<< QStringList({"a:a", "a/1:a", "a/2:a"})
|
||||||
<< QStringList({ "a:a", "a/1:a", "a/2:a" })
|
<< QStringList({"a:a", "a/1:a", "a/2:a"})
|
||||||
<< QStringList({ "a/2:a:A:*" });
|
<< QStringList({"a/2:a:A:*"});
|
||||||
}
|
}
|
||||||
|
|
||||||
void CorePlugin::testVcsManager()
|
void CorePlugin::testVcsManager()
|
||||||
|
|||||||
@@ -120,11 +120,11 @@ bool CodepasterPlugin::initialize(const QStringList &arguments, QString *errorMe
|
|||||||
addAutoReleasedObject(settingsPage);
|
addAutoReleasedObject(settingsPage);
|
||||||
|
|
||||||
// Create the protocols and append them to the Settings
|
// Create the protocols and append them to the Settings
|
||||||
Protocol *protos[] = { new PasteBinDotComProtocol,
|
Protocol *protos[] = {new PasteBinDotComProtocol,
|
||||||
new PasteBinDotCaProtocol,
|
new PasteBinDotCaProtocol,
|
||||||
new KdePasteProtocol,
|
new KdePasteProtocol,
|
||||||
new FileShareProtocol
|
new FileShareProtocol
|
||||||
};
|
};
|
||||||
const int count = sizeof(protos) / sizeof(Protocol *);
|
const int count = sizeof(protos) / sizeof(Protocol *);
|
||||||
for (int i = 0; i < count; ++i) {
|
for (int i = 0; i < count; ++i) {
|
||||||
connect(protos[i], &Protocol::pasteDone, this, &CodepasterPlugin::finishPost);
|
connect(protos[i], &Protocol::pasteDone, this, &CodepasterPlugin::finishPost);
|
||||||
|
|||||||
@@ -91,9 +91,9 @@ int main(int argc, char *argv[])
|
|||||||
{
|
{
|
||||||
QCoreApplication app(argc, argv);
|
QCoreApplication app(argc, argv);
|
||||||
|
|
||||||
const QStringList protocols = { KdePasteProtocol::protocolName().toLower(),
|
const QStringList protocols = {KdePasteProtocol::protocolName().toLower(),
|
||||||
PasteBinDotCaProtocol::protocolName().toLower(),
|
PasteBinDotCaProtocol::protocolName().toLower(),
|
||||||
PasteBinDotComProtocol::protocolName().toLower() };
|
PasteBinDotComProtocol::protocolName().toLower()};
|
||||||
ArgumentsCollector argsCollector(protocols);
|
ArgumentsCollector argsCollector(protocols);
|
||||||
QStringList arguments = QCoreApplication::arguments();
|
QStringList arguments = QCoreApplication::arguments();
|
||||||
arguments.removeFirst();
|
arguments.removeFirst();
|
||||||
|
|||||||
@@ -318,7 +318,7 @@ void DoxygenTest::testWithMacroFromHeaderBeforeFunction()
|
|||||||
|
|
||||||
const TestDocument headerDocumentDefiningMacro("header.h", "#define API\n");
|
const TestDocument headerDocumentDefiningMacro("header.h", "#define API\n");
|
||||||
|
|
||||||
runTest(given, expected, /*settings=*/ 0, { headerDocumentDefiningMacro });
|
runTest(given, expected, /*settings=*/ 0, {headerDocumentDefiningMacro});
|
||||||
}
|
}
|
||||||
|
|
||||||
void DoxygenTest::testNoLeadingAsterisks_data()
|
void DoxygenTest::testNoLeadingAsterisks_data()
|
||||||
|
|||||||
@@ -343,7 +343,7 @@ static QStringList languageFeatureMacros()
|
|||||||
// Collected with:
|
// Collected with:
|
||||||
// $ CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
|
// $ CALL "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\vcvarsall.bat" x86
|
||||||
// $ D:\usr\llvm-3.8.0\bin\clang++.exe -fms-compatibility-version=19 -std=c++1y -dM -E D:\empty.cpp | grep __cpp_
|
// $ D:\usr\llvm-3.8.0\bin\clang++.exe -fms-compatibility-version=19 -std=c++1y -dM -E D:\empty.cpp | grep __cpp_
|
||||||
static QStringList macros {
|
static QStringList macros{
|
||||||
QLatin1String("__cpp_aggregate_nsdmi"),
|
QLatin1String("__cpp_aggregate_nsdmi"),
|
||||||
QLatin1String("__cpp_alias_templates"),
|
QLatin1String("__cpp_alias_templates"),
|
||||||
QLatin1String("__cpp_attributes"),
|
QLatin1String("__cpp_attributes"),
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -43,13 +43,13 @@ namespace CppTools {
|
|||||||
CppCompletionAssistProcessor::CppCompletionAssistProcessor(int snippetItemOrder)
|
CppCompletionAssistProcessor::CppCompletionAssistProcessor(int snippetItemOrder)
|
||||||
: m_positionForProposal(-1)
|
: m_positionForProposal(-1)
|
||||||
, m_preprocessorCompletions(
|
, m_preprocessorCompletions(
|
||||||
QStringList({ "define", "error", "include", "line", "pragma", "pragma once",
|
QStringList({"define", "error", "include", "line", "pragma", "pragma once",
|
||||||
"pragma omp atomic", "pragma omp parallel", "pragma omp for",
|
"pragma omp atomic", "pragma omp parallel", "pragma omp for",
|
||||||
"pragma omp ordered", "pragma omp parallel for", "pragma omp section",
|
"pragma omp ordered", "pragma omp parallel for", "pragma omp section",
|
||||||
"pragma omp sections", "pragma omp parallel sections", "pragma omp single",
|
"pragma omp sections", "pragma omp parallel sections", "pragma omp single",
|
||||||
"pragma omp master", "pragma omp critical", "pragma omp barrier",
|
"pragma omp master", "pragma omp critical", "pragma omp barrier",
|
||||||
"pragma omp flush", "pragma omp threadprivate", "undef", "if", "ifdef",
|
"pragma omp flush", "pragma omp threadprivate", "undef", "if", "ifdef",
|
||||||
"ifndef", "elif", "else", "endif" }))
|
"ifndef", "elif", "else", "endif"}))
|
||||||
, m_hintProposal(0)
|
, m_hintProposal(0)
|
||||||
, m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID),
|
, m_snippetCollector(QLatin1String(CppEditor::Constants::CPP_SNIPPETS_GROUP_ID),
|
||||||
QIcon(QLatin1String(":/texteditor/images/snippet.png")),
|
QIcon(QLatin1String(":/texteditor/images/snippet.png")),
|
||||||
|
|||||||
@@ -88,11 +88,11 @@ void CppFileSettings::toSettings(QSettings *s) const
|
|||||||
void CppFileSettings::fromSettings(QSettings *s)
|
void CppFileSettings::fromSettings(QSettings *s)
|
||||||
{
|
{
|
||||||
const QStringList defaultHeaderSearchPaths
|
const QStringList defaultHeaderSearchPaths
|
||||||
= QStringList({ "include", "Include", QDir::toNativeSeparators("../include"),
|
= QStringList({"include", "Include", QDir::toNativeSeparators("../include"),
|
||||||
QDir::toNativeSeparators("../Include") });
|
QDir::toNativeSeparators("../Include")});
|
||||||
const QStringList defaultSourceSearchPaths
|
const QStringList defaultSourceSearchPaths
|
||||||
= QStringList({ QDir::toNativeSeparators("../src"), QDir::toNativeSeparators("../Src"),
|
= QStringList({QDir::toNativeSeparators("../src"), QDir::toNativeSeparators("../Src"),
|
||||||
".." });
|
".."});
|
||||||
s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
|
s->beginGroup(QLatin1String(Constants::CPPTOOLS_SETTINGSGROUP));
|
||||||
headerPrefixes = s->value(QLatin1String(headerPrefixesKeyC)).toStringList();
|
headerPrefixes = s->value(QLatin1String(headerPrefixesKeyC)).toStringList();
|
||||||
sourcePrefixes = s->value(QLatin1String(sourcePrefixesKeyC)).toStringList();
|
sourcePrefixes = s->value(QLatin1String(sourcePrefixesKeyC)).toStringList();
|
||||||
|
|||||||
@@ -276,7 +276,7 @@ static void find_helper(QFutureInterface<Usage> &future,
|
|||||||
|
|
||||||
const Utils::FileName sourceFile = Utils::FileName::fromUtf8(symbol->fileName(),
|
const Utils::FileName sourceFile = Utils::FileName::fromUtf8(symbol->fileName(),
|
||||||
symbol->fileNameLength());
|
symbol->fileNameLength());
|
||||||
Utils::FileNameList files {sourceFile};
|
Utils::FileNameList files{sourceFile};
|
||||||
|
|
||||||
if (symbol->isClass()
|
if (symbol->isClass()
|
||||||
|| symbol->isForwardClassDeclaration()
|
|| symbol->isForwardClassDeclaration()
|
||||||
@@ -578,7 +578,7 @@ static void findMacroUses_helper(QFutureInterface<Usage> &future,
|
|||||||
const Macro macro)
|
const Macro macro)
|
||||||
{
|
{
|
||||||
const Utils::FileName sourceFile = Utils::FileName::fromString(macro.fileName());
|
const Utils::FileName sourceFile = Utils::FileName::fromString(macro.fileName());
|
||||||
Utils::FileNameList files {sourceFile};
|
Utils::FileNameList files{sourceFile};
|
||||||
files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile));
|
files = Utils::filteredUnique(files + snapshot.filesDependingOn(sourceFile));
|
||||||
|
|
||||||
future.setProgressRange(0, files.size());
|
future.setProgressRange(0, files.size());
|
||||||
|
|||||||
@@ -188,8 +188,8 @@ void CppToolsPlugin::test_modelmanager_paths_are_clean()
|
|||||||
ProjectPart::Ptr part(new ProjectPart);
|
ProjectPart::Ptr part(new ProjectPart);
|
||||||
part->qtVersion = ProjectPart::Qt5;
|
part->qtVersion = ProjectPart::Qt5;
|
||||||
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
||||||
part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
part->headerPaths = {HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
||||||
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath) };
|
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath)};
|
||||||
pi.appendProjectPart(part);
|
pi.appendProjectPart(part);
|
||||||
|
|
||||||
mm->updateProjectInfo(pi);
|
mm->updateProjectInfo(pi);
|
||||||
@@ -220,8 +220,8 @@ void CppToolsPlugin::test_modelmanager_framework_headers()
|
|||||||
ProjectPart::Ptr part(new ProjectPart);
|
ProjectPart::Ptr part(new ProjectPart);
|
||||||
part->qtVersion = ProjectPart::Qt5;
|
part->qtVersion = ProjectPart::Qt5;
|
||||||
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
||||||
part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
part->headerPaths = {HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath),
|
||||||
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath) };
|
HeaderPath(testDataDir.frameworksDir(false), HeaderPath::FrameworkPath)};
|
||||||
const QString &source = testDataDir.fileFromSourcesDir(
|
const QString &source = testDataDir.fileFromSourcesDir(
|
||||||
_("test_modelmanager_framework_headers.cpp"));
|
_("test_modelmanager_framework_headers.cpp"));
|
||||||
part->files << ProjectFile(source, ProjectFile::CXXSource);
|
part->files << ProjectFile(source, ProjectFile::CXXSource);
|
||||||
@@ -269,7 +269,7 @@ void CppToolsPlugin::test_modelmanager_refresh_also_includes_of_project_files()
|
|||||||
ProjectPart::Ptr part(new ProjectPart);
|
ProjectPart::Ptr part(new ProjectPart);
|
||||||
part->qtVersion = ProjectPart::Qt5;
|
part->qtVersion = ProjectPart::Qt5;
|
||||||
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
part->projectDefines = QByteArray("#define OH_BEHAVE -1\n");
|
||||||
part->headerPaths = { HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath) };
|
part->headerPaths = {HeaderPath(testDataDir.includeDir(false), HeaderPath::IncludePath)};
|
||||||
part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource));
|
part->files.append(ProjectFile(testCpp, ProjectFile::CXXSource));
|
||||||
pi.appendProjectPart(part);
|
pi.appendProjectPart(part);
|
||||||
|
|
||||||
@@ -545,8 +545,8 @@ void CppToolsPlugin::test_modelmanager_refresh_timeStampModified_if_sourcefiles_
|
|||||||
const QString testCpp2 = QLatin1String("source2.cpp");
|
const QString testCpp2 = QLatin1String("source2.cpp");
|
||||||
|
|
||||||
const QString fileToChange = testCpp;
|
const QString fileToChange = testCpp;
|
||||||
const QStringList projectFiles1 = { testCpp };
|
const QStringList projectFiles1 = {testCpp};
|
||||||
const QStringList projectFiles2 = { testCpp, testCpp2 };
|
const QStringList projectFiles2 = {testCpp, testCpp2};
|
||||||
|
|
||||||
// Add a file
|
// Add a file
|
||||||
QTest::newRow("case: add project file") << fileToChange << projectFiles1 << projectFiles2;
|
QTest::newRow("case: add project file") << fileToChange << projectFiles1 << projectFiles2;
|
||||||
@@ -568,7 +568,7 @@ void CppToolsPlugin::test_modelmanager_snapshot_after_two_projects()
|
|||||||
// Project 1
|
// Project 1
|
||||||
project1.create(_("test_modelmanager_snapshot_after_two_projects.1"),
|
project1.create(_("test_modelmanager_snapshot_after_two_projects.1"),
|
||||||
_("testdata_project1"),
|
_("testdata_project1"),
|
||||||
{ "foo.h", "foo.cpp", "main.cpp" });
|
{"foo.h", "foo.cpp", "main.cpp"});
|
||||||
|
|
||||||
refreshedFiles = helper.updateProjectInfo(project1.projectInfo);
|
refreshedFiles = helper.updateProjectInfo(project1.projectInfo);
|
||||||
QCOMPARE(refreshedFiles, project1.projectFiles.toSet());
|
QCOMPARE(refreshedFiles, project1.projectFiles.toSet());
|
||||||
@@ -580,7 +580,7 @@ void CppToolsPlugin::test_modelmanager_snapshot_after_two_projects()
|
|||||||
// Project 2
|
// Project 2
|
||||||
project2.create(_("test_modelmanager_snapshot_after_two_projects.2"),
|
project2.create(_("test_modelmanager_snapshot_after_two_projects.2"),
|
||||||
_("testdata_project2"),
|
_("testdata_project2"),
|
||||||
{ "bar.h", "bar.cpp", "main.cpp" });
|
{"bar.h", "bar.cpp", "main.cpp"});
|
||||||
|
|
||||||
refreshedFiles = helper.updateProjectInfo(project2.projectInfo);
|
refreshedFiles = helper.updateProjectInfo(project2.projectInfo);
|
||||||
QCOMPARE(refreshedFiles, project2.projectFiles.toSet());
|
QCOMPARE(refreshedFiles, project2.projectFiles.toSet());
|
||||||
@@ -762,7 +762,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
|||||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||||
part1->qtVersion = ProjectPart::NoQt;
|
part1->qtVersion = ProjectPart::NoQt;
|
||||||
part1->projectDefines = QByteArray("#define SUB1\n");
|
part1->projectDefines = QByteArray("#define SUB1\n");
|
||||||
part1->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
part1->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||||
|
|
||||||
ProjectPart::Ptr part2(new ProjectPart);
|
ProjectPart::Ptr part2(new ProjectPart);
|
||||||
part2->projectFile = QLatin1String("project1.projectfile");
|
part2->projectFile = QLatin1String("project1.projectfile");
|
||||||
@@ -770,7 +770,7 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
|||||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||||
part2->qtVersion = ProjectPart::NoQt;
|
part2->qtVersion = ProjectPart::NoQt;
|
||||||
part2->projectDefines = QByteArray("#define SUB2\n");
|
part2->projectDefines = QByteArray("#define SUB2\n");
|
||||||
part2->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
part2->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||||
|
|
||||||
ProjectInfo pi = ProjectInfo(project);
|
ProjectInfo pi = ProjectInfo(project);
|
||||||
pi.appendProjectPart(part1);
|
pi.appendProjectPart(part1);
|
||||||
@@ -786,8 +786,8 @@ void CppToolsPlugin::test_modelmanager_defines_per_project()
|
|||||||
QString firstDeclarationName;
|
QString firstDeclarationName;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
} d[] = {
|
} d[] = {
|
||||||
{ _("one"), main1File },
|
{_("one"), main1File},
|
||||||
{ _("two"), main2File }
|
{_("two"), main2File}
|
||||||
};
|
};
|
||||||
const int size = sizeof(d) / sizeof(d[0]);
|
const int size = sizeof(d) / sizeof(d[0]);
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
@@ -828,7 +828,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
|||||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||||
part1->qtVersion = ProjectPart::NoQt;
|
part1->qtVersion = ProjectPart::NoQt;
|
||||||
part1->precompiledHeaders.append(pch1File);
|
part1->precompiledHeaders.append(pch1File);
|
||||||
part1->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
part1->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||||
part1->updateLanguageFeatures();
|
part1->updateLanguageFeatures();
|
||||||
|
|
||||||
ProjectPart::Ptr part2(new ProjectPart);
|
ProjectPart::Ptr part2(new ProjectPart);
|
||||||
@@ -837,7 +837,7 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
|||||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||||
part2->qtVersion = ProjectPart::NoQt;
|
part2->qtVersion = ProjectPart::NoQt;
|
||||||
part2->precompiledHeaders.append(pch2File);
|
part2->precompiledHeaders.append(pch2File);
|
||||||
part2->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
part2->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||||
part2->updateLanguageFeatures();
|
part2->updateLanguageFeatures();
|
||||||
|
|
||||||
ProjectInfo pi = ProjectInfo(project);
|
ProjectInfo pi = ProjectInfo(project);
|
||||||
@@ -855,8 +855,8 @@ void CppToolsPlugin::test_modelmanager_precompiled_headers()
|
|||||||
QString firstClassInPchFile;
|
QString firstClassInPchFile;
|
||||||
QString fileName;
|
QString fileName;
|
||||||
} d[] = {
|
} d[] = {
|
||||||
{ _("one"), _("ClassInPch1"), main1File },
|
{_("one"), _("ClassInPch1"), main1File},
|
||||||
{ _("two"), _("ClassInPch2"), main2File }
|
{_("two"), _("ClassInPch2"), main2File}
|
||||||
};
|
};
|
||||||
const int size = sizeof(d) / sizeof(d[0]);
|
const int size = sizeof(d) / sizeof(d[0]);
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
@@ -911,13 +911,13 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
|
|||||||
part1->files.append(ProjectFile(main1File, ProjectFile::CXXSource));
|
part1->files.append(ProjectFile(main1File, ProjectFile::CXXSource));
|
||||||
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
part1->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||||
part1->qtVersion = ProjectPart::NoQt;
|
part1->qtVersion = ProjectPart::NoQt;
|
||||||
part1->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
part1->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||||
|
|
||||||
ProjectPart::Ptr part2(new ProjectPart);
|
ProjectPart::Ptr part2(new ProjectPart);
|
||||||
part2->files.append(ProjectFile(main2File, ProjectFile::CXXSource));
|
part2->files.append(ProjectFile(main2File, ProjectFile::CXXSource));
|
||||||
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
part2->files.append(ProjectFile(header, ProjectFile::CXXHeader));
|
||||||
part2->qtVersion = ProjectPart::NoQt;
|
part2->qtVersion = ProjectPart::NoQt;
|
||||||
part2->headerPaths = { HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath) };
|
part2->headerPaths = {HeaderPath(testDataDirectory.includeDir(false), HeaderPath::IncludePath)};
|
||||||
|
|
||||||
ProjectInfo pi = ProjectInfo(project);
|
ProjectInfo pi = ProjectInfo(project);
|
||||||
pi.appendProjectPart(part1);
|
pi.appendProjectPart(part1);
|
||||||
@@ -934,8 +934,8 @@ void CppToolsPlugin::test_modelmanager_defines_per_editor()
|
|||||||
QString editorDefines;
|
QString editorDefines;
|
||||||
QString firstDeclarationName;
|
QString firstDeclarationName;
|
||||||
} d[] = {
|
} d[] = {
|
||||||
{ _("#define SUB1\n"), _("one") },
|
{_("#define SUB1\n"), _("one")},
|
||||||
{ _("#define SUB2\n"), _("two") }
|
{_("#define SUB2\n"), _("two")}
|
||||||
};
|
};
|
||||||
const int size = sizeof(d) / sizeof(d[0]);
|
const int size = sizeof(d) / sizeof(d[0]);
|
||||||
for (int i = 0; i < size; ++i) {
|
for (int i = 0; i < size; ++i) {
|
||||||
@@ -1025,7 +1025,7 @@ void CppToolsPlugin::test_modelmanager_renameIncludes()
|
|||||||
QVERIFY(tmpDir.isValid());
|
QVERIFY(tmpDir.isValid());
|
||||||
|
|
||||||
const QDir workingDir(tmpDir.path());
|
const QDir workingDir(tmpDir.path());
|
||||||
const QStringList fileNames = { "foo.h", "foo.cpp", "main.cpp" };
|
const QStringList fileNames = {"foo.h", "foo.cpp", "main.cpp"};
|
||||||
const QString oldHeader(workingDir.filePath(_("foo.h")));
|
const QString oldHeader(workingDir.filePath(_("foo.h")));
|
||||||
const QString newHeader(workingDir.filePath(_("bar.h")));
|
const QString newHeader(workingDir.filePath(_("bar.h")));
|
||||||
CppModelManager *modelManager = CppModelManager::instance();
|
CppModelManager *modelManager = CppModelManager::instance();
|
||||||
@@ -1071,7 +1071,7 @@ void CppToolsPlugin::test_modelmanager_renameIncludesInEditor()
|
|||||||
QVERIFY(tmpDir.isValid());
|
QVERIFY(tmpDir.isValid());
|
||||||
|
|
||||||
const QDir workingDir(tmpDir.path());
|
const QDir workingDir(tmpDir.path());
|
||||||
const QStringList fileNames = { "foo.h", "foo.cpp", "main.cpp" };
|
const QStringList fileNames = {"foo.h", "foo.cpp", "main.cpp"};
|
||||||
const QString oldHeader(workingDir.filePath(_("foo.h")));
|
const QString oldHeader(workingDir.filePath(_("foo.h")));
|
||||||
const QString newHeader(workingDir.filePath(_("bar.h")));
|
const QString newHeader(workingDir.filePath(_("bar.h")));
|
||||||
const QString mainFile(workingDir.filePath(_("main.cpp")));
|
const QString mainFile(workingDir.filePath(_("main.cpp")));
|
||||||
|
|||||||
@@ -902,8 +902,8 @@ BreakHandler::BreakHandler()
|
|||||||
#if USE_BREAK_MODEL_TEST
|
#if USE_BREAK_MODEL_TEST
|
||||||
new ModelTest(this, 0);
|
new ModelTest(this, 0);
|
||||||
#endif
|
#endif
|
||||||
setHeader(QStringList({ tr("Number"), tr("Function"), tr("File"), tr("Line"), tr("Address"),
|
setHeader(QStringList({tr("Number"), tr("Function"), tr("File"), tr("Line"), tr("Address"),
|
||||||
tr("Condition"), tr("Ignore"), tr("Threads") }));
|
tr("Condition"), tr("Ignore"), tr("Threads")}));
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline bool fileNameMatch(const QString &f1, const QString &f2)
|
static inline bool fileNameMatch(const QString &f1, const QString &f2)
|
||||||
@@ -1936,7 +1936,7 @@ bool BreakHandler::setData(const QModelIndex &idx, const QVariant &value, int ro
|
|||||||
if (ev.as<QMouseEvent>(QEvent::MouseButtonDblClick)) {
|
if (ev.as<QMouseEvent>(QEvent::MouseButtonDblClick)) {
|
||||||
if (Breakpoint b = findBreakpointByIndex(idx)) {
|
if (Breakpoint b = findBreakpointByIndex(idx)) {
|
||||||
if (idx.column() >= BreakpointAddressColumn)
|
if (idx.column() >= BreakpointAddressColumn)
|
||||||
editBreakpoints({ b }, ev.view());
|
editBreakpoints({b}, ev.view());
|
||||||
else
|
else
|
||||||
b.gotoLocation();
|
b.gotoLocation();
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ QWidget *Console::outputWidget(QWidget *)
|
|||||||
|
|
||||||
QList<QWidget *> Console::toolBarWidgets() const
|
QList<QWidget *> Console::toolBarWidgets() const
|
||||||
{
|
{
|
||||||
return { m_showDebugButton, m_showWarningButton, m_showErrorButton,
|
return {m_showDebugButton, m_showWarningButton, m_showErrorButton,
|
||||||
m_spacer, m_statusLabel };
|
m_spacer, m_statusLabel};
|
||||||
}
|
}
|
||||||
|
|
||||||
int Console::priorityInStatusBar() const
|
int Console::priorityInStatusBar() const
|
||||||
|
|||||||
@@ -123,7 +123,7 @@ void DebuggerItem::reinitializeFromFile()
|
|||||||
|
|
||||||
SynchronousProcess proc;
|
SynchronousProcess proc;
|
||||||
SynchronousProcessResponse response
|
SynchronousProcessResponse response
|
||||||
= proc.runBlocking(m_command.toString(), QStringList({ QLatin1String(version) }));
|
= proc.runBlocking(m_command.toString(), QStringList({QLatin1String(version)}));
|
||||||
if (response.result != SynchronousProcessResponse::Finished) {
|
if (response.result != SynchronousProcessResponse::Finished) {
|
||||||
m_engineType = NoEngineType;
|
m_engineType = NoEngineType;
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ const DebuggerItem *findDebugger(const Predicate &pred)
|
|||||||
|
|
||||||
DebuggerItemModel::DebuggerItemModel()
|
DebuggerItemModel::DebuggerItemModel()
|
||||||
{
|
{
|
||||||
setHeader({ tr("Name"), tr("Location"), tr("Type") });
|
setHeader({tr("Name"), tr("Location"), tr("Type")});
|
||||||
rootItem()->appendChild(new StaticTreeItem(tr("Auto-detected")));
|
rootItem()->appendChild(new StaticTreeItem(tr("Auto-detected")));
|
||||||
rootItem()->appendChild(new StaticTreeItem(tr("Manual")));
|
rootItem()->appendChild(new StaticTreeItem(tr("Manual")));
|
||||||
}
|
}
|
||||||
@@ -702,8 +702,8 @@ void DebuggerItemManagerPrivate::autoDetectCdbDebuggers()
|
|||||||
|
|
||||||
void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
||||||
{
|
{
|
||||||
const QStringList filters = { "gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
|
const QStringList filters = {"gdb-i686-pc-mingw32", "gdb-i686-pc-mingw32.exe", "gdb",
|
||||||
"gdb.exe", "lldb", "lldb.exe", "lldb-*" };
|
"gdb.exe", "lldb", "lldb.exe", "lldb-*"};
|
||||||
|
|
||||||
// DebuggerItem result;
|
// DebuggerItem result;
|
||||||
// result.setAutoDetected(true);
|
// result.setAutoDetected(true);
|
||||||
@@ -731,7 +731,7 @@ void DebuggerItemManagerPrivate::autoDetectGdbOrLldbDebuggers()
|
|||||||
SynchronousProcess lldbInfo;
|
SynchronousProcess lldbInfo;
|
||||||
lldbInfo.setTimeoutS(2);
|
lldbInfo.setTimeoutS(2);
|
||||||
SynchronousProcessResponse response
|
SynchronousProcessResponse response
|
||||||
= lldbInfo.runBlocking(QLatin1String("xcrun"), { "--find", "lldb" });
|
= lldbInfo.runBlocking(QLatin1String("xcrun"), {"--find", "lldb"});
|
||||||
if (response.result == Utils::SynchronousProcessResponse::Finished) {
|
if (response.result == Utils::SynchronousProcessResponse::Finished) {
|
||||||
QString lPath = response.allOutput().trimmed();
|
QString lPath = response.allOutput().trimmed();
|
||||||
if (!lPath.isEmpty()) {
|
if (!lPath.isEmpty()) {
|
||||||
|
|||||||
@@ -1848,22 +1848,22 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments,
|
|||||||
// qmlToolbar.addWidget(new StyledSeparator);
|
// qmlToolbar.addWidget(new StyledSeparator);
|
||||||
|
|
||||||
auto createBasePerspective = [this] { return new Perspective({}, {
|
auto createBasePerspective = [this] { return new Perspective({}, {
|
||||||
{ DOCKWIDGET_STACK, m_stackWindow, {}, Perspective::SplitVertical },
|
{DOCKWIDGET_STACK, m_stackWindow, {}, Perspective::SplitVertical},
|
||||||
{ DOCKWIDGET_BREAK, m_breakWindow, DOCKWIDGET_STACK, Perspective::SplitHorizontal },
|
{DOCKWIDGET_BREAK, m_breakWindow, DOCKWIDGET_STACK, Perspective::SplitHorizontal},
|
||||||
{ DOCKWIDGET_THREADS, m_threadsWindow, DOCKWIDGET_BREAK, Perspective::AddToTab, false },
|
{DOCKWIDGET_THREADS, m_threadsWindow, DOCKWIDGET_BREAK, Perspective::AddToTab, false},
|
||||||
{ DOCKWIDGET_MODULES, m_modulesWindow, DOCKWIDGET_THREADS, Perspective::AddToTab, false },
|
{DOCKWIDGET_MODULES, m_modulesWindow, DOCKWIDGET_THREADS, Perspective::AddToTab, false},
|
||||||
{ DOCKWIDGET_SOURCE_FILES, m_sourceFilesWindow, DOCKWIDGET_MODULES, Perspective::AddToTab, false },
|
{DOCKWIDGET_SOURCE_FILES, m_sourceFilesWindow, DOCKWIDGET_MODULES, Perspective::AddToTab, false},
|
||||||
{ DOCKWIDGET_SNAPSHOTS, m_snapshotWindow, DOCKWIDGET_SOURCE_FILES, Perspective::AddToTab, false },
|
{DOCKWIDGET_SNAPSHOTS, m_snapshotWindow, DOCKWIDGET_SOURCE_FILES, Perspective::AddToTab, false},
|
||||||
{ DOCKWIDGET_WATCHERS, m_localsAndExpressionsWindow, {}, Perspective::AddToTab, true,
|
{DOCKWIDGET_WATCHERS, m_localsAndExpressionsWindow, {}, Perspective::AddToTab, true,
|
||||||
Qt::RightDockWidgetArea },
|
Qt::RightDockWidgetArea},
|
||||||
{ DOCKWIDGET_OUTPUT, m_logWindow, {}, Perspective::AddToTab, false, Qt::TopDockWidgetArea },
|
{DOCKWIDGET_OUTPUT, m_logWindow, {}, Perspective::AddToTab, false, Qt::TopDockWidgetArea},
|
||||||
{ DOCKWIDGET_BREAK, 0, {}, Perspective::Raise }
|
{DOCKWIDGET_BREAK, 0, {}, Perspective::Raise}
|
||||||
}); };
|
}); };
|
||||||
|
|
||||||
Perspective *cppPerspective = createBasePerspective();
|
Perspective *cppPerspective = createBasePerspective();
|
||||||
cppPerspective->setName(tr("Debugger"));
|
cppPerspective->setName(tr("Debugger"));
|
||||||
cppPerspective->addOperation({ DOCKWIDGET_REGISTER, m_registerWindow, DOCKWIDGET_SNAPSHOTS,
|
cppPerspective->addOperation({DOCKWIDGET_REGISTER, m_registerWindow, DOCKWIDGET_SNAPSHOTS,
|
||||||
Perspective::AddToTab, false });
|
Perspective::AddToTab, false});
|
||||||
|
|
||||||
Debugger::registerToolbar(CppPerspectiveId, toolbar);
|
Debugger::registerToolbar(CppPerspectiveId, toolbar);
|
||||||
Debugger::registerPerspective(CppPerspectiveId, cppPerspective);
|
Debugger::registerPerspective(CppPerspectiveId, cppPerspective);
|
||||||
@@ -2142,16 +2142,16 @@ void DebuggerPlugin::getEnginesState(QByteArray *json) const
|
|||||||
{
|
{
|
||||||
QTC_ASSERT(json, return);
|
QTC_ASSERT(json, return);
|
||||||
QVariantMap result {
|
QVariantMap result {
|
||||||
{ "version", 1 }
|
{"version", 1}
|
||||||
};
|
};
|
||||||
QVariantMap states;
|
QVariantMap states;
|
||||||
|
|
||||||
for (int i = 0; i < dd->m_snapshotHandler->size(); ++i) {
|
for (int i = 0; i < dd->m_snapshotHandler->size(); ++i) {
|
||||||
const DebuggerEngine *engine = dd->m_snapshotHandler->at(i);
|
const DebuggerEngine *engine = dd->m_snapshotHandler->at(i);
|
||||||
states[QString::number(i)] = QVariantMap({
|
states[QString::number(i)] = QVariantMap({
|
||||||
{ "current", dd->m_snapshotHandler->currentIndex() == i },
|
{"current", dd->m_snapshotHandler->currentIndex() == i},
|
||||||
{ "pid", engine->inferiorPid() },
|
{"pid", engine->inferiorPid()},
|
||||||
{ "state", engine->state() }
|
{"state", engine->state()}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -3873,7 +3873,7 @@ void DebuggerUnitTests::testDebuggerMatching()
|
|||||||
|
|
||||||
QList<QObject *> DebuggerPlugin::createTestObjects() const
|
QList<QObject *> DebuggerPlugin::createTestObjects() const
|
||||||
{
|
{
|
||||||
return { new DebuggerUnitTests };
|
return {new DebuggerUnitTests};
|
||||||
}
|
}
|
||||||
|
|
||||||
#else // ^-- if WITH_TESTS else --v
|
#else // ^-- if WITH_TESTS else --v
|
||||||
|
|||||||
@@ -646,11 +646,11 @@ QString decodeData(const QString &ba, const QString &encoding)
|
|||||||
case DebuggerEncoding::HexEncodedFloat: {
|
case DebuggerEncoding::HexEncodedFloat: {
|
||||||
const QByteArray s = QByteArray::fromHex(ba.toUtf8());
|
const QByteArray s = QByteArray::fromHex(ba.toUtf8());
|
||||||
if (enc.size == 4) {
|
if (enc.size == 4) {
|
||||||
union { char c[4]; float f; } u = { { s[3], s[2], s[1], s[0] } };
|
union { char c[4]; float f; } u = {{s[3], s[2], s[1], s[0]}};
|
||||||
return QString::number(u.f);
|
return QString::number(u.f);
|
||||||
}
|
}
|
||||||
if (enc.size == 8) {
|
if (enc.size == 8) {
|
||||||
union { char c[8]; double d; } u = { { s[7], s[6], s[5], s[4], s[3], s[2], s[1], s[0] } };
|
union { char c[8]; double d; } u = {{s[7], s[6], s[5], s[4], s[3], s[2], s[1], s[0]}};
|
||||||
return QString::number(u.d);
|
return QString::number(u.d);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -236,9 +236,9 @@ class ToolTipModel : public TreeModel<ToolTipWatchItem>
|
|||||||
public:
|
public:
|
||||||
ToolTipModel()
|
ToolTipModel()
|
||||||
{
|
{
|
||||||
setHeader({ DebuggerToolTipManager::tr("Name"),
|
setHeader({DebuggerToolTipManager::tr("Name"),
|
||||||
DebuggerToolTipManager::tr("Value"),
|
DebuggerToolTipManager::tr("Value"),
|
||||||
DebuggerToolTipManager::tr("Type") });
|
DebuggerToolTipManager::tr("Type")});
|
||||||
m_enabled = true;
|
m_enabled = true;
|
||||||
auto item = new ToolTipWatchItem;
|
auto item = new ToolTipWatchItem;
|
||||||
item->expandable = true;
|
item->expandable = true;
|
||||||
|
|||||||
@@ -161,8 +161,8 @@ QString registerViewTitle(const QString ®isterName, quint64 addr)
|
|||||||
|
|
||||||
QList<MemoryMarkup> registerViewMarkup(quint64 a, const QString ®Name)
|
QList<MemoryMarkup> registerViewMarkup(quint64 a, const QString ®Name)
|
||||||
{
|
{
|
||||||
return { MemoryMarkup(a, 1, QColor(Qt::blue).lighter(),
|
return {MemoryMarkup(a, 1, QColor(Qt::blue).lighter(),
|
||||||
MemoryAgent::tr("Register \"%1\"").arg(regName)) };
|
MemoryAgent::tr("Register \"%1\"").arg(regName))};
|
||||||
}
|
}
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////
|
||||||
|
|||||||
@@ -196,7 +196,7 @@ bool ModulesModel::contextMenuEvent(const ItemViewEvent &ev)
|
|||||||
addAction(menu, tr("Show Dependencies of \"%1\"").arg(moduleName),
|
addAction(menu, tr("Show Dependencies of \"%1\"").arg(moduleName),
|
||||||
tr("Show Dependencies"),
|
tr("Show Dependencies"),
|
||||||
moduleNameValid && !moduleName.isEmpty() && HostOsInfo::isWindowsHost(),
|
moduleNameValid && !moduleName.isEmpty() && HostOsInfo::isWindowsHost(),
|
||||||
[this, modulePath] { QProcess::startDetached("depends", { modulePath }); });
|
[this, modulePath] { QProcess::startDetached("depends", {modulePath}); });
|
||||||
|
|
||||||
addAction(menu, tr("Load Symbols for All Modules"),
|
addAction(menu, tr("Load Symbols for All Modules"),
|
||||||
enabled && canLoadSymbols,
|
enabled && canLoadSymbols,
|
||||||
|
|||||||
@@ -136,7 +136,7 @@ void PdbEngine::setupEngine()
|
|||||||
notifyEngineSetupFailed();
|
notifyEngineSetupFailed();
|
||||||
}
|
}
|
||||||
|
|
||||||
QStringList args = { bridge, scriptFile.fileName() };
|
QStringList args = {bridge, scriptFile.fileName()};
|
||||||
args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory));
|
args.append(Utils::QtcProcess::splitArgs(runParameters().inferior.workingDirectory));
|
||||||
showMessage("STARTING " + m_interpreter + QLatin1Char(' ') + args.join(QLatin1Char(' ')));
|
showMessage("STARTING " + m_interpreter + QLatin1Char(' ') + args.join(QLatin1Char(' ')));
|
||||||
m_proc.setEnvironment(runParameters().debugger.environment.toStringList());
|
m_proc.setEnvironment(runParameters().debugger.environment.toStringList());
|
||||||
|
|||||||
@@ -466,7 +466,7 @@ WatchModel::WatchModel(WatchHandler *handler, DebuggerEngine *engine)
|
|||||||
|
|
||||||
m_contentsValid = true;
|
m_contentsValid = true;
|
||||||
|
|
||||||
setHeader({ tr("Name"), tr("Value"), tr("Type") });
|
setHeader({tr("Name"), tr("Value"), tr("Type")});
|
||||||
m_localsRoot = new WatchItem;
|
m_localsRoot = new WatchItem;
|
||||||
m_localsRoot->iname = "local";
|
m_localsRoot->iname = "local";
|
||||||
m_localsRoot->name = tr("Locals");
|
m_localsRoot->name = tr("Locals");
|
||||||
@@ -2070,7 +2070,7 @@ void WatchHandler::notifyUpdateStarted(const UpdateParameters &updateParameters)
|
|||||||
{
|
{
|
||||||
QStringList inames = updateParameters.partialVariables();
|
QStringList inames = updateParameters.partialVariables();
|
||||||
if (inames.isEmpty())
|
if (inames.isEmpty())
|
||||||
inames = QStringList({ "local", "return" });
|
inames = QStringList({"local", "return"});
|
||||||
|
|
||||||
auto marker = [](WatchItem *item) { item->outdated = true; };
|
auto marker = [](WatchItem *item) { item->outdated = true; };
|
||||||
|
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ namespace Internal {
|
|||||||
|
|
||||||
FormClassWizard::FormClassWizard()
|
FormClassWizard::FormClassWizard()
|
||||||
{
|
{
|
||||||
setRequiredFeatures({ QtSupport::Constants::FEATURE_QWIDGETS });
|
setRequiredFeatures({QtSupport::Constants::FEATURE_QWIDGETS});
|
||||||
}
|
}
|
||||||
|
|
||||||
QString FormClassWizard::headerSuffix() const
|
QString FormClassWizard::headerSuffix() const
|
||||||
|
|||||||
@@ -165,7 +165,7 @@ public:
|
|||||||
const QString hFile = files.at(1);
|
const QString hFile = files.at(1);
|
||||||
|
|
||||||
QCOMPARE(DocumentModel::openedDocuments().size(), files.size());
|
QCOMPARE(DocumentModel::openedDocuments().size(), files.size());
|
||||||
waitForFilesInGlobalSnapshot({ cppFile, hFile });
|
waitForFilesInGlobalSnapshot({cppFile, hFile});
|
||||||
|
|
||||||
// Execute "Go To Slot"
|
// Execute "Go To Slot"
|
||||||
QDesignerIntegrationInterface *integration = FormEditorW::designerEditor()->integration();
|
QDesignerIntegrationInterface *integration = FormEditorW::designerEditor()->integration();
|
||||||
@@ -214,8 +214,8 @@ public:
|
|||||||
|
|
||||||
// Since no project is opened and the ui_*.h is not generated,
|
// Since no project is opened and the ui_*.h is not generated,
|
||||||
// the following diagnostic messages will be ignored.
|
// the following diagnostic messages will be ignored.
|
||||||
const QStringList ignoreList = QStringList({ "ui_form.h: No such file or directory",
|
const QStringList ignoreList = QStringList({"ui_form.h: No such file or directory",
|
||||||
"QWidget: No such file or directory" });
|
"QWidget: No such file or directory"});
|
||||||
QList<Document::DiagnosticMessage> cleanedDiagnosticMessages;
|
QList<Document::DiagnosticMessage> cleanedDiagnosticMessages;
|
||||||
foreach (const Document::DiagnosticMessage &message, document->diagnosticMessages()) {
|
foreach (const Document::DiagnosticMessage &message, document->diagnosticMessages()) {
|
||||||
if (!ignoreList.contains(message.text()))
|
if (!ignoreList.contains(message.text()))
|
||||||
@@ -246,9 +246,9 @@ void FormEditorPlugin::test_gotoslot_data()
|
|||||||
|
|
||||||
MyTestDataDir testDataDirWithoutProject(_("gotoslot_withoutProject"));
|
MyTestDataDir testDataDirWithoutProject(_("gotoslot_withoutProject"));
|
||||||
QTest::newRow("withoutProject")
|
QTest::newRow("withoutProject")
|
||||||
<< QStringList({ testDataDirWithoutProject.file(_("form.cpp")),
|
<< QStringList({testDataDirWithoutProject.file(_("form.cpp")),
|
||||||
testDataDirWithoutProject.file(_("form.h")),
|
testDataDirWithoutProject.file(_("form.h")),
|
||||||
testDataDirWithoutProject.file(_("form.ui")) });
|
testDataDirWithoutProject.file(_("form.ui"))});
|
||||||
|
|
||||||
// Finding the right class for inserting definitions/declarations is based on
|
// Finding the right class for inserting definitions/declarations is based on
|
||||||
// finding a class with a member whose type is the class from the "ui_xxx.h" header.
|
// finding a class with a member whose type is the class from the "ui_xxx.h" header.
|
||||||
@@ -259,18 +259,18 @@ void FormEditorPlugin::test_gotoslot_data()
|
|||||||
|
|
||||||
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer"));
|
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer"));
|
||||||
QTest::newRow("insertIntoCorrectClass_pointer")
|
QTest::newRow("insertIntoCorrectClass_pointer")
|
||||||
<< QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
|
<< QStringList({testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
|
||||||
testDataDirWithoutProject.file(_("form.ui")) }); // reuse
|
testDataDirWithoutProject.file(_("form.ui"))}); // reuse
|
||||||
|
|
||||||
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_non-pointer"));
|
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_non-pointer"));
|
||||||
QTest::newRow("insertIntoCorrectClass_non-pointer")
|
QTest::newRow("insertIntoCorrectClass_non-pointer")
|
||||||
<< QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
|
<< QStringList({testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
|
||||||
testDataDirWithoutProject.file(_("form.ui")) }); // reuse
|
testDataDirWithoutProject.file(_("form.ui"))}); // reuse
|
||||||
|
|
||||||
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer_ns_using"));
|
testDataDir = MyTestDataDir(_("gotoslot_insertIntoCorrectClass_pointer_ns_using"));
|
||||||
QTest::newRow("insertIntoCorrectClass_pointer_ns_using")
|
QTest::newRow("insertIntoCorrectClass_pointer_ns_using")
|
||||||
<< QStringList({ testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
|
<< QStringList({testDataDir.file(_("form.cpp")), testDataDir.file(_("form.h")),
|
||||||
testDataDir.file(_("form.ui")) });
|
testDataDir.file(_("form.ui"))});
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
|
|||||||
@@ -353,9 +353,9 @@ static QString addConstRefIfNeeded(const QString &argument)
|
|||||||
return argument;
|
return argument;
|
||||||
|
|
||||||
// for those types we don't want to add "const &"
|
// for those types we don't want to add "const &"
|
||||||
static const QStringList nonConstRefs = QStringList({ "bool", "int", "uint", "float", "double",
|
static const QStringList nonConstRefs = QStringList({"bool", "int", "uint", "float", "double",
|
||||||
"long", "short", "char", "signed",
|
"long", "short", "char", "signed",
|
||||||
"unsigned", "qint64", "quint64" });
|
"unsigned", "qint64", "quint64"});
|
||||||
|
|
||||||
for (int i = 0; i < nonConstRefs.count(); i++) {
|
for (int i = 0; i < nonConstRefs.count(); i++) {
|
||||||
const QString nonConstRef = nonConstRefs.at(i);
|
const QString nonConstRef = nonConstRefs.at(i);
|
||||||
|
|||||||
@@ -788,91 +788,91 @@ static const QMap<QString, int> &vimKeyNames()
|
|||||||
{
|
{
|
||||||
static const QMap<QString, int> k = {
|
static const QMap<QString, int> k = {
|
||||||
// FIXME: Should be value of mapleader.
|
// FIXME: Should be value of mapleader.
|
||||||
{ "LEADER", Key_Backslash },
|
{"LEADER", Key_Backslash},
|
||||||
|
|
||||||
{ "SPACE", Key_Space },
|
{"SPACE", Key_Space},
|
||||||
{ "TAB", Key_Tab },
|
{"TAB", Key_Tab},
|
||||||
{ "NL", Key_Return },
|
{"NL", Key_Return},
|
||||||
{ "NEWLINE", Key_Return },
|
{"NEWLINE", Key_Return},
|
||||||
{ "LINEFEED", Key_Return },
|
{"LINEFEED", Key_Return},
|
||||||
{ "LF", Key_Return },
|
{"LF", Key_Return},
|
||||||
{ "CR", Key_Return },
|
{"CR", Key_Return},
|
||||||
{ "RETURN", Key_Return },
|
{"RETURN", Key_Return},
|
||||||
{ "ENTER", Key_Return },
|
{"ENTER", Key_Return},
|
||||||
{ "BS", Key_Backspace },
|
{"BS", Key_Backspace},
|
||||||
{ "BACKSPACE", Key_Backspace },
|
{"BACKSPACE", Key_Backspace},
|
||||||
{ "ESC", Key_Escape },
|
{"ESC", Key_Escape},
|
||||||
{ "BAR", Key_Bar },
|
{"BAR", Key_Bar},
|
||||||
{ "BSLASH", Key_Backslash },
|
{"BSLASH", Key_Backslash},
|
||||||
{ "DEL", Key_Delete },
|
{"DEL", Key_Delete},
|
||||||
{ "DELETE", Key_Delete },
|
{"DELETE", Key_Delete},
|
||||||
{ "KDEL", Key_Delete },
|
{"KDEL", Key_Delete},
|
||||||
{ "UP", Key_Up },
|
{"UP", Key_Up},
|
||||||
{ "DOWN", Key_Down },
|
{"DOWN", Key_Down},
|
||||||
{ "LEFT", Key_Left },
|
{"LEFT", Key_Left},
|
||||||
{ "RIGHT", Key_Right },
|
{"RIGHT", Key_Right},
|
||||||
|
|
||||||
{ "LT", Key_Less },
|
{"LT", Key_Less},
|
||||||
{ "GT", Key_Greater },
|
{"GT", Key_Greater},
|
||||||
|
|
||||||
{ "F1", Key_F1 },
|
{"F1", Key_F1},
|
||||||
{ "F2", Key_F2 },
|
{"F2", Key_F2},
|
||||||
{ "F3", Key_F3 },
|
{"F3", Key_F3},
|
||||||
{ "F4", Key_F4 },
|
{"F4", Key_F4},
|
||||||
{ "F5", Key_F5 },
|
{"F5", Key_F5},
|
||||||
{ "F6", Key_F6 },
|
{"F6", Key_F6},
|
||||||
{ "F7", Key_F7 },
|
{"F7", Key_F7},
|
||||||
{ "F8", Key_F8 },
|
{"F8", Key_F8},
|
||||||
{ "F9", Key_F9 },
|
{"F9", Key_F9},
|
||||||
{ "F10", Key_F10 },
|
{"F10", Key_F10},
|
||||||
|
|
||||||
{ "F11", Key_F11 },
|
{"F11", Key_F11},
|
||||||
{ "F12", Key_F12 },
|
{"F12", Key_F12},
|
||||||
{ "F13", Key_F13 },
|
{"F13", Key_F13},
|
||||||
{ "F14", Key_F14 },
|
{"F14", Key_F14},
|
||||||
{ "F15", Key_F15 },
|
{"F15", Key_F15},
|
||||||
{ "F16", Key_F16 },
|
{"F16", Key_F16},
|
||||||
{ "F17", Key_F17 },
|
{"F17", Key_F17},
|
||||||
{ "F18", Key_F18 },
|
{"F18", Key_F18},
|
||||||
{ "F19", Key_F19 },
|
{"F19", Key_F19},
|
||||||
{ "F20", Key_F20 },
|
{"F20", Key_F20},
|
||||||
|
|
||||||
{ "F21", Key_F21 },
|
{"F21", Key_F21},
|
||||||
{ "F22", Key_F22 },
|
{"F22", Key_F22},
|
||||||
{ "F23", Key_F23 },
|
{"F23", Key_F23},
|
||||||
{ "F24", Key_F24 },
|
{"F24", Key_F24},
|
||||||
{ "F25", Key_F25 },
|
{"F25", Key_F25},
|
||||||
{ "F26", Key_F26 },
|
{"F26", Key_F26},
|
||||||
{ "F27", Key_F27 },
|
{"F27", Key_F27},
|
||||||
{ "F28", Key_F28 },
|
{"F28", Key_F28},
|
||||||
{ "F29", Key_F29 },
|
{"F29", Key_F29},
|
||||||
{ "F30", Key_F30 },
|
{"F30", Key_F30},
|
||||||
|
|
||||||
{ "F31", Key_F31 },
|
{"F31", Key_F31},
|
||||||
{ "F32", Key_F32 },
|
{"F32", Key_F32},
|
||||||
{ "F33", Key_F33 },
|
{"F33", Key_F33},
|
||||||
{ "F34", Key_F34 },
|
{"F34", Key_F34},
|
||||||
{ "F35", Key_F35 },
|
{"F35", Key_F35},
|
||||||
|
|
||||||
{ "INSERT", Key_Insert },
|
{"INSERT", Key_Insert},
|
||||||
{ "INS", Key_Insert },
|
{"INS", Key_Insert},
|
||||||
{ "KINSERT", Key_Insert },
|
{"KINSERT", Key_Insert},
|
||||||
{ "HOME", Key_Home },
|
{"HOME", Key_Home},
|
||||||
{ "END", Key_End },
|
{"END", Key_End},
|
||||||
{ "PAGEUP", Key_PageUp },
|
{"PAGEUP", Key_PageUp},
|
||||||
{ "PAGEDOWN", Key_PageDown },
|
{"PAGEDOWN", Key_PageDown},
|
||||||
|
|
||||||
{ "KPLUS", Key_Plus },
|
{"KPLUS", Key_Plus},
|
||||||
{ "KMINUS", Key_Minus },
|
{"KMINUS", Key_Minus},
|
||||||
{ "KDIVIDE", Key_Slash },
|
{"KDIVIDE", Key_Slash},
|
||||||
{ "KMULTIPLY", Key_Asterisk },
|
{"KMULTIPLY", Key_Asterisk},
|
||||||
{ "KENTER", Key_Enter },
|
{"KENTER", Key_Enter},
|
||||||
{ "KPOINT", Key_Period },
|
{"KPOINT", Key_Period},
|
||||||
|
|
||||||
{ "CAPS", Key_CapsLock },
|
{"CAPS", Key_CapsLock},
|
||||||
{ "NUM", Key_NumLock },
|
{"NUM", Key_NumLock},
|
||||||
{ "SCROLL", Key_ScrollLock },
|
{"SCROLL", Key_ScrollLock},
|
||||||
{ "ALTGR", Key_AltGr }
|
{"ALTGR", Key_AltGr}
|
||||||
};
|
};
|
||||||
|
|
||||||
return k;
|
return k;
|
||||||
|
|||||||
@@ -326,9 +326,9 @@ QList<BuildStepInfo> GenericMakeStepFactory::availableSteps(BuildStepList *paren
|
|||||||
if (parent->target()->project()->id() != Constants::GENERICPROJECT_ID)
|
if (parent->target()->project()->id() != Constants::GENERICPROJECT_ID)
|
||||||
return {};
|
return {};
|
||||||
|
|
||||||
return {{ GENERIC_MS_ID,
|
return {{GENERIC_MS_ID,
|
||||||
QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
|
QCoreApplication::translate("GenericProjectManager::Internal::GenericMakeStep",
|
||||||
GENERIC_MS_DISPLAY_NAME) }};
|
GENERIC_MS_DISPLAY_NAME)}};
|
||||||
}
|
}
|
||||||
|
|
||||||
BuildStep *GenericMakeStepFactory::create(BuildStepList *parent, const Id id)
|
BuildStep *GenericMakeStepFactory::create(BuildStepList *parent, const Id id)
|
||||||
|
|||||||
@@ -110,7 +110,7 @@ QString GenericProjectWizardDialog::projectName() const
|
|||||||
|
|
||||||
GenericProjectWizard::GenericProjectWizard()
|
GenericProjectWizard::GenericProjectWizard()
|
||||||
{
|
{
|
||||||
setSupportedProjectTypes({ Constants::GENERICPROJECT_ID });
|
setSupportedProjectTypes({Constants::GENERICPROJECT_ID});
|
||||||
// TODO do something about the ugliness of standard icons in sizes different than 16, 32, 64, 128
|
// TODO do something about the ugliness of standard icons in sizes different than 16, 32, 64, 128
|
||||||
{
|
{
|
||||||
QPixmap icon(22, 22);
|
QPixmap icon(22, 22);
|
||||||
|
|||||||
@@ -336,7 +336,7 @@ void BranchDialog::log()
|
|||||||
QString branchName = m_model->fullName(selectedIndex(), true);
|
QString branchName = m_model->fullName(selectedIndex(), true);
|
||||||
if (branchName.isEmpty())
|
if (branchName.isEmpty())
|
||||||
return;
|
return;
|
||||||
GitPlugin::client()->log(m_repository, QString(), false, { branchName });
|
GitPlugin::client()->log(m_repository, QString(), false, {branchName});
|
||||||
}
|
}
|
||||||
|
|
||||||
void BranchDialog::reset()
|
void BranchDialog::reset()
|
||||||
|
|||||||
@@ -174,7 +174,7 @@ public:
|
|||||||
}
|
}
|
||||||
return names;
|
return names;
|
||||||
}
|
}
|
||||||
return { fullName().join('/') };
|
return {fullName().join('/')};
|
||||||
}
|
}
|
||||||
|
|
||||||
int rowOf(BranchNode *node)
|
int rowOf(BranchNode *node)
|
||||||
@@ -318,7 +318,7 @@ bool BranchModel::setData(const QModelIndex &index, const QVariant &value, int r
|
|||||||
QString output;
|
QString output;
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
if (!m_client->synchronousBranchCmd(m_workingDirectory,
|
if (!m_client->synchronousBranchCmd(m_workingDirectory,
|
||||||
{ "-m", oldFullName.last(), newFullName.last() },
|
{"-m", oldFullName.last(), newFullName.last()},
|
||||||
&output, &errorMessage)) {
|
&output, &errorMessage)) {
|
||||||
node->name = oldFullName.last();
|
node->name = oldFullName.last();
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
@@ -363,8 +363,8 @@ bool BranchModel::refresh(const QString &workingDirectory, QString *errorMessage
|
|||||||
}
|
}
|
||||||
|
|
||||||
m_currentSha = m_client->synchronousTopRevision(workingDirectory);
|
m_currentSha = m_client->synchronousTopRevision(workingDirectory);
|
||||||
const QStringList args = { "--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
|
const QStringList args = {"--format=%(objectname)\t%(refname)\t%(upstream:short)\t"
|
||||||
"%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)" };
|
"%(*objectname)\t%(committerdate:raw)\t%(*committerdate:raw)"};
|
||||||
QString output;
|
QString output;
|
||||||
if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage))
|
if (!m_client->synchronousForEachRefCmd(workingDirectory, args, &output, errorMessage))
|
||||||
VcsOutputWindow::appendError(*errorMessage);
|
VcsOutputWindow::appendError(*errorMessage);
|
||||||
@@ -403,7 +403,7 @@ void BranchModel::renameBranch(const QString &oldName, const QString &newName)
|
|||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QString output;
|
QString output;
|
||||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, { "-m", oldName, newName },
|
if (!m_client->synchronousBranchCmd(m_workingDirectory, {"-m", oldName, newName},
|
||||||
&output, &errorMessage))
|
&output, &errorMessage))
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
else
|
else
|
||||||
@@ -414,9 +414,9 @@ void BranchModel::renameTag(const QString &oldName, const QString &newName)
|
|||||||
{
|
{
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QString output;
|
QString output;
|
||||||
if (!m_client->synchronousTagCmd(m_workingDirectory, { newName, oldName },
|
if (!m_client->synchronousTagCmd(m_workingDirectory, {newName, oldName},
|
||||||
&output, &errorMessage)
|
&output, &errorMessage)
|
||||||
|| !m_client->synchronousTagCmd(m_workingDirectory, { "-d", oldName },
|
|| !m_client->synchronousTagCmd(m_workingDirectory, {"-d", oldName},
|
||||||
&output, &errorMessage)) {
|
&output, &errorMessage)) {
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
} else {
|
} else {
|
||||||
@@ -513,7 +513,7 @@ void BranchModel::removeBranch(const QModelIndex &idx)
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QString output;
|
QString output;
|
||||||
|
|
||||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, { "-D", branch }, &output, &errorMessage)) {
|
if (!m_client->synchronousBranchCmd(m_workingDirectory, {"-D", branch}, &output, &errorMessage)) {
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -529,7 +529,7 @@ void BranchModel::removeTag(const QModelIndex &idx)
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QString output;
|
QString output;
|
||||||
|
|
||||||
if (!m_client->synchronousTagCmd(m_workingDirectory, { "-d", tag }, &output, &errorMessage)) {
|
if (!m_client->synchronousTagCmd(m_workingDirectory, {"-d", tag}, &output, &errorMessage)) {
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -556,7 +556,7 @@ bool BranchModel::branchIsMerged(const QModelIndex &idx)
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QString output;
|
QString output;
|
||||||
|
|
||||||
if (!m_client->synchronousBranchCmd(m_workingDirectory, { "-a", "--contains", sha(idx) },
|
if (!m_client->synchronousBranchCmd(m_workingDirectory, {"-a", "--contains", sha(idx)},
|
||||||
&output, &errorMessage)) {
|
&output, &errorMessage)) {
|
||||||
VcsOutputWindow::appendError(errorMessage);
|
VcsOutputWindow::appendError(errorMessage);
|
||||||
}
|
}
|
||||||
@@ -594,7 +594,7 @@ QModelIndex BranchModel::addBranch(const QString &name, bool track, const QModel
|
|||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
QDateTime branchDateTime;
|
QDateTime branchDateTime;
|
||||||
|
|
||||||
QStringList args = { QLatin1String(track ? "--track" : "--no-track"), name };
|
QStringList args = {QLatin1String(track ? "--track" : "--no-track"), name};
|
||||||
if (!fullTrackedBranch.isEmpty()) {
|
if (!fullTrackedBranch.isEmpty()) {
|
||||||
args << fullTrackedBranch;
|
args << fullTrackedBranch;
|
||||||
startSha = sha(startPoint);
|
startSha = sha(startPoint);
|
||||||
|
|||||||
@@ -220,7 +220,7 @@ void ChangeSelectionDialog::recalculateCompletion()
|
|||||||
|
|
||||||
GitClient *client = GitPlugin::client();
|
GitClient *client = GitPlugin::client();
|
||||||
VcsBase::VcsCommand *command = client->asyncForEachRefCmd(
|
VcsBase::VcsCommand *command = client->asyncForEachRefCmd(
|
||||||
workingDir, { "--format=%(refname:short)" });
|
workingDir, {"--format=%(refname:short)"});
|
||||||
connect(this, &QObject::destroyed, command, &VcsBase::VcsCommand::abort);
|
connect(this, &QObject::destroyed, command, &VcsBase::VcsCommand::abort);
|
||||||
connect(command, &VcsBase::VcsCommand::stdOutText, [this](const QString &output) {
|
connect(command, &VcsBase::VcsCommand::stdOutText, [this](const QString &output) {
|
||||||
m_changeModel->setStringList(output.split('\n'));
|
m_changeModel->setStringList(output.split('\n'));
|
||||||
@@ -251,7 +251,7 @@ void ChangeSelectionDialog::recalculateDetails()
|
|||||||
connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
connect(m_process, static_cast<void (QProcess::*)(int)>(&QProcess::finished),
|
||||||
this, &ChangeSelectionDialog::setDetails);
|
this, &ChangeSelectionDialog::setDetails);
|
||||||
|
|
||||||
m_process->start(m_gitExecutable.toString(), { "show", "--stat=80", ref });
|
m_process->start(m_gitExecutable.toString(), {"show", "--stat=80", ref});
|
||||||
m_process->closeWriteChannel();
|
m_process->closeWriteChannel();
|
||||||
if (!m_process->waitForStarted())
|
if (!m_process->waitForStarted())
|
||||||
m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
|
m_ui->detailsText->setPlainText(tr("Error: Could not start Git."));
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void BranchComboBox::init(const QString &repository)
|
|||||||
QString output;
|
QString output;
|
||||||
const QString branchPrefix("refs/heads/");
|
const QString branchPrefix("refs/heads/");
|
||||||
if (!GitPlugin::client()->synchronousForEachRefCmd(
|
if (!GitPlugin::client()->synchronousForEachRefCmd(
|
||||||
m_repository, { "--format=%(refname)", branchPrefix }, &output)) {
|
m_repository, {"--format=%(refname)", branchPrefix}, &output)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const QStringList branches = output.trimmed().split('\n');
|
const QStringList branches = output.trimmed().split('\n');
|
||||||
|
|||||||
@@ -200,7 +200,7 @@ QString GerritChange::filterString() const
|
|||||||
|
|
||||||
QStringList GerritChange::gitFetchArguments(const GerritServer &server) const
|
QStringList GerritChange::gitFetchArguments(const GerritServer &server) const
|
||||||
{
|
{
|
||||||
return { "fetch", server.url() + '/' + project, currentPatchSet.ref };
|
return {"fetch", server.url() + '/' + project, currentPatchSet.ref};
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GerritChange::fullTitle() const
|
QString GerritChange::fullTitle() const
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ GerritOptionsWidget::GerritOptionsWidget(QWidget *parent)
|
|||||||
formLayout->addRow(tr("&Host:"), m_hostLineEdit);
|
formLayout->addRow(tr("&Host:"), m_hostLineEdit);
|
||||||
formLayout->addRow(tr("&User:"), m_userLineEdit);
|
formLayout->addRow(tr("&User:"), m_userLineEdit);
|
||||||
m_sshChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
m_sshChooser->setExpectedKind(Utils::PathChooser::ExistingCommand);
|
||||||
m_sshChooser->setCommandVersionArguments({ "-V" });
|
m_sshChooser->setCommandVersionArguments({"-V"});
|
||||||
m_sshChooser->setHistoryCompleter("Git.SshCommand.History");
|
m_sshChooser->setHistoryCompleter("Git.SshCommand.History");
|
||||||
formLayout->addRow(tr("&ssh:"), m_sshChooser);
|
formLayout->addRow(tr("&ssh:"), m_sshChooser);
|
||||||
m_portSpinBox->setMinimum(1);
|
m_portSpinBox->setMinimum(1);
|
||||||
|
|||||||
@@ -91,7 +91,7 @@ void GerritParameters::setPortFlagBySshType()
|
|||||||
{
|
{
|
||||||
bool isPlink = false;
|
bool isPlink = false;
|
||||||
if (!ssh.isEmpty()) {
|
if (!ssh.isEmpty()) {
|
||||||
const QString version = Utils::PathChooser::toolVersion(ssh, { "-V" });
|
const QString version = Utils::PathChooser::toolVersion(ssh, {"-V"});
|
||||||
isPlink = version.contains("plink", Qt::CaseInsensitive);
|
isPlink = version.contains("plink", Qt::CaseInsensitive);
|
||||||
}
|
}
|
||||||
portFlag = QLatin1String(isPlink ? "-P" : defaultPortFlag);
|
portFlag = QLatin1String(isPlink ? "-P" : defaultPortFlag);
|
||||||
|
|||||||
@@ -346,7 +346,7 @@ void GerritPlugin::push(const QString &topLevel)
|
|||||||
if (!options.isEmpty())
|
if (!options.isEmpty())
|
||||||
target += '%' + options.join(',');
|
target += '%' + options.join(',');
|
||||||
|
|
||||||
GitPlugin::client()->push(topLevel, { dialog.selectedRemoteName(), target });
|
GitPlugin::client()->push(topLevel, {dialog.selectedRemoteName(), target});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open or raise the Gerrit dialog window.
|
// Open or raise the Gerrit dialog window.
|
||||||
|
|||||||
@@ -66,7 +66,7 @@ QString GerritPushDialog::determineRemoteBranch(const QString &localBranch)
|
|||||||
QString error;
|
QString error;
|
||||||
|
|
||||||
if (!GitPlugin::client()->synchronousBranchCmd(
|
if (!GitPlugin::client()->synchronousBranchCmd(
|
||||||
m_workingDir, { "-r", "--contains", earliestCommit + '^' }, &output, &error)) {
|
m_workingDir, {"-r", "--contains", earliestCommit + '^'}, &output, &error)) {
|
||||||
return QString();
|
return QString();
|
||||||
}
|
}
|
||||||
const QString head = "/HEAD";
|
const QString head = "/HEAD";
|
||||||
@@ -99,7 +99,7 @@ void GerritPushDialog::initRemoteBranches()
|
|||||||
|
|
||||||
QString remotesPrefix("refs/remotes/");
|
QString remotesPrefix("refs/remotes/");
|
||||||
if (!GitPlugin::client()->synchronousForEachRefCmd(
|
if (!GitPlugin::client()->synchronousForEachRefCmd(
|
||||||
m_workingDir, { "--format=%(refname)\t%(committerdate:raw)", remotesPrefix }, &output)) {
|
m_workingDir, {"--format=%(refname)\t%(committerdate:raw)", remotesPrefix}, &output)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -207,7 +207,7 @@ QStringList BaseController::addHeadWhenCommandInProgress() const
|
|||||||
// instead of showing unsupported combined diff format.
|
// instead of showing unsupported combined diff format.
|
||||||
GitClient::CommandInProgress commandInProgress = GitPlugin::client()->checkCommandInProgress(m_directory);
|
GitClient::CommandInProgress commandInProgress = GitPlugin::client()->checkCommandInProgress(m_directory);
|
||||||
if (commandInProgress != GitClient::NoCommand)
|
if (commandInProgress != GitClient::NoCommand)
|
||||||
return { HEAD };
|
return {HEAD};
|
||||||
return QStringList();
|
return QStringList();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -224,7 +224,7 @@ public:
|
|||||||
|
|
||||||
void RepositoryDiffController::reload()
|
void RepositoryDiffController::reload()
|
||||||
{
|
{
|
||||||
QStringList args = { "diff" };
|
QStringList args = {"diff"};
|
||||||
args.append(addHeadWhenCommandInProgress());
|
args.append(addHeadWhenCommandInProgress());
|
||||||
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
||||||
}
|
}
|
||||||
@@ -246,7 +246,7 @@ private:
|
|||||||
|
|
||||||
void FileDiffController::reload()
|
void FileDiffController::reload()
|
||||||
{
|
{
|
||||||
QStringList args = { "diff" };
|
QStringList args = {"diff"};
|
||||||
args.append(addHeadWhenCommandInProgress());
|
args.append(addHeadWhenCommandInProgress());
|
||||||
args << "--" << m_fileName;
|
args << "--" << m_fileName;
|
||||||
|
|
||||||
@@ -275,13 +275,13 @@ void FileListDiffController::reload()
|
|||||||
{
|
{
|
||||||
QList<QStringList> argLists;
|
QList<QStringList> argLists;
|
||||||
if (!m_stagedFiles.isEmpty()) {
|
if (!m_stagedFiles.isEmpty()) {
|
||||||
QStringList stagedArgs = { "diff", "--cached", "--" };
|
QStringList stagedArgs = {"diff", "--cached", "--"};
|
||||||
stagedArgs << m_stagedFiles;
|
stagedArgs << m_stagedFiles;
|
||||||
argLists << addConfigurationArguments(stagedArgs);
|
argLists << addConfigurationArguments(stagedArgs);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!m_unstagedFiles.isEmpty()) {
|
if (!m_unstagedFiles.isEmpty()) {
|
||||||
QStringList unstagedArgs = { "diff" };
|
QStringList unstagedArgs = {"diff"};
|
||||||
unstagedArgs << addHeadWhenCommandInProgress() << "--" << m_unstagedFiles;
|
unstagedArgs << addHeadWhenCommandInProgress() << "--" << m_unstagedFiles;
|
||||||
argLists << addConfigurationArguments(unstagedArgs);
|
argLists << addConfigurationArguments(unstagedArgs);
|
||||||
}
|
}
|
||||||
@@ -308,7 +308,7 @@ private:
|
|||||||
|
|
||||||
void ProjectDiffController::reload()
|
void ProjectDiffController::reload()
|
||||||
{
|
{
|
||||||
QStringList args = { "diff" };
|
QStringList args = {"diff"};
|
||||||
args << addHeadWhenCommandInProgress() << "--" << m_projectPaths;
|
args << addHeadWhenCommandInProgress() << "--" << m_projectPaths;
|
||||||
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
||||||
}
|
}
|
||||||
@@ -331,7 +331,7 @@ private:
|
|||||||
|
|
||||||
void BranchDiffController::reload()
|
void BranchDiffController::reload()
|
||||||
{
|
{
|
||||||
QStringList args = { "diff" };
|
QStringList args = {"diff"};
|
||||||
args << addHeadWhenCommandInProgress() << m_branch;
|
args << addHeadWhenCommandInProgress() << m_branch;
|
||||||
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
||||||
}
|
}
|
||||||
@@ -358,7 +358,7 @@ private:
|
|||||||
|
|
||||||
void ShowController::reload()
|
void ShowController::reload()
|
||||||
{
|
{
|
||||||
const QStringList args = { "show", "-s", noColorOption, decorateOption, showFormatC, m_id };
|
const QStringList args = {"show", "-s", noColorOption, decorateOption, showFormatC, m_id};
|
||||||
m_state = GettingDescription;
|
m_state = GettingDescription;
|
||||||
runCommand(QList<QStringList>() << args, GitPlugin::client()->encoding(m_directory, "i18n.commitEncoding"));
|
runCommand(QList<QStringList>() << args, GitPlugin::client()->encoding(m_directory, "i18n.commitEncoding"));
|
||||||
}
|
}
|
||||||
@@ -377,8 +377,8 @@ void ShowController::reloadFinished(bool success)
|
|||||||
QTC_ASSERT(m_state != Idle, return);
|
QTC_ASSERT(m_state != Idle, return);
|
||||||
|
|
||||||
if (m_state == GettingDescription && success) {
|
if (m_state == GettingDescription && success) {
|
||||||
const QStringList args = { "show", "--format=format:", // omit header, already generated
|
const QStringList args = {"show", "--format=format:", // omit header, already generated
|
||||||
noColorOption, decorateOption, m_id };
|
noColorOption, decorateOption, m_id};
|
||||||
m_state = GettingDiff;
|
m_state = GettingDiff;
|
||||||
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
runCommand(QList<QStringList>() << addConfigurationArguments(args));
|
||||||
return;
|
return;
|
||||||
@@ -446,7 +446,7 @@ public:
|
|||||||
m_patienceButton->setVisible(diffButton->isChecked());
|
m_patienceButton->setVisible(diffButton->isChecked());
|
||||||
m_ignoreWSButton->setVisible(diffButton->isChecked());
|
m_ignoreWSButton->setVisible(diffButton->isChecked());
|
||||||
QAction *firstParentButton =
|
QAction *firstParentButton =
|
||||||
addToggleButton({ "-m", "--first-parent" },
|
addToggleButton({"-m", "--first-parent"},
|
||||||
tr("First Parent"),
|
tr("First Parent"),
|
||||||
tr("Follow only the first parent on merge commits."));
|
tr("Follow only the first parent on merge commits."));
|
||||||
mapSetting(firstParentButton, settings.boolPointer(GitSettings::firstParentKey));
|
mapSetting(firstParentButton, settings.boolPointer(GitSettings::firstParentKey));
|
||||||
@@ -631,7 +631,7 @@ QString GitClient::findGitDirForRepository(const QString &repositoryDir) const
|
|||||||
|
|
||||||
bool GitClient::managesFile(const QString &workingDirectory, const QString &fileName) const
|
bool GitClient::managesFile(const QString &workingDirectory, const QString &fileName) const
|
||||||
{
|
{
|
||||||
return vcsFullySynchronousExec(workingDirectory, { "ls-files", "--error-unmatch", fileName }).result
|
return vcsFullySynchronousExec(workingDirectory, {"ls-files", "--error-unmatch", fileName}).result
|
||||||
== SynchronousProcessResponse::Finished;
|
== SynchronousProcessResponse::Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -699,7 +699,7 @@ void GitClient::stage(const QString &patch, bool revert)
|
|||||||
patchFile.write(patchData);
|
patchFile.write(patchData);
|
||||||
patchFile.close();
|
patchFile.close();
|
||||||
|
|
||||||
QStringList args = { "--cached" };
|
QStringList args = {"--cached"};
|
||||||
if (revert)
|
if (revert)
|
||||||
args << "--reverse";
|
args << "--reverse";
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
@@ -767,7 +767,7 @@ void GitClient::diffProject(const QString &workingDirectory, const QString &proj
|
|||||||
workingDirectory, tr("Git Diff Project"),
|
workingDirectory, tr("Git Diff Project"),
|
||||||
[this, workingDirectory, projectDirectory]
|
[this, workingDirectory, projectDirectory]
|
||||||
(IDocument *doc) -> DiffEditorController* {
|
(IDocument *doc) -> DiffEditorController* {
|
||||||
return new ProjectDiffController(doc, workingDirectory, { projectDirectory });
|
return new ProjectDiffController(doc, workingDirectory, {projectDirectory});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -819,7 +819,7 @@ void GitClient::merge(const QString &workingDirectory,
|
|||||||
void GitClient::status(const QString &workingDirectory)
|
void GitClient::status(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
VcsOutputWindow::setRepository(workingDirectory);
|
VcsOutputWindow::setRepository(workingDirectory);
|
||||||
VcsCommand *command = vcsExec(workingDirectory, { "status", "-u" }, nullptr, true);
|
VcsCommand *command = vcsExec(workingDirectory, {"status", "-u"}, nullptr, true);
|
||||||
connect(command, &VcsCommand::finished, VcsOutputWindow::instance(), &VcsOutputWindow::clearRepository,
|
connect(command, &VcsCommand::finished, VcsOutputWindow::instance(), &VcsOutputWindow::clearRepository,
|
||||||
Qt::QueuedConnection);
|
Qt::QueuedConnection);
|
||||||
}
|
}
|
||||||
@@ -853,7 +853,7 @@ void GitClient::log(const QString &workingDirectory, const QString &fileName,
|
|||||||
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
|
editor->setFileLogAnnotateEnabled(enableAnnotationContextMenu);
|
||||||
editor->setWorkingDirectory(workingDir);
|
editor->setWorkingDirectory(workingDir);
|
||||||
|
|
||||||
QStringList arguments = { "log", noColorOption, decorateOption };
|
QStringList arguments = {"log", noColorOption, decorateOption};
|
||||||
int logCount = settings().intValue(GitSettings::logCountKey);
|
int logCount = settings().intValue(GitSettings::logCountKey);
|
||||||
if (logCount > 0)
|
if (logCount > 0)
|
||||||
arguments << "-n" << QString::number(logCount);
|
arguments << "-n" << QString::number(logCount);
|
||||||
@@ -874,7 +874,7 @@ void GitClient::reflog(const QString &workingDirectory)
|
|||||||
"reflogRepository", workingDirectory);
|
"reflogRepository", workingDirectory);
|
||||||
editor->setWorkingDirectory(workingDirectory);
|
editor->setWorkingDirectory(workingDirectory);
|
||||||
|
|
||||||
QStringList arguments = { "reflog", noColorOption, decorateOption };
|
QStringList arguments = {"reflog", noColorOption, decorateOption};
|
||||||
int logCount = settings().intValue(GitSettings::logCountKey);
|
int logCount = settings().intValue(GitSettings::logCountKey);
|
||||||
if (logCount > 0)
|
if (logCount > 0)
|
||||||
arguments << "-n" << QString::number(logCount);
|
arguments << "-n" << QString::number(logCount);
|
||||||
@@ -921,7 +921,7 @@ VcsBaseEditorWidget *GitClient::annotate(
|
|||||||
int lineNumber, const QStringList &extraOptions)
|
int lineNumber, const QStringList &extraOptions)
|
||||||
{
|
{
|
||||||
const Id editorId = Git::Constants::GIT_BLAME_EDITOR_ID;
|
const Id editorId = Git::Constants::GIT_BLAME_EDITOR_ID;
|
||||||
const QString id = VcsBaseEditor::getTitleId(workingDir, { file }, revision);
|
const QString id = VcsBaseEditor::getTitleId(workingDir, {file}, revision);
|
||||||
const QString title = tr("Git Blame \"%1\"").arg(id);
|
const QString title = tr("Git Blame \"%1\"").arg(id);
|
||||||
const QString sourceFile = VcsBaseEditor::getSource(workingDir, file);
|
const QString sourceFile = VcsBaseEditor::getSource(workingDir, file);
|
||||||
|
|
||||||
@@ -942,7 +942,7 @@ VcsBaseEditorWidget *GitClient::annotate(
|
|||||||
}
|
}
|
||||||
|
|
||||||
editor->setWorkingDirectory(workingDir);
|
editor->setWorkingDirectory(workingDir);
|
||||||
QStringList arguments = { "blame", "--root" };
|
QStringList arguments = {"blame", "--root"};
|
||||||
arguments << effectiveArgs << "--" << file;
|
arguments << effectiveArgs << "--" << file;
|
||||||
if (!revision.isEmpty())
|
if (!revision.isEmpty())
|
||||||
arguments << revision;
|
arguments << revision;
|
||||||
@@ -971,7 +971,7 @@ bool GitClient::synchronousCheckout(const QString &workingDirectory,
|
|||||||
QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
|
QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
|
||||||
const QString &ref)
|
const QString &ref)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "checkout", ref };
|
QStringList arguments = {"checkout", ref};
|
||||||
|
|
||||||
QStringList localBranches = synchronousRepositoryBranches(workingDirectory);
|
QStringList localBranches = synchronousRepositoryBranches(workingDirectory);
|
||||||
if (localBranches.contains(ref))
|
if (localBranches.contains(ref))
|
||||||
@@ -996,7 +996,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
|
|||||||
return arguments;
|
return arguments;
|
||||||
|
|
||||||
QString output;
|
QString output;
|
||||||
const QStringList forEachRefArgs = { "refs/remotes/", "--format=%(objectname) %(refname:short)" };
|
const QStringList forEachRefArgs = {"refs/remotes/", "--format=%(objectname) %(refname:short)"};
|
||||||
if (!synchronousForEachRefCmd(workingDirectory, forEachRefArgs, &output))
|
if (!synchronousForEachRefCmd(workingDirectory, forEachRefArgs, &output))
|
||||||
return arguments;
|
return arguments;
|
||||||
|
|
||||||
@@ -1033,7 +1033,7 @@ QStringList GitClient::setupCheckoutArguments(const QString &workingDirectory,
|
|||||||
|
|
||||||
void GitClient::reset(const QString &workingDirectory, const QString &argument, const QString &commit)
|
void GitClient::reset(const QString &workingDirectory, const QString &argument, const QString &commit)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "reset", argument };
|
QStringList arguments = {"reset", argument};
|
||||||
if (!commit.isEmpty())
|
if (!commit.isEmpty())
|
||||||
arguments << commit;
|
arguments << commit;
|
||||||
|
|
||||||
@@ -1055,13 +1055,13 @@ void GitClient::reset(const QString &workingDirectory, const QString &argument,
|
|||||||
|
|
||||||
void GitClient::addFile(const QString &workingDirectory, const QString &fileName)
|
void GitClient::addFile(const QString &workingDirectory, const QString &fileName)
|
||||||
{
|
{
|
||||||
vcsExec(workingDirectory, { "add", fileName });
|
vcsExec(workingDirectory, {"add", fileName});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::synchronousLog(const QString &workingDirectory, const QStringList &arguments,
|
bool GitClient::synchronousLog(const QString &workingDirectory, const QStringList &arguments,
|
||||||
QString *output, QString *errorMessageIn, unsigned flags)
|
QString *output, QString *errorMessageIn, unsigned flags)
|
||||||
{
|
{
|
||||||
QStringList allArguments = { "log", noColorOption };
|
QStringList allArguments = {"log", noColorOption};
|
||||||
|
|
||||||
allArguments.append(arguments);
|
allArguments.append(arguments);
|
||||||
|
|
||||||
@@ -1080,7 +1080,7 @@ bool GitClient::synchronousLog(const QString &workingDirectory, const QStringLis
|
|||||||
|
|
||||||
bool GitClient::synchronousAdd(const QString &workingDirectory, const QStringList &files)
|
bool GitClient::synchronousAdd(const QString &workingDirectory, const QStringList &files)
|
||||||
{
|
{
|
||||||
return vcsFullySynchronousExec(workingDirectory, QStringList({ "add" }) + files).result
|
return vcsFullySynchronousExec(workingDirectory, QStringList({"add"}) + files).result
|
||||||
== SynchronousProcessResponse::Finished;
|
== SynchronousProcessResponse::Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1088,7 +1088,7 @@ bool GitClient::synchronousDelete(const QString &workingDirectory,
|
|||||||
bool force,
|
bool force,
|
||||||
const QStringList &files)
|
const QStringList &files)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "rm" };
|
QStringList arguments = {"rm"};
|
||||||
if (force)
|
if (force)
|
||||||
arguments << "--force";
|
arguments << "--force";
|
||||||
arguments.append(files);
|
arguments.append(files);
|
||||||
@@ -1100,7 +1100,7 @@ bool GitClient::synchronousMove(const QString &workingDirectory,
|
|||||||
const QString &from,
|
const QString &from,
|
||||||
const QString &to)
|
const QString &to)
|
||||||
{
|
{
|
||||||
return vcsFullySynchronousExec(workingDirectory, { "mv", from, to }).result
|
return vcsFullySynchronousExec(workingDirectory, {"mv", from, to}).result
|
||||||
== SynchronousProcessResponse::Finished;
|
== SynchronousProcessResponse::Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1108,7 +1108,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
|
|||||||
const QStringList &files,
|
const QStringList &files,
|
||||||
QString *errorMessage)
|
QString *errorMessage)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "reset" };
|
QStringList arguments = {"reset"};
|
||||||
if (files.isEmpty())
|
if (files.isEmpty())
|
||||||
arguments << "--hard";
|
arguments << "--hard";
|
||||||
else
|
else
|
||||||
@@ -1137,7 +1137,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
|
|||||||
// Initialize repository
|
// Initialize repository
|
||||||
bool GitClient::synchronousInit(const QString &workingDirectory)
|
bool GitClient::synchronousInit(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, { "init" });
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, {"init"});
|
||||||
// '[Re]Initialized...'
|
// '[Re]Initialized...'
|
||||||
VcsOutputWindow::append(resp.stdOut());
|
VcsOutputWindow::append(resp.stdOut());
|
||||||
if (resp.result == SynchronousProcessResponse::Finished) {
|
if (resp.result == SynchronousProcessResponse::Finished) {
|
||||||
@@ -1160,7 +1160,7 @@ bool GitClient::synchronousCheckoutFiles(const QString &workingDirectory, QStrin
|
|||||||
revision = HEAD;
|
revision = HEAD;
|
||||||
if (files.isEmpty())
|
if (files.isEmpty())
|
||||||
files = QStringList(".");
|
files = QStringList(".");
|
||||||
QStringList arguments = { "checkout" };
|
QStringList arguments = {"checkout"};
|
||||||
if (revertStaging)
|
if (revertStaging)
|
||||||
arguments << revision;
|
arguments << revision;
|
||||||
arguments << "--" << files;
|
arguments << "--" << files;
|
||||||
@@ -1224,7 +1224,7 @@ static inline bool splitCommitParents(const QString &line,
|
|||||||
bool GitClient::synchronousRevListCmd(const QString &workingDirectory, const QStringList &extraArguments,
|
bool GitClient::synchronousRevListCmd(const QString &workingDirectory, const QStringList &extraArguments,
|
||||||
QString *output, QString *errorMessage) const
|
QString *output, QString *errorMessage) const
|
||||||
{
|
{
|
||||||
const QStringList arguments = QStringList({ "rev-list", noColorOption }) + extraArguments;
|
const QStringList arguments = QStringList({"rev-list", noColorOption}) + extraArguments;
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDirectory, arguments, silentFlags);
|
workingDirectory, arguments, silentFlags);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
@@ -1248,7 +1248,7 @@ bool GitClient::synchronousParentRevisions(const QString &workingDirectory,
|
|||||||
}
|
}
|
||||||
QString outputText;
|
QString outputText;
|
||||||
QString errorText;
|
QString errorText;
|
||||||
if (!synchronousRevListCmd(workingDirectory, { "--parents", "--max-count=1", revision },
|
if (!synchronousRevListCmd(workingDirectory, {"--parents", "--max-count=1", revision},
|
||||||
&outputText, &errorText)) {
|
&outputText, &errorText)) {
|
||||||
*errorMessage = msgParentRevisionFailed(workingDirectory, revision, errorText);
|
*errorMessage = msgParentRevisionFailed(workingDirectory, revision, errorText);
|
||||||
return false;
|
return false;
|
||||||
@@ -1285,7 +1285,7 @@ QString GitClient::synchronousCurrentLocalBranch(const QString &workingDirectory
|
|||||||
{
|
{
|
||||||
QString branch;
|
QString branch;
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDirectory, { "symbolic-ref", HEAD }, silentFlags);
|
workingDirectory, {"symbolic-ref", HEAD}, silentFlags);
|
||||||
if (resp.result == SynchronousProcessResponse::Finished) {
|
if (resp.result == SynchronousProcessResponse::Finished) {
|
||||||
branch = resp.stdOut().trimmed();
|
branch = resp.stdOut().trimmed();
|
||||||
} else {
|
} else {
|
||||||
@@ -1308,7 +1308,7 @@ QString GitClient::synchronousCurrentLocalBranch(const QString &workingDirectory
|
|||||||
bool GitClient::synchronousHeadRefs(const QString &workingDirectory, QStringList *output,
|
bool GitClient::synchronousHeadRefs(const QString &workingDirectory, QStringList *output,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
const QStringList arguments = { "show-ref", "--head", "--abbrev=10", "--dereference" };
|
const QStringList arguments = {"show-ref", "--head", "--abbrev=10", "--dereference"};
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDirectory, arguments, silentFlags);
|
workingDirectory, arguments, silentFlags);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
@@ -1359,7 +1359,7 @@ QString GitClient::synchronousTopic(const QString &workingDirectory) const
|
|||||||
|
|
||||||
// No tag or remote branch - try git describe
|
// No tag or remote branch - try git describe
|
||||||
const SynchronousProcessResponse resp =
|
const SynchronousProcessResponse resp =
|
||||||
vcsFullySynchronousExec(workingDirectory, { "describe" }, VcsCommand::NoOutput);
|
vcsFullySynchronousExec(workingDirectory, {"describe"}, VcsCommand::NoOutput);
|
||||||
if (resp.result == SynchronousProcessResponse::Finished) {
|
if (resp.result == SynchronousProcessResponse::Finished) {
|
||||||
const QString stdOut = resp.stdOut().trimmed();
|
const QString stdOut = resp.stdOut().trimmed();
|
||||||
if (!stdOut.isEmpty())
|
if (!stdOut.isEmpty())
|
||||||
@@ -1371,7 +1371,7 @@ QString GitClient::synchronousTopic(const QString &workingDirectory) const
|
|||||||
bool GitClient::synchronousRevParseCmd(const QString &workingDirectory, const QString &ref,
|
bool GitClient::synchronousRevParseCmd(const QString &workingDirectory, const QString &ref,
|
||||||
QString *output, QString *errorMessage) const
|
QString *output, QString *errorMessage) const
|
||||||
{
|
{
|
||||||
const QStringList arguments = { "rev-parse", ref };
|
const QStringList arguments = {"rev-parse", ref};
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDirectory, arguments, silentFlags);
|
workingDirectory, arguments, silentFlags);
|
||||||
*output = resp.stdOut().trimmed();
|
*output = resp.stdOut().trimmed();
|
||||||
@@ -1397,7 +1397,7 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
|
|||||||
QString &precedes, QString &follows) const
|
QString &precedes, QString &follows) const
|
||||||
{
|
{
|
||||||
const SynchronousProcessResponse resp1 = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp1 = vcsFullySynchronousExec(
|
||||||
workingDirectory, { "describe", "--contains", revision }, silentFlags);
|
workingDirectory, {"describe", "--contains", revision}, silentFlags);
|
||||||
precedes = resp1.stdOut();
|
precedes = resp1.stdOut();
|
||||||
int tilde = precedes.indexOf('~');
|
int tilde = precedes.indexOf('~');
|
||||||
if (tilde != -1)
|
if (tilde != -1)
|
||||||
@@ -1410,7 +1410,7 @@ void GitClient::synchronousTagsForCommit(const QString &workingDirectory, const
|
|||||||
synchronousParentRevisions(workingDirectory, revision, &parents, &errorMessage);
|
synchronousParentRevisions(workingDirectory, revision, &parents, &errorMessage);
|
||||||
for (const QString &p : Utils::asConst(parents)) {
|
for (const QString &p : Utils::asConst(parents)) {
|
||||||
const SynchronousProcessResponse resp2 = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp2 = vcsFullySynchronousExec(
|
||||||
workingDirectory, { "describe", "--tags", "--abbrev=0", p }, silentFlags);
|
workingDirectory, {"describe", "--tags", "--abbrev=0", p}, silentFlags);
|
||||||
QString pf = resp2.stdOut();
|
QString pf = resp2.stdOut();
|
||||||
pf.truncate(pf.lastIndexOf('\n'));
|
pf.truncate(pf.lastIndexOf('\n'));
|
||||||
if (!pf.isEmpty()) {
|
if (!pf.isEmpty()) {
|
||||||
@@ -1426,7 +1426,7 @@ void GitClient::branchesForCommit(const QString &revision)
|
|||||||
auto controller = qobject_cast<DiffEditorController *>(sender());
|
auto controller = qobject_cast<DiffEditorController *>(sender());
|
||||||
QString workingDirectory = controller->baseDirectory();
|
QString workingDirectory = controller->baseDirectory();
|
||||||
VcsCommand *command = vcsExec(
|
VcsCommand *command = vcsExec(
|
||||||
workingDirectory, { "branch", noColorOption, "-a", "--contains", revision}, nullptr,
|
workingDirectory, {"branch", noColorOption, "-a", "--contains", revision}, nullptr,
|
||||||
false, 0, workingDirectory);
|
false, 0, workingDirectory);
|
||||||
connect(command, &VcsCommand::stdOutText, controller,
|
connect(command, &VcsCommand::stdOutText, controller,
|
||||||
&DiffEditorController::informationForCommitReceived);
|
&DiffEditorController::informationForCommitReceived);
|
||||||
@@ -1435,13 +1435,13 @@ void GitClient::branchesForCommit(const QString &revision)
|
|||||||
bool GitClient::isRemoteCommit(const QString &workingDirectory, const QString &commit)
|
bool GitClient::isRemoteCommit(const QString &workingDirectory, const QString &commit)
|
||||||
{
|
{
|
||||||
return !vcsFullySynchronousExec(
|
return !vcsFullySynchronousExec(
|
||||||
workingDirectory, { "branch", "-r", "--contains", commit }, silentFlags).rawStdOut.isEmpty();
|
workingDirectory, {"branch", "-r", "--contains", commit}, silentFlags).rawStdOut.isEmpty();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::isFastForwardMerge(const QString &workingDirectory, const QString &branch)
|
bool GitClient::isFastForwardMerge(const QString &workingDirectory, const QString &branch)
|
||||||
{
|
{
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDirectory, { "merge-base", HEAD, branch }, silentFlags);
|
workingDirectory, {"merge-base", HEAD, branch}, silentFlags);
|
||||||
return resp.stdOut().trimmed() == synchronousTopRevision(workingDirectory);
|
return resp.stdOut().trimmed() == synchronousTopRevision(workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1449,8 +1449,8 @@ bool GitClient::isFastForwardMerge(const QString &workingDirectory, const QStrin
|
|||||||
QString GitClient::synchronousShortDescription(const QString &workingDirectory, const QString &revision,
|
QString GitClient::synchronousShortDescription(const QString &workingDirectory, const QString &revision,
|
||||||
const QString &format) const
|
const QString &format) const
|
||||||
{
|
{
|
||||||
const QStringList arguments = { "log", noColorOption, ("--pretty=format:" + format),
|
const QStringList arguments = {"log", noColorOption, ("--pretty=format:" + format),
|
||||||
"--max-count=1", revision };
|
"--max-count=1", revision};
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDirectory, arguments, silentFlags);
|
workingDirectory, arguments, silentFlags);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
@@ -1524,7 +1524,7 @@ bool GitClient::executeSynchronousStash(const QString &workingDirectory,
|
|||||||
bool unstagedOnly,
|
bool unstagedOnly,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
QStringList arguments = { "stash", "save" };
|
QStringList arguments = {"stash", "save"};
|
||||||
if (unstagedOnly)
|
if (unstagedOnly)
|
||||||
arguments << "--keep-index";
|
arguments << "--keep-index";
|
||||||
if (!message.isEmpty())
|
if (!message.isEmpty())
|
||||||
@@ -1638,7 +1638,7 @@ QMap<QString,QString> GitClient::synchronousRemotesList(const QString &workingDi
|
|||||||
|
|
||||||
QString output;
|
QString output;
|
||||||
QString error;
|
QString error;
|
||||||
if (!synchronousRemoteCmd(workingDirectory, { "-v" }, &output, &error, true)) {
|
if (!synchronousRemoteCmd(workingDirectory, {"-v"}, &output, &error, true)) {
|
||||||
msgCannotRun(error, errorMessage);
|
msgCannotRun(error, errorMessage);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
@@ -1662,7 +1662,7 @@ QStringList GitClient::synchronousSubmoduleStatus(const QString &workingDirector
|
|||||||
{
|
{
|
||||||
// get submodule status
|
// get submodule status
|
||||||
const SynchronousProcessResponse resp =
|
const SynchronousProcessResponse resp =
|
||||||
vcsFullySynchronousExec(workingDirectory, { "submodule", "status" }, silentFlags);
|
vcsFullySynchronousExec(workingDirectory, {"submodule", "status"}, silentFlags);
|
||||||
|
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
|
msgCannotRun(tr("Cannot retrieve submodule status of \"%1\": %2")
|
||||||
@@ -1741,7 +1741,7 @@ bool GitClient::synchronousShow(const QString &workingDirectory, const QString &
|
|||||||
*errorMessage = msgCannotShow(id);
|
*errorMessage = msgCannotShow(id);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
const QStringList arguments = { "show", decorateOption, noColorOption, id };
|
const QStringList arguments = {"show", decorateOption, noColorOption, id};
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
|
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
|
||||||
@@ -1756,7 +1756,7 @@ bool GitClient::cleanList(const QString &workingDirectory, const QString &module
|
|||||||
const QString &flag, QStringList *files, QString *errorMessage)
|
const QString &flag, QStringList *files, QString *errorMessage)
|
||||||
{
|
{
|
||||||
const QString directory = workingDirectory + '/' + modulePath;
|
const QString directory = workingDirectory + '/' + modulePath;
|
||||||
const QStringList arguments = { "clean", "--dry-run", flag };
|
const QStringList arguments = {"clean", "--dry-run", flag};
|
||||||
|
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(directory, arguments);
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(directory, arguments);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
@@ -1801,7 +1801,7 @@ bool GitClient::synchronousApplyPatch(const QString &workingDirectory,
|
|||||||
const QString &file, QString *errorMessage,
|
const QString &file, QString *errorMessage,
|
||||||
const QStringList &extraArguments)
|
const QStringList &extraArguments)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "apply", "--whitespace=fix" };
|
QStringList arguments = {"apply", "--whitespace=fix"};
|
||||||
arguments << extraArguments << file;
|
arguments << extraArguments << file;
|
||||||
|
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
|
||||||
@@ -1913,7 +1913,7 @@ void GitClient::updateSubmodulesIfNeeded(const QString &workingDirectory, bool p
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VcsCommand *cmd = vcsExec(workingDirectory, { "submodule", "update" }, nullptr, true,
|
VcsCommand *cmd = vcsExec(workingDirectory, {"submodule", "update"}, nullptr, true,
|
||||||
VcsCommand::ExpectRepoChanges);
|
VcsCommand::ExpectRepoChanges);
|
||||||
connect(cmd, &VcsCommand::finished, this, &GitClient::finishSubmoduleUpdate);
|
connect(cmd, &VcsCommand::finished, this, &GitClient::finishSubmoduleUpdate);
|
||||||
}
|
}
|
||||||
@@ -1929,7 +1929,7 @@ GitClient::StatusResult GitClient::gitStatus(const QString &workingDirectory, St
|
|||||||
QString *output, QString *errorMessage) const
|
QString *output, QString *errorMessage) const
|
||||||
{
|
{
|
||||||
// Run 'status'. Note that git returns exitcode 1 if there are no added files.
|
// Run 'status'. Note that git returns exitcode 1 if there are no added files.
|
||||||
QStringList arguments = { "status" };
|
QStringList arguments = {"status"};
|
||||||
if (mode & NoUntracked)
|
if (mode & NoUntracked)
|
||||||
arguments << "--untracked-files=no";
|
arguments << "--untracked-files=no";
|
||||||
else
|
else
|
||||||
@@ -2107,7 +2107,7 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
|
|||||||
| VcsCommand::SuppressStdErr
|
| VcsCommand::SuppressStdErr
|
||||||
| VcsCommand::SuppressFailMessage;
|
| VcsCommand::SuppressFailMessage;
|
||||||
const SynchronousProcessResponse resp = vcsSynchronousExec(
|
const SynchronousProcessResponse resp = vcsSynchronousExec(
|
||||||
workingDirectory, { "ls-remote", repositoryURL, HEAD, "refs/heads/*" }, flags);
|
workingDirectory, {"ls-remote", repositoryURL, HEAD, "refs/heads/*"}, flags);
|
||||||
QStringList branches;
|
QStringList branches;
|
||||||
branches << tr("<Detached HEAD>");
|
branches << tr("<Detached HEAD>");
|
||||||
QString headSha;
|
QString headSha;
|
||||||
@@ -2177,7 +2177,7 @@ void GitClient::launchRepositoryBrowser(const QString &workingDirectory)
|
|||||||
{
|
{
|
||||||
const QString repBrowserBinary = settings().stringValue(GitSettings::repositoryBrowserCmd);
|
const QString repBrowserBinary = settings().stringValue(GitSettings::repositoryBrowserCmd);
|
||||||
if (!repBrowserBinary.isEmpty())
|
if (!repBrowserBinary.isEmpty())
|
||||||
QProcess::startDetached(repBrowserBinary, { workingDirectory }, workingDirectory);
|
QProcess::startDetached(repBrowserBinary, {workingDirectory}, workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
bool GitClient::tryLauchingGitK(const QProcessEnvironment &env,
|
||||||
@@ -2228,7 +2228,7 @@ bool GitClient::launchGitGui(const QString &workingDirectory) {
|
|||||||
if (gitBinary.isEmpty()) {
|
if (gitBinary.isEmpty()) {
|
||||||
success = false;
|
success = false;
|
||||||
} else {
|
} else {
|
||||||
success = QProcess::startDetached(gitBinary.toString(), { "gui" },
|
success = QProcess::startDetached(gitBinary.toString(), {"gui"},
|
||||||
workingDirectory);
|
workingDirectory);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2289,7 +2289,7 @@ bool GitClient::readDataFromCommit(const QString &repoDirectory, const QString &
|
|||||||
QString *commitTemplate)
|
QString *commitTemplate)
|
||||||
{
|
{
|
||||||
// Get commit data as "SHA1<lf>author<lf>email<lf>message".
|
// Get commit data as "SHA1<lf>author<lf>email<lf>message".
|
||||||
const QStringList arguments = { "log", "--max-count=1", "--pretty=format:%h\n%an\n%ae\n%B", commit };
|
const QStringList arguments = {"log", "--max-count=1", "--pretty=format:%h\n%an\n%ae\n%B", commit};
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(repoDirectory, arguments, silentFlags);
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(repoDirectory, arguments, silentFlags);
|
||||||
|
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
@@ -2337,7 +2337,7 @@ bool GitClient::getCommitData(const QString &workingDirectory,
|
|||||||
// Run status. Note that it has exitcode 1 if there are no added files.
|
// Run status. Note that it has exitcode 1 if there are no added files.
|
||||||
QString output;
|
QString output;
|
||||||
if (commitData.commitType == FixupCommit) {
|
if (commitData.commitType == FixupCommit) {
|
||||||
synchronousLog(repoDirectory, { HEAD, "--not", "--remotes", "-n1" }, &output, errorMessage);
|
synchronousLog(repoDirectory, {HEAD, "--not", "--remotes", "-n1"}, &output, errorMessage);
|
||||||
if (output.isEmpty()) {
|
if (output.isEmpty()) {
|
||||||
*errorMessage = msgNoCommits(false);
|
*errorMessage = msgNoCommits(false);
|
||||||
return false;
|
return false;
|
||||||
@@ -2529,7 +2529,7 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory,
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Do the final commit
|
// Do the final commit
|
||||||
QStringList arguments = { "commit" };
|
QStringList arguments = {"commit"};
|
||||||
if (commitType == FixupCommit) {
|
if (commitType == FixupCommit) {
|
||||||
arguments << "--fixup" << amendSHA1;
|
arguments << "--fixup" << amendSHA1;
|
||||||
} else {
|
} else {
|
||||||
@@ -2668,7 +2668,7 @@ void GitClient::revert(const QStringList &files, bool revertStaging)
|
|||||||
|
|
||||||
void GitClient::fetch(const QString &workingDirectory, const QString &remote)
|
void GitClient::fetch(const QString &workingDirectory, const QString &remote)
|
||||||
{
|
{
|
||||||
QStringList const arguments = { "fetch", (remote.isEmpty() ? "--all" : remote) };
|
QStringList const arguments = {"fetch", (remote.isEmpty() ? "--all" : remote)};
|
||||||
VcsCommand *command = vcsExec(workingDirectory, arguments, nullptr, true,
|
VcsCommand *command = vcsExec(workingDirectory, arguments, nullptr, true,
|
||||||
VcsCommand::ShowSuccessMessage);
|
VcsCommand::ShowSuccessMessage);
|
||||||
connect(command, &VcsCommand::success,
|
connect(command, &VcsCommand::success,
|
||||||
@@ -2693,7 +2693,7 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory,
|
|||||||
bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
|
bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
|
||||||
{
|
{
|
||||||
QString abortCommand;
|
QString abortCommand;
|
||||||
QStringList arguments = { "pull" };
|
QStringList arguments = {"pull"};
|
||||||
if (rebase) {
|
if (rebase) {
|
||||||
arguments << "--rebase";
|
arguments << "--rebase";
|
||||||
abortCommand = "rebase";
|
abortCommand = "rebase";
|
||||||
@@ -2720,7 +2720,7 @@ void GitClient::synchronousAbortCommand(const QString &workingDir, const QString
|
|||||||
}
|
}
|
||||||
|
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(
|
||||||
workingDir, { abortCommand, "--abort" },
|
workingDir, {abortCommand, "--abort"},
|
||||||
VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage);
|
VcsCommand::ExpectRepoChanges | VcsCommand::ShowSuccessMessage);
|
||||||
VcsOutputWindow::append(resp.stdOut());
|
VcsOutputWindow::append(resp.stdOut());
|
||||||
}
|
}
|
||||||
@@ -2746,7 +2746,7 @@ bool GitClient::synchronousSetTrackingBranch(const QString &workingDirectory,
|
|||||||
const QString &branch, const QString &tracking)
|
const QString &branch, const QString &tracking)
|
||||||
{
|
{
|
||||||
return vcsFullySynchronousExec(
|
return vcsFullySynchronousExec(
|
||||||
workingDirectory, { "branch", "--set-upstream-to=" + tracking, branch }).result
|
workingDirectory, {"branch", "--set-upstream-to=" + tracking, branch}).result
|
||||||
== SynchronousProcessResponse::Finished;
|
== SynchronousProcessResponse::Finished;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2787,7 +2787,7 @@ void GitClient::handleMergeConflicts(const QString &workingDir, const QString &c
|
|||||||
if (mergeOrAbort.clickedButton() == mergeToolButton)
|
if (mergeOrAbort.clickedButton() == mergeToolButton)
|
||||||
merge(workingDir);
|
merge(workingDir);
|
||||||
else if (!abortCommand.isEmpty())
|
else if (!abortCommand.isEmpty())
|
||||||
executeAndHandleConflicts(workingDir, { abortCommand, "--skip" }, abortCommand);
|
executeAndHandleConflicts(workingDir, {abortCommand, "--skip"}, abortCommand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2803,12 +2803,12 @@ void GitClient::synchronousSubversionFetch(const QString &workingDirectory)
|
|||||||
const unsigned flags = VcsCommand::SshPasswordPrompt
|
const unsigned flags = VcsCommand::SshPasswordPrompt
|
||||||
| VcsCommand::ShowStdOut
|
| VcsCommand::ShowStdOut
|
||||||
| VcsCommand::ShowSuccessMessage;
|
| VcsCommand::ShowSuccessMessage;
|
||||||
vcsSynchronousExec(workingDirectory, { "svn", "fetch" }, flags);
|
vcsSynchronousExec(workingDirectory, {"svn", "fetch"}, flags);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::subversionLog(const QString &workingDirectory)
|
void GitClient::subversionLog(const QString &workingDirectory)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "svn", "log" };
|
QStringList arguments = {"svn", "log"};
|
||||||
int logCount = settings().intValue(GitSettings::logCountKey);
|
int logCount = settings().intValue(GitSettings::logCountKey);
|
||||||
if (logCount > 0)
|
if (logCount > 0)
|
||||||
arguments << ("--limit=" + QString::number(logCount));
|
arguments << ("--limit=" + QString::number(logCount));
|
||||||
@@ -2825,14 +2825,14 @@ void GitClient::subversionLog(const QString &workingDirectory)
|
|||||||
|
|
||||||
void GitClient::push(const QString &workingDirectory, const QStringList &pushArgs)
|
void GitClient::push(const QString &workingDirectory, const QStringList &pushArgs)
|
||||||
{
|
{
|
||||||
vcsExec(workingDirectory, QStringList({ "push" }) + pushArgs, nullptr, true);
|
vcsExec(workingDirectory, QStringList({"push"}) + pushArgs, nullptr, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::synchronousMerge(const QString &workingDirectory, const QString &branch,
|
bool GitClient::synchronousMerge(const QString &workingDirectory, const QString &branch,
|
||||||
bool allowFastForward)
|
bool allowFastForward)
|
||||||
{
|
{
|
||||||
QString command = "merge";
|
QString command = "merge";
|
||||||
QStringList arguments = { command };
|
QStringList arguments = {command};
|
||||||
if (!allowFastForward)
|
if (!allowFastForward)
|
||||||
arguments << "--no-ff";
|
arguments << "--no-ff";
|
||||||
arguments << branch;
|
arguments << branch;
|
||||||
@@ -2854,18 +2854,18 @@ bool GitClient::canRebase(const QString &workingDirectory) const
|
|||||||
|
|
||||||
void GitClient::rebase(const QString &workingDirectory, const QString &argument)
|
void GitClient::rebase(const QString &workingDirectory, const QString &argument)
|
||||||
{
|
{
|
||||||
VcsCommand *command = vcsExecAbortable(workingDirectory, { "rebase", argument });
|
VcsCommand *command = vcsExecAbortable(workingDirectory, {"rebase", argument});
|
||||||
GitProgressParser::attachToCommand(command);
|
GitProgressParser::attachToCommand(command);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::cherryPick(const QString &workingDirectory, const QString &argument)
|
void GitClient::cherryPick(const QString &workingDirectory, const QString &argument)
|
||||||
{
|
{
|
||||||
vcsExecAbortable(workingDirectory, { "cherry-pick", argument });
|
vcsExecAbortable(workingDirectory, {"cherry-pick", argument});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::revert(const QString &workingDirectory, const QString &argument)
|
void GitClient::revert(const QString &workingDirectory, const QString &argument)
|
||||||
{
|
{
|
||||||
vcsExecAbortable(workingDirectory, { "revert", argument });
|
vcsExecAbortable(workingDirectory, {"revert", argument});
|
||||||
}
|
}
|
||||||
|
|
||||||
// Executes a command asynchronously. Work tree is expected to be clean.
|
// Executes a command asynchronously. Work tree is expected to be clean.
|
||||||
@@ -2893,7 +2893,7 @@ bool GitClient::synchronousRevert(const QString &workingDirectory, const QString
|
|||||||
// Do not stash if --continue or --abort is given as the commit
|
// Do not stash if --continue or --abort is given as the commit
|
||||||
if (!commit.startsWith('-') && !beginStashScope(workingDirectory, command))
|
if (!commit.startsWith('-') && !beginStashScope(workingDirectory, command))
|
||||||
return false;
|
return false;
|
||||||
return executeAndHandleConflicts(workingDirectory, { command, "--no-edit", commit }, command);
|
return executeAndHandleConflicts(workingDirectory, {command, "--no-edit", commit}, command);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QString &commit)
|
bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QString &commit)
|
||||||
@@ -2904,7 +2904,7 @@ bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QSt
|
|||||||
if (isRealCommit && !beginStashScope(workingDirectory, command))
|
if (isRealCommit && !beginStashScope(workingDirectory, command))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
QStringList arguments = { command };
|
QStringList arguments = {command};
|
||||||
if (isRealCommit && isRemoteCommit(workingDirectory, commit))
|
if (isRealCommit && isRemoteCommit(workingDirectory, commit))
|
||||||
arguments << "-x";
|
arguments << "-x";
|
||||||
arguments << commit;
|
arguments << commit;
|
||||||
@@ -2914,7 +2914,7 @@ bool GitClient::synchronousCherryPick(const QString &workingDirectory, const QSt
|
|||||||
|
|
||||||
void GitClient::interactiveRebase(const QString &workingDirectory, const QString &commit, bool fixup)
|
void GitClient::interactiveRebase(const QString &workingDirectory, const QString &commit, bool fixup)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "rebase", "-i" };
|
QStringList arguments = {"rebase", "-i"};
|
||||||
if (fixup)
|
if (fixup)
|
||||||
arguments << "--autosquash";
|
arguments << "--autosquash";
|
||||||
arguments << commit + '^';
|
arguments << commit + '^';
|
||||||
@@ -2938,7 +2938,7 @@ QString GitClient::msgNoCommits(bool includeRemote)
|
|||||||
|
|
||||||
void GitClient::stashPop(const QString &workingDirectory, const QString &stash)
|
void GitClient::stashPop(const QString &workingDirectory, const QString &stash)
|
||||||
{
|
{
|
||||||
QStringList arguments = { "stash", "pop" };
|
QStringList arguments = {"stash", "pop"};
|
||||||
if (!stash.isEmpty())
|
if (!stash.isEmpty())
|
||||||
arguments << stash;
|
arguments << stash;
|
||||||
VcsCommand *cmd = vcsExec(workingDirectory, arguments, nullptr, true, VcsCommand::ExpectRepoChanges);
|
VcsCommand *cmd = vcsExec(workingDirectory, arguments, nullptr, true, VcsCommand::ExpectRepoChanges);
|
||||||
@@ -2950,7 +2950,7 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
|
|||||||
bool pop,
|
bool pop,
|
||||||
const QString &branch /* = QString()*/) const
|
const QString &branch /* = QString()*/) const
|
||||||
{
|
{
|
||||||
QStringList arguments = { "stash" };
|
QStringList arguments = {"stash"};
|
||||||
if (branch.isEmpty())
|
if (branch.isEmpty())
|
||||||
arguments << QLatin1String(pop ? "pop" : "apply") << stash;
|
arguments << QLatin1String(pop ? "pop" : "apply") << stash;
|
||||||
else
|
else
|
||||||
@@ -2961,7 +2961,7 @@ bool GitClient::synchronousStashRestore(const QString &workingDirectory,
|
|||||||
bool GitClient::synchronousStashRemove(const QString &workingDirectory, const QString &stash,
|
bool GitClient::synchronousStashRemove(const QString &workingDirectory, const QString &stash,
|
||||||
QString *errorMessage) const
|
QString *errorMessage) const
|
||||||
{
|
{
|
||||||
QStringList arguments = { "stash" };
|
QStringList arguments = {"stash"};
|
||||||
if (stash.isEmpty())
|
if (stash.isEmpty())
|
||||||
arguments << "clear";
|
arguments << "clear";
|
||||||
else
|
else
|
||||||
@@ -2984,7 +2984,7 @@ bool GitClient::synchronousStashList(const QString &workingDirectory, QList<Stas
|
|||||||
{
|
{
|
||||||
stashes->clear();
|
stashes->clear();
|
||||||
|
|
||||||
const QStringList arguments = { "stash", "list", noColorOption };
|
const QStringList arguments = {"stash", "list", noColorOption};
|
||||||
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
|
const SynchronousProcessResponse resp = vcsFullySynchronousExec(workingDirectory, arguments);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
|
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
|
||||||
@@ -3002,18 +3002,18 @@ bool GitClient::synchronousStashList(const QString &workingDirectory, QList<Stas
|
|||||||
// Read a single-line config value, return trimmed
|
// Read a single-line config value, return trimmed
|
||||||
QString GitClient::readConfigValue(const QString &workingDirectory, const QString &configVar) const
|
QString GitClient::readConfigValue(const QString &workingDirectory, const QString &configVar) const
|
||||||
{
|
{
|
||||||
return readOneLine(workingDirectory, { "config", configVar });
|
return readOneLine(workingDirectory, {"config", configVar});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitClient::setConfigValue(const QString &workingDirectory, const QString &configVar,
|
void GitClient::setConfigValue(const QString &workingDirectory, const QString &configVar,
|
||||||
const QString &value) const
|
const QString &value) const
|
||||||
{
|
{
|
||||||
readOneLine(workingDirectory, { "config", configVar, value });
|
readOneLine(workingDirectory, {"config", configVar, value});
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GitClient::readGitVar(const QString &workingDirectory, const QString &configVar) const
|
QString GitClient::readGitVar(const QString &workingDirectory, const QString &configVar) const
|
||||||
{
|
{
|
||||||
return readOneLine(workingDirectory, { "var", configVar });
|
return readOneLine(workingDirectory, {"var", configVar});
|
||||||
}
|
}
|
||||||
|
|
||||||
QString GitClient::readOneLine(const QString &workingDirectory, const QStringList &arguments) const
|
QString GitClient::readOneLine(const QString &workingDirectory, const QStringList &arguments) const
|
||||||
@@ -3052,7 +3052,7 @@ unsigned GitClient::synchronousGitVersion(QString *errorMessage) const
|
|||||||
|
|
||||||
// run git --version
|
// run git --version
|
||||||
const SynchronousProcessResponse resp = vcsSynchronousExec(
|
const SynchronousProcessResponse resp = vcsSynchronousExec(
|
||||||
QString(), { "--version" }, silentFlags);
|
QString(), {"--version"}, silentFlags);
|
||||||
if (resp.result != SynchronousProcessResponse::Finished) {
|
if (resp.result != SynchronousProcessResponse::Finished) {
|
||||||
msgCannotRun(tr("Cannot determine Git version: %1").arg(resp.stdErr()), errorMessage);
|
msgCannotRun(tr("Cannot determine Git version: %1").arg(resp.stdErr()), errorMessage);
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ void GitEditorWidget::revertChange()
|
|||||||
void GitEditorWidget::logChange()
|
void GitEditorWidget::logChange()
|
||||||
{
|
{
|
||||||
GitPlugin::client()->log(
|
GitPlugin::client()->log(
|
||||||
sourceWorkingDirectory(), QString(), false, { m_currentChange });
|
sourceWorkingDirectory(), QString(), false, {m_currentChange});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
||||||
@@ -227,7 +227,7 @@ void GitEditorWidget::applyDiffChunk(const DiffChunk& chunk, bool revert)
|
|||||||
patchFile.write(chunk.chunk);
|
patchFile.write(chunk.chunk);
|
||||||
patchFile.close();
|
patchFile.close();
|
||||||
|
|
||||||
QStringList args = { "--cached" };
|
QStringList args = {"--cached"};
|
||||||
if (revert)
|
if (revert)
|
||||||
args << "--reverse";
|
args << "--reverse";
|
||||||
QString errorMessage;
|
QString errorMessage;
|
||||||
|
|||||||
@@ -743,7 +743,7 @@ void GitPlugin::undoFileChanges(bool revertStaging)
|
|||||||
const VcsBasePluginState state = currentState();
|
const VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return);
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
FileChangeBlocker fcb(state.currentFile());
|
FileChangeBlocker fcb(state.currentFile());
|
||||||
m_gitClient->revert({ state.currentFile() }, revertStaging);
|
m_gitClient->revert({state.currentFile()}, revertStaging);
|
||||||
}
|
}
|
||||||
|
|
||||||
class ResetItemDelegate : public LogItemDelegate
|
class ResetItemDelegate : public LogItemDelegate
|
||||||
@@ -858,7 +858,7 @@ void GitPlugin::unstageFile()
|
|||||||
{
|
{
|
||||||
const VcsBasePluginState state = currentState();
|
const VcsBasePluginState state = currentState();
|
||||||
QTC_ASSERT(state.hasFile(), return);
|
QTC_ASSERT(state.hasFile(), return);
|
||||||
m_gitClient->synchronousReset(state.currentFileTopLevel(), { state.relativeCurrentFile() });
|
m_gitClient->synchronousReset(state.currentFileTopLevel(), {state.relativeCurrentFile()});
|
||||||
}
|
}
|
||||||
|
|
||||||
void GitPlugin::gitkForCurrentFile()
|
void GitPlugin::gitkForCurrentFile()
|
||||||
|
|||||||
@@ -113,13 +113,13 @@ bool GitVersionControl::vcsOpen(const QString & /*fileName*/)
|
|||||||
bool GitVersionControl::vcsAdd(const QString & fileName)
|
bool GitVersionControl::vcsAdd(const QString & fileName)
|
||||||
{
|
{
|
||||||
const QFileInfo fi(fileName);
|
const QFileInfo fi(fileName);
|
||||||
return m_client->synchronousAdd(fi.absolutePath(), { fi.fileName() });
|
return m_client->synchronousAdd(fi.absolutePath(), {fi.fileName()});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitVersionControl::vcsDelete(const QString & fileName)
|
bool GitVersionControl::vcsDelete(const QString & fileName)
|
||||||
{
|
{
|
||||||
const QFileInfo fi(fileName);
|
const QFileInfo fi(fileName);
|
||||||
return m_client->synchronousDelete(fi.absolutePath(), true, { fi.fileName() });
|
return m_client->synchronousDelete(fi.absolutePath(), true, {fi.fileName()});
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitVersionControl::vcsMove(const QString &from, const QString &to)
|
bool GitVersionControl::vcsMove(const QString &from, const QString &to)
|
||||||
@@ -148,7 +148,7 @@ Core::ShellCommand *GitVersionControl::createInitialCheckoutCommand(const QStrin
|
|||||||
const QString &localName,
|
const QString &localName,
|
||||||
const QStringList &extraArgs)
|
const QStringList &extraArgs)
|
||||||
{
|
{
|
||||||
QStringList args = { "clone", "--progress" };
|
QStringList args = {"clone", "--progress"};
|
||||||
args << extraArgs << url << localName;
|
args << extraArgs << url << localName;
|
||||||
|
|
||||||
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), m_client->processEnvironment());
|
auto command = new VcsBase::VcsCommand(baseDirectory.toString(), m_client->processEnvironment());
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user