Merge remote-tracking branch 'origin/4.8'

Conflicts:
	doc/src/editors/creator-only/creator-code-pasting.qdoc
	src/plugins/android/androidbuildapkwidget.cpp

Change-Id: Iea8b7135643d14ffe49d10b14bedb8fa5ac48063
This commit is contained in:
Eike Ziller
2018-10-24 13:58:45 +02:00
81 changed files with 316 additions and 240 deletions

1
.gitignore vendored
View File

@@ -52,6 +52,7 @@ wrapper.sh
/src/plugins/**/*.json /src/plugins/**/*.json
/src/plugins/coreplugin/ide_version.h /src/plugins/coreplugin/ide_version.h
/src/libs/qt-breakpad/bin /src/libs/qt-breakpad/bin
/src/libs/botan/build/
app_version.h app_version.h
phony.c phony.c

15
dist/changes-4.7.2.md vendored
View File

@@ -7,11 +7,21 @@ you can check out from the public Git repository. For example:
git clone git://code.qt.io/qt-creator/qt-creator.git git clone git://code.qt.io/qt-creator/qt-creator.git
git log --cherry-pick --pretty=oneline origin/v4.7.1..v4.7.2 git log --cherry-pick --pretty=oneline origin/v4.7.1..v4.7.2
General
* Fixed crash when pressing wrong shortcut for recent projects in Welcome mode
(QTCREATORBUG-21302)
* Fixed rare crash in file system view
Editing Editing
* Fixed that collapsed text no longer showed up in tooltip (QTCREATORBUG-21040) * Fixed that collapsed text no longer showed up in tooltip (QTCREATORBUG-21040)
* Fixed crash with generic text completion (QTCREATORBUG-21192) * Fixed crash with generic text completion (QTCREATORBUG-21192)
Generic Projects
* Fixed crash when adding file to sub-folder (QTCREATORBUG-21342)
C++ Support C++ Support
* Fixed wrong value of `__cplusplus` define (QTCREATORBUG-20884) * Fixed wrong value of `__cplusplus` define (QTCREATORBUG-20884)
@@ -31,6 +41,11 @@ Windows
* Fixed saving of files when another application blocks atomic save operation * Fixed saving of files when another application blocks atomic save operation
(QTCREATORBUG-7668) (QTCREATORBUG-7668)
* Fixed wrongly added empty lines in application output (QTCREATORBUG-21215)
iOS
* Fixed issue with detecting iPhone XS (QTCREATORBUG-21291)
Remote Linux Remote Linux

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 49 KiB

View File

@@ -387,8 +387,10 @@
\li Disassemble sections of code. \li Disassemble sections of code.
\omit
\li Create snapshots of the current state of the debugged program \li Create snapshots of the current state of the debugged program
and re-examine them later. and re-examine them later.
\endomit
\endlist \endlist
@@ -605,6 +607,7 @@
By default, the \uicontrol Registers view is hidden. By default, the \uicontrol Registers view is hidden.
\omit
\section2 Creating Snapshots \section2 Creating Snapshots
A snapshot contains the complete state of the debugged program at a time, A snapshot contains the complete state of the debugged program at a time,
@@ -616,7 +619,7 @@
Double-click on entries in the \uicontrol {Debugger Perspectives} view to Double-click on entries in the \uicontrol {Debugger Perspectives} view to
switch between snapshots. The debugger views are updated to reflect the state switch between snapshots. The debugger views are updated to reflect the state
of the program at time of taking the snapshot. of the program at time of taking the snapshot.
\endomit
*/ */

View File

@@ -37,6 +37,7 @@
\list \list
\li \uicontrol {Pastebin.Com} \li \uicontrol {Pastebin.Com}
\li \uicontrol {Pastecode.Xyz}
\li \uicontrol {Paste.KDE.Org} \li \uicontrol {Paste.KDE.Org}
\li \uicontrol {Shared network drives} \li \uicontrol {Shared network drives}
\endlist \endlist

View File

@@ -41,6 +41,8 @@
{MIME type} of the file to determine which mode and editor to use for {MIME type} of the file to determine which mode and editor to use for
opening the file. For example, \QC opens C++ source and header files in opening the file. For example, \QC opens C++ source and header files in
the C++ editor, and Qt widget based UI files (.ui) in \QD. the C++ editor, and Qt widget based UI files (.ui) in \QD.
For some MIME types, you can change the editor that is used to open the
files of that type by default.
To identify the MIME type of a file, \QC uses matching by pattern and To identify the MIME type of a file, \QC uses matching by pattern and
matching by contents. First, \QC looks at the filename to check whether it matching by contents. First, \QC looks at the filename to check whether it
@@ -94,12 +96,18 @@
\note You are recommended not to change the range and priority, \note You are recommended not to change the range and priority,
because it might cause problems when opening files in \QC. because it might cause problems when opening files in \QC.
\li In \uicontrol Handler, double-click the editor name to display a
context-menu where you can select another editor to open the file
in by default. The menu is available only if alternative suitable
editors are available.
\li Click \uicontrol OK. \li Click \uicontrol OK.
\endlist \endlist
To revert all the changes you have made to the MIME type definitions, To revert the changes you have made to the MIME type definitions,
select \uicontrol {Reset All}. select \uicontrol {Reset MIME Types}. To revert the changes you have
made to the default editors, select \uicontrol {Reset Handlers}.
\note If you now select \uicontrol OK or \uicontrol Apply, you permanently lose all \note If you now select \uicontrol OK or \uicontrol Apply, you permanently lose all
your own patterns and magic headers. The changes are reverted the next your own patterns and magic headers. The changes are reverted the next

View File

@@ -200,9 +200,11 @@
current working directory. You can specify another location for the file, current working directory. You can specify another location for the file,
including a relative or absolute path, as an argument of the command. including a relative or absolute path, as an argument of the command.
\omit
To generate a temporary core file, select \uicontrol {Create Snapshot} in the To generate a temporary core file, select \uicontrol {Create Snapshot} in the
context menu in the \uicontrol Snapshot view. The core file is deleted when you context menu in the \uicontrol Snapshot view. The core file is deleted when you
stop debugging. stop debugging.
\endomit
\section1 Compiler Questions \section1 Compiler Questions
@@ -253,8 +255,10 @@
the standard output and error output. When you run or debug the the standard output and error output. When you run or debug the
application, you can view the output in the \uicontrol{Application Output} pane. application, you can view the output in the \uicontrol{Application Output} pane.
For console applications that require input, select \uicontrol {Projects > Run For console applications that require input, select \uicontrol Projects >
Settings > Run in terminal}. \uicontrol {Run Settings} > \uicontrol {Run in terminal}. To specify the
terminal to use, select \uicontrol Tools > \uicontrol Options >
\uicontrol Environment > \uicontrol System.
\b {On Windows:} Output is displayed differently for \e{console \b {On Windows:} Output is displayed differently for \e{console
applications} and \e{GUI applications}. applications} and \e{GUI applications}.

View File

@@ -237,7 +237,9 @@
\li Show the file or directory in the file explorer. \li Show the file or directory in the file explorer.
\li Open a terminal window in the selected directory or in the directory \li Open a terminal window in the selected directory or in the directory
that contains the file. that contains the file. To specify the terminal to use on Linux and
\macos, select \uicontrol Tools > \uicontrol Options >
\uicontrol Environment > \uicontrol System.
\li Search from the selected directory. \li Search from the selected directory.

View File

@@ -32,9 +32,13 @@
and the working directory to use. The working directory defaults to and the working directory to use. The working directory defaults to
the directory of the build result. the directory of the build result.
For console applications, check the \uicontrol{Run in Terminal} check box. For console applications, check the \uicontrol{Run in terminal} check box.
If you need to run with special environment variables set up, you To specify the terminal to use on Linux and \macos, select \uicontrol Tools
also do it in the run configuration settings. > \uicontrol Options > \uicontrol Environment > \uicontrol System.
To run with special environment variables set up, select them in the
\uicontrol {Run Environment} section. For more information, see
\l {Selecting the Run Environment}.
\image qtcreator-pprunsettings.png \image qtcreator-pprunsettings.png

View File

@@ -396,7 +396,7 @@ QVariant ObjectNodeInstance::convertEnumToValue(const QVariant &value, const Pro
QQmlExpression expression(context(), object(), enumeration.toString()); QQmlExpression expression(context(), object(), enumeration.toString());
adjustedValue = expression.evaluate(); adjustedValue = expression.evaluate();
if (expression.hasError()) if (expression.hasError())
qDebug() << "Enumeration can not be evaluated:" << object() << name << enumeration; qDebug() << "Enumeration cannot be evaluated:" << object() << name << enumeration;
} }
return adjustedValue; return adjustedValue;
} }

View File

@@ -185,7 +185,7 @@ static inline int askMsgSendFailed()
QMessageBox::Retry); QMessageBox::Retry);
} }
// taken from utils/fileutils.cpp. We can not use utils here since that depends app_version.h. // taken from utils/fileutils.cpp. We cannot use utils here since that depends app_version.h.
static bool copyRecursively(const QString &srcFilePath, static bool copyRecursively(const QString &srcFilePath,
const QString &tgtFilePath) const QString &tgtFilePath)
{ {

View File

@@ -77,7 +77,7 @@ static inline std::string fixInnerType(const std::string &type,
std::string stripped std::string stripped
= SymbolGroupValue::stripConst(SymbolGroupValue::stripClassPrefixes(type)); = SymbolGroupValue::stripConst(SymbolGroupValue::stripClassPrefixes(type));
// Unfortunately the cdb can not handle the vc exclusiv 64 bit integer // Unfortunately the cdb cannot handle the vc exclusiv 64 bit integer
// "__int64" but works fine with "int64", so we have to strip down "__" // "__int64" but works fine with "int64", so we have to strip down "__"
const size_t __int64pos = stripped.find("__int64"); const size_t __int64pos = stripped.find("__int64");
if (__int64pos != std::string::npos) if (__int64pos != std::string::npos)

View File

@@ -352,7 +352,7 @@ static PyObject *cdbext_reportResult(PyObject *, PyObject *args)
static PyMethodDef cdbextMethods[] = { static PyMethodDef cdbextMethods[] = {
{"parseAndEvaluate", cdbext_parseAndEvaluate, METH_VARARGS, {"parseAndEvaluate", cdbext_parseAndEvaluate, METH_VARARGS,
"Returns value of expression or None if the expression can not be resolved"}, "Returns value of expression or None if the expression cannot be resolved"},
{"resolveSymbol", cdbext_resolveSymbol, METH_VARARGS, {"resolveSymbol", cdbext_resolveSymbol, METH_VARARGS,
"Returns a list of symbol names matching the given pattern"}, "Returns a list of symbol names matching the given pattern"},
{"getNameByAddress", cdbext_getNameByAddress, METH_VARARGS, {"getNameByAddress", cdbext_getNameByAddress, METH_VARARGS,
@@ -360,7 +360,7 @@ static PyMethodDef cdbextMethods[] = {
{"getAddressByName", cdbext_getAddressByName, METH_VARARGS, {"getAddressByName", cdbext_getAddressByName, METH_VARARGS,
"Returns the address of the symbol with the given name"}, "Returns the address of the symbol with the given name"},
{"lookupType", cdbext_lookupType, METH_VARARGS, {"lookupType", cdbext_lookupType, METH_VARARGS,
"Returns type object or None if the type can not be resolved"}, "Returns type object or None if the type cannot be resolved"},
{"listOfLocals", cdbext_listOfLocals, METH_VARARGS, {"listOfLocals", cdbext_listOfLocals, METH_VARARGS,
"Returns list of values that are currently in scope"}, "Returns list of values that are currently in scope"},
{"listOfModules", cdbext_listOfModules, METH_NOARGS, {"listOfModules", cdbext_listOfModules, METH_NOARGS,

View File

@@ -241,7 +241,7 @@ void DatabaseBackend::cacheTextEncoding()
void DatabaseBackend::checkForOpenDatabaseWhichCanBeClosed() void DatabaseBackend::checkForOpenDatabaseWhichCanBeClosed()
{ {
if (m_databaseHandle == nullptr) if (m_databaseHandle == nullptr)
throw DatabaseIsAlreadyClosed("SqliteDatabaseBackend::close: database is not open so it can not be closed."); throw DatabaseIsAlreadyClosed("SqliteDatabaseBackend::close: database is not open so it cannot be closed.");
} }
void DatabaseBackend::checkDatabaseClosing(int resultCode) void DatabaseBackend::checkDatabaseClosing(int resultCode)

View File

@@ -203,7 +203,8 @@ SshKeyExchangeReply SshIncomingPacket::extractKeyExchangeReply(const QByteArray
throw SshPacketParseException(); throw SshPacketParseException();
getHostKeySpecificReplyData(replyData, hostKeyAlgo, replyData.k_s.mid(k_sOffset)); getHostKeySpecificReplyData(replyData, hostKeyAlgo, replyData.k_s.mid(k_sOffset));
if (kexAlgo == SshCapabilities::DiffieHellmanGroup1Sha1) { if (kexAlgo == SshCapabilities::DiffieHellmanGroup1Sha1
|| kexAlgo == SshCapabilities::DiffieHellmanGroup14Sha1) {
replyData.f = SshPacketParser::asBigInt(m_data, &topLevelOffset); replyData.f = SshPacketParser::asBigInt(m_data, &topLevelOffset);
} else { } else {
QSSH_ASSERT_AND_RETURN_VALUE(kexAlgo.startsWith(SshCapabilities::EcdhKexNamePrefix), QSSH_ASSERT_AND_RETURN_VALUE(kexAlgo.startsWith(SshCapabilities::EcdhKexNamePrefix),

View File

@@ -56,7 +56,7 @@ public:
QStringList list; QStringList list;
QString historyKey; QString historyKey;
QString historyKeyIsLastItemEmpty; QString historyKeyIsLastItemEmpty;
int maxLines = 30; int maxLines = 6;
bool isLastItemEmpty = false; bool isLastItemEmpty = false;
}; };

View File

@@ -62,7 +62,7 @@ AndroidBuildApkInnerWidget::AndroidBuildApkInnerWidget(AndroidBuildApkStep *step
m_step(step) m_step(step)
{ {
m_ui->setupUi(this); m_ui->setupUi(this);
setDisplayName(tr("<b>Build Android APK</b>")); setDisplayName("<b>" + tr("Build Android APK" + "</b>"));
setSummaryText(displayName()); setSummaryText(displayName());
// Target sdk combobox // Target sdk combobox
@@ -225,8 +225,8 @@ AndroidBuildApkWidget::AndroidBuildApkWidget(AndroidBuildApkStep *step) :
BuildStepConfigWidget(step), BuildStepConfigWidget(step),
m_step(step) m_step(step)
{ {
setDisplayName(tr("<b>Build Android APK</b>")); setDisplayName("<b>" + tr("Build Android APK" + "</b>"));
setSummaryText(tr("<b>Build Android APK</b>")); setSummaryText("<b>" + tr("Build Android APK" + "</b>"));
m_extraLibraryListModel = new AndroidExtraLibraryListModel(m_step->target(), this); m_extraLibraryListModel = new AndroidExtraLibraryListModel(m_step->target(), this);

View File

@@ -793,7 +793,7 @@ QVersionNumber AndroidConfig::ndkVersion() const
{ {
QVersionNumber version; QVersionNumber version;
if (!m_ndkLocation.exists()) { if (!m_ndkLocation.exists()) {
qCDebug(avdConfigLog) << "Can not find ndk version. Check NDK path." qCDebug(avdConfigLog) << "Cannot find ndk version. Check NDK path."
<< m_ndkLocation.toString(); << m_ndkLocation.toString();
return version; return version;
} }
@@ -826,11 +826,11 @@ QVersionNumber AndroidConfig::ndkVersion() const
version = QVersionNumber::fromString(QString("%1.%2.0").arg(major) version = QVersionNumber::fromString(QString("%1.%2.0").arg(major)
.arg((int)minor[0].toLatin1() - 97)); .arg((int)minor[0].toLatin1() - 97));
} else { } else {
qCDebug(avdConfigLog) << "Can not find ndk version. Can not parse RELEASE.TXT." qCDebug(avdConfigLog) << "Cannot find ndk version. Cannot parse RELEASE.TXT."
<< content; << content;
} }
} else { } else {
qCDebug(avdConfigLog) << "Can not find ndk version." << errorString; qCDebug(avdConfigLog) << "Cannot find ndk version." << errorString;
} }
} }
return version; return version;

View File

@@ -220,7 +220,7 @@ QString AndroidManager::activityName(ProjectExplorer::Target *target)
/*! /*!
Returns the minimum Android API level set for the APK. Minimum API level Returns the minimum Android API level set for the APK. Minimum API level
of the kit is returned if the manifest file of the APK can not be found of the kit is returned if the manifest file of the APK cannot be found
or parsed. or parsed.
*/ */
int AndroidManager::minimumSDK(ProjectExplorer::Target *target) int AndroidManager::minimumSDK(ProjectExplorer::Target *target)

View File

@@ -400,7 +400,7 @@ void AndroidRunnerWorker::asyncStartHelper()
runAdb({"shell", "run-as", m_packageName, "chmod", "a+x", packageDir.trimmed()}); runAdb({"shell", "run-as", m_packageName, "chmod", "a+x", packageDir.trimmed()});
if (m_gdbserverPath.isEmpty() || !uploadFile(m_gdbserverPath, "gdbserver")) { if (m_gdbserverPath.isEmpty() || !uploadFile(m_gdbserverPath, "gdbserver")) {
emit remoteProcessFinished(tr("Can not find/copy C++ debug server.")); emit remoteProcessFinished(tr("Cannot find/copy C++ debug server."));
return; return;
} }

View File

@@ -627,7 +627,7 @@ AndroidSdkPackage *SdkManagerOutputParser::parsePlatform(const QStringList &data
if (parseAbstractData(packageData, data, 2, "Platform")) { if (parseAbstractData(packageData, data, 2, "Platform")) {
int apiLevel = platformNameToApiLevel(packageData.headerParts.at(1)); int apiLevel = platformNameToApiLevel(packageData.headerParts.at(1));
if (apiLevel == -1) { if (apiLevel == -1) {
qCDebug(sdkManagerLog) << "Platform: Can not parse api level:"<< data; qCDebug(sdkManagerLog) << "Platform: Cannot parse api level:"<< data;
return nullptr; return nullptr;
} }
platform = new SdkPlatform(packageData.revision, data.at(0), apiLevel); platform = new SdkPlatform(packageData.revision, data.at(0), apiLevel);
@@ -647,7 +647,7 @@ QPair<SystemImage *, int> SdkManagerOutputParser::parseSystemImage(const QString
if (parseAbstractData(packageData, data, 4, "System-image")) { if (parseAbstractData(packageData, data, 4, "System-image")) {
int apiLevel = platformNameToApiLevel(packageData.headerParts.at(1)); int apiLevel = platformNameToApiLevel(packageData.headerParts.at(1));
if (apiLevel == -1) { if (apiLevel == -1) {
qCDebug(sdkManagerLog) << "System-image: Can not parse api level:"<< data; qCDebug(sdkManagerLog) << "System-image: Cannot parse api level:"<< data;
return result; return result;
} }
auto image = new SystemImage(packageData.revision, data.at(0), auto image = new SystemImage(packageData.revision, data.at(0),

View File

@@ -57,7 +57,7 @@ void Android::Internal::AndroidSignalOperation::adbFindRunAsFinished(int exitCod
m_errorMessage += QLatin1String(" adb process error: ") + adbError; m_errorMessage += QLatin1String(" adb process error: ") + adbError;
} }
if (runAs.isEmpty() || !m_errorMessage.isEmpty()) { if (runAs.isEmpty() || !m_errorMessage.isEmpty()) {
m_errorMessage = QLatin1String("Can not find User for process: ") m_errorMessage = QLatin1String("Cannot find User for process: ")
+ QString::number(m_pid) + QString::number(m_pid)
+ m_errorMessage; + m_errorMessage;
m_state = Idle; m_state = Idle;
@@ -90,7 +90,7 @@ void Android::Internal::AndroidSignalOperation::adbKillFinished(int exitCode,
m_errorMessage = QString::fromLatin1(m_adbProcess->readAllStandardError()); m_errorMessage = QString::fromLatin1(m_adbProcess->readAllStandardError());
} }
if (!m_errorMessage.isEmpty()) { if (!m_errorMessage.isEmpty()) {
m_errorMessage = QLatin1String("Can not kill process: ") + QString::number(m_pid) m_errorMessage = QLatin1String("Cannot kill process: ") + QString::number(m_pid)
+ m_errorMessage; + m_errorMessage;
} }
m_state = Idle; m_state = Idle;

View File

@@ -137,10 +137,12 @@ static QString processInformation(const QProcess *proc)
static QString rcInfo(const TestConfiguration * const config) static QString rcInfo(const TestConfiguration * const config)
{ {
QString info = '\n' + TestRunner::tr("Run configuration:") + ' '; QString info;
if (config->isDeduced()) if (config->isDeduced())
info += TestRunner::tr("deduced from"); info = TestRunner::tr("\nRun configuration: deduced from \"%1\"");
return info + " \"" + config->runConfigDisplayName() + '"'; else
info = TestRunner::tr("\nRun configuration: \"%1\"");
return info.arg(config->runConfigDisplayName());
} }
static QString constructOmittedDetailsString(const QStringList &omitted) static QString constructOmittedDetailsString(const QStringList &omitted)

View File

@@ -358,9 +358,8 @@ QString ClangAssistProposalItem::fixItText() const
{ {
const FixItContainer &fixIt = firstCompletionFixIts().first(); const FixItContainer &fixIt = firstCompletionFixIts().first();
return QCoreApplication::translate("ClangCodeModel::ClangAssistProposalItem", return QCoreApplication::translate("ClangCodeModel::ClangAssistProposalItem",
"Requires to correct \"%1\" to \"%2\"") "Requires changing \"%1\" to \"%2\"")
.arg(textReplacedByFixit(fixIt)) .arg(textReplacedByFixit(fixIt), fixIt.text.toString());
.arg(fixIt.text.toString());
} }
int ClangAssistProposalItem::fixItsShift(const TextDocumentManipulatorInterface &manipulator) const int ClangAssistProposalItem::fixItsShift(const TextDocumentManipulatorInterface &manipulator) const

View File

@@ -253,7 +253,7 @@ void BackendCommunicator::unsavedFilesUpdatedForUiHeaders()
const auto editorSupports = CppModelManager::instance()->abstractEditorSupports(); const auto editorSupports = CppModelManager::instance()->abstractEditorSupports();
foreach (const AbstractEditorSupport *es, editorSupports) { foreach (const AbstractEditorSupport *es, editorSupports) {
const QString mappedPath const QString mappedPath
= ModelManagerSupportClang::instance()->dummyUiHeaderOnDiskPath(es->fileName()); = ClangModelManagerSupport::instance()->dummyUiHeaderOnDiskPath(es->fileName());
unsavedFilesUpdated(mappedPath, es->contents(), es->revision()); unsavedFilesUpdated(mappedPath, es->contents(), es->revision());
} }
} }

View File

@@ -53,7 +53,7 @@ private:
void generateCompilationDB(); void generateCompilationDB();
void createCompilationDBButton(); void createCompilationDBButton();
ModelManagerSupportProviderClang m_modelManagerSupportProvider; ClangModelManagerSupportProvider m_modelManagerSupportProvider;
Utils::ParameterAction *m_generateCompilationDBAction = nullptr; Utils::ParameterAction *m_generateCompilationDBAction = nullptr;
QFutureWatcher<void> m_generatorWatcher; QFutureWatcher<void> m_generatorWatcher;
#ifdef WITH_TESTS #ifdef WITH_TESTS

View File

@@ -70,7 +70,7 @@ namespace Internal {
static ClangProjectSettings &getProjectSettings(ProjectExplorer::Project *project) static ClangProjectSettings &getProjectSettings(ProjectExplorer::Project *project)
{ {
QTC_CHECK(project); QTC_CHECK(project);
return ModelManagerSupportClang::instance()->projectSettings(project); return ClangModelManagerSupport::instance()->projectSettings(project);
} }
ClangEditorDocumentProcessor::ClangEditorDocumentProcessor( ClangEditorDocumentProcessor::ClangEditorDocumentProcessor(

View File

@@ -60,14 +60,14 @@
using namespace ClangCodeModel; using namespace ClangCodeModel;
using namespace ClangCodeModel::Internal; using namespace ClangCodeModel::Internal;
static ModelManagerSupportClang *m_instance = 0; static ClangModelManagerSupport *m_instance = 0;
static CppTools::CppModelManager *cppModelManager() static CppTools::CppModelManager *cppModelManager()
{ {
return CppTools::CppModelManager::instance(); return CppTools::CppModelManager::instance();
} }
ModelManagerSupportClang::ModelManagerSupportClang() ClangModelManagerSupport::ClangModelManagerSupport()
: m_completionAssistProvider(m_communicator) : m_completionAssistProvider(m_communicator)
, m_followSymbol(new ClangFollowSymbol) , m_followSymbol(new ClangFollowSymbol)
, m_refactoringEngine(new RefactoringEngine) , m_refactoringEngine(new RefactoringEngine)
@@ -82,76 +82,76 @@ ModelManagerSupportClang::ModelManagerSupportClang()
Core::EditorManager *editorManager = Core::EditorManager::instance(); Core::EditorManager *editorManager = Core::EditorManager::instance();
connect(editorManager, &Core::EditorManager::editorOpened, connect(editorManager, &Core::EditorManager::editorOpened,
this, &ModelManagerSupportClang::onEditorOpened); this, &ClangModelManagerSupport::onEditorOpened);
connect(editorManager, &Core::EditorManager::currentEditorChanged, connect(editorManager, &Core::EditorManager::currentEditorChanged,
this, &ModelManagerSupportClang::onCurrentEditorChanged); this, &ClangModelManagerSupport::onCurrentEditorChanged);
connect(editorManager, &Core::EditorManager::editorsClosed, connect(editorManager, &Core::EditorManager::editorsClosed,
this, &ModelManagerSupportClang::onEditorClosed); this, &ClangModelManagerSupport::onEditorClosed);
CppTools::CppModelManager *modelManager = cppModelManager(); CppTools::CppModelManager *modelManager = cppModelManager();
connect(modelManager, &CppTools::CppModelManager::abstractEditorSupportContentsUpdated, connect(modelManager, &CppTools::CppModelManager::abstractEditorSupportContentsUpdated,
this, &ModelManagerSupportClang::onAbstractEditorSupportContentsUpdated); this, &ClangModelManagerSupport::onAbstractEditorSupportContentsUpdated);
connect(modelManager, &CppTools::CppModelManager::abstractEditorSupportRemoved, connect(modelManager, &CppTools::CppModelManager::abstractEditorSupportRemoved,
this, &ModelManagerSupportClang::onAbstractEditorSupportRemoved); this, &ClangModelManagerSupport::onAbstractEditorSupportRemoved);
connect(modelManager, &CppTools::CppModelManager::projectPartsUpdated, connect(modelManager, &CppTools::CppModelManager::projectPartsUpdated,
this, &ModelManagerSupportClang::onProjectPartsUpdated); this, &ClangModelManagerSupport::onProjectPartsUpdated);
connect(modelManager, &CppTools::CppModelManager::projectPartsRemoved, connect(modelManager, &CppTools::CppModelManager::projectPartsRemoved,
this, &ModelManagerSupportClang::onProjectPartsRemoved); this, &ClangModelManagerSupport::onProjectPartsRemoved);
auto *sessionManager = ProjectExplorer::SessionManager::instance(); auto *sessionManager = ProjectExplorer::SessionManager::instance();
connect(sessionManager, &ProjectExplorer::SessionManager::projectAdded, connect(sessionManager, &ProjectExplorer::SessionManager::projectAdded,
this, &ModelManagerSupportClang::onProjectAdded); this, &ClangModelManagerSupport::onProjectAdded);
connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject, connect(sessionManager, &ProjectExplorer::SessionManager::aboutToRemoveProject,
this, &ModelManagerSupportClang::onAboutToRemoveProject); this, &ClangModelManagerSupport::onAboutToRemoveProject);
CppTools::CppCodeModelSettings *settings = CppTools::codeModelSettings().data(); CppTools::CppCodeModelSettings *settings = CppTools::codeModelSettings().data();
connect(settings, &CppTools::CppCodeModelSettings::clangDiagnosticConfigsInvalidated, connect(settings, &CppTools::CppCodeModelSettings::clangDiagnosticConfigsInvalidated,
this, &ModelManagerSupportClang::onDiagnosticConfigsInvalidated); this, &ClangModelManagerSupport::onDiagnosticConfigsInvalidated);
} }
ModelManagerSupportClang::~ModelManagerSupportClang() ClangModelManagerSupport::~ClangModelManagerSupport()
{ {
QTC_CHECK(m_projectSettings.isEmpty()); QTC_CHECK(m_projectSettings.isEmpty());
m_instance = 0; m_instance = 0;
} }
CppTools::CppCompletionAssistProvider *ModelManagerSupportClang::completionAssistProvider() CppTools::CppCompletionAssistProvider *ClangModelManagerSupport::completionAssistProvider()
{ {
return &m_completionAssistProvider; return &m_completionAssistProvider;
} }
TextEditor::BaseHoverHandler *ModelManagerSupportClang::createHoverHandler() TextEditor::BaseHoverHandler *ClangModelManagerSupport::createHoverHandler()
{ {
return new Internal::ClangHoverHandler; return new Internal::ClangHoverHandler;
} }
CppTools::FollowSymbolInterface &ModelManagerSupportClang::followSymbolInterface() CppTools::FollowSymbolInterface &ClangModelManagerSupport::followSymbolInterface()
{ {
return *m_followSymbol; return *m_followSymbol;
} }
CppTools::RefactoringEngineInterface &ModelManagerSupportClang::refactoringEngineInterface() CppTools::RefactoringEngineInterface &ClangModelManagerSupport::refactoringEngineInterface()
{ {
return *m_refactoringEngine; return *m_refactoringEngine;
} }
std::unique_ptr<CppTools::AbstractOverviewModel> ModelManagerSupportClang::createOverviewModel() std::unique_ptr<CppTools::AbstractOverviewModel> ClangModelManagerSupport::createOverviewModel()
{ {
return std::make_unique<OverviewModel>(); return std::make_unique<OverviewModel>();
} }
void ModelManagerSupportClang::setBackendJobsPostponed(bool postponed) void ClangModelManagerSupport::setBackendJobsPostponed(bool postponed)
{ {
m_communicator.setBackendJobsPostponed(postponed); m_communicator.setBackendJobsPostponed(postponed);
} }
CppTools::BaseEditorDocumentProcessor *ModelManagerSupportClang::createEditorDocumentProcessor( CppTools::BaseEditorDocumentProcessor *ClangModelManagerSupport::createEditorDocumentProcessor(
TextEditor::TextDocument *baseTextDocument) TextEditor::TextDocument *baseTextDocument)
{ {
return new ClangEditorDocumentProcessor(m_communicator, baseTextDocument); return new ClangEditorDocumentProcessor(m_communicator, baseTextDocument);
} }
void ModelManagerSupportClang::onCurrentEditorChanged(Core::IEditor *editor) void ClangModelManagerSupport::onCurrentEditorChanged(Core::IEditor *editor)
{ {
m_communicator.documentVisibilityChanged(); m_communicator.documentVisibilityChanged();
@@ -165,60 +165,60 @@ void ModelManagerSupportClang::onCurrentEditorChanged(Core::IEditor *editor)
processor->generateTaskHubIssues(); processor->generateTaskHubIssues();
} }
void ModelManagerSupportClang::connectTextDocumentToTranslationUnit(TextEditor::TextDocument *textDocument) void ClangModelManagerSupport::connectTextDocumentToTranslationUnit(TextEditor::TextDocument *textDocument)
{ {
// Handle externally changed documents // Handle externally changed documents
connect(textDocument, &Core::IDocument::aboutToReload, connect(textDocument, &Core::IDocument::aboutToReload,
this, &ModelManagerSupportClang::onCppDocumentAboutToReloadOnTranslationUnit, this, &ClangModelManagerSupport::onCppDocumentAboutToReloadOnTranslationUnit,
Qt::UniqueConnection); Qt::UniqueConnection);
connect(textDocument, &Core::IDocument::reloadFinished, connect(textDocument, &Core::IDocument::reloadFinished,
this, &ModelManagerSupportClang::onCppDocumentReloadFinishedOnTranslationUnit, this, &ClangModelManagerSupport::onCppDocumentReloadFinishedOnTranslationUnit,
Qt::UniqueConnection); Qt::UniqueConnection);
// Handle changes from e.g. refactoring actions // Handle changes from e.g. refactoring actions
connectToTextDocumentContentsChangedForTranslationUnit(textDocument); connectToTextDocumentContentsChangedForTranslationUnit(textDocument);
} }
void ModelManagerSupportClang::connectTextDocumentToUnsavedFiles(TextEditor::TextDocument *textDocument) void ClangModelManagerSupport::connectTextDocumentToUnsavedFiles(TextEditor::TextDocument *textDocument)
{ {
// Handle externally changed documents // Handle externally changed documents
connect(textDocument, &Core::IDocument::aboutToReload, connect(textDocument, &Core::IDocument::aboutToReload,
this, &ModelManagerSupportClang::onCppDocumentAboutToReloadOnUnsavedFile, this, &ClangModelManagerSupport::onCppDocumentAboutToReloadOnUnsavedFile,
Qt::UniqueConnection); Qt::UniqueConnection);
connect(textDocument, &Core::IDocument::reloadFinished, connect(textDocument, &Core::IDocument::reloadFinished,
this, &ModelManagerSupportClang::onCppDocumentReloadFinishedOnUnsavedFile, this, &ClangModelManagerSupport::onCppDocumentReloadFinishedOnUnsavedFile,
Qt::UniqueConnection); Qt::UniqueConnection);
// Handle changes from e.g. refactoring actions // Handle changes from e.g. refactoring actions
connectToTextDocumentContentsChangedForUnsavedFile(textDocument); connectToTextDocumentContentsChangedForUnsavedFile(textDocument);
} }
void ModelManagerSupportClang::connectToTextDocumentContentsChangedForTranslationUnit( void ClangModelManagerSupport::connectToTextDocumentContentsChangedForTranslationUnit(
TextEditor::TextDocument *textDocument) TextEditor::TextDocument *textDocument)
{ {
connect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition, connect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition,
this, &ModelManagerSupportClang::onCppDocumentContentsChangedOnTranslationUnit, this, &ClangModelManagerSupport::onCppDocumentContentsChangedOnTranslationUnit,
Qt::UniqueConnection); Qt::UniqueConnection);
} }
void ModelManagerSupportClang::connectToTextDocumentContentsChangedForUnsavedFile( void ClangModelManagerSupport::connectToTextDocumentContentsChangedForUnsavedFile(
TextEditor::TextDocument *textDocument) TextEditor::TextDocument *textDocument)
{ {
connect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition, connect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition,
this, &ModelManagerSupportClang::onCppDocumentContentsChangedOnUnsavedFile, this, &ClangModelManagerSupport::onCppDocumentContentsChangedOnUnsavedFile,
Qt::UniqueConnection); Qt::UniqueConnection);
} }
void ModelManagerSupportClang::connectToWidgetsMarkContextMenuRequested(QWidget *editorWidget) void ClangModelManagerSupport::connectToWidgetsMarkContextMenuRequested(QWidget *editorWidget)
{ {
const auto widget = qobject_cast<TextEditor::TextEditorWidget *>(editorWidget); const auto widget = qobject_cast<TextEditor::TextEditorWidget *>(editorWidget);
if (widget) { if (widget) {
connect(widget, &TextEditor::TextEditorWidget::markContextMenuRequested, connect(widget, &TextEditor::TextEditorWidget::markContextMenuRequested,
this, &ModelManagerSupportClang::onTextMarkContextMenuRequested); this, &ClangModelManagerSupport::onTextMarkContextMenuRequested);
} }
} }
bool ModelManagerSupportClang::eventFilter(QObject *obj, QEvent *e) bool ClangModelManagerSupport::eventFilter(QObject *obj, QEvent *e)
{ {
if (obj == QApplication::instance() && e->type() == QEvent::ApplicationStateChange) { if (obj == QApplication::instance() && e->type() == QEvent::ApplicationStateChange) {
switch (QApplication::applicationState()) { switch (QApplication::applicationState()) {
@@ -232,7 +232,7 @@ bool ModelManagerSupportClang::eventFilter(QObject *obj, QEvent *e)
return false; return false;
} }
void ModelManagerSupportClang::onEditorOpened(Core::IEditor *editor) void ClangModelManagerSupport::onEditorOpened(Core::IEditor *editor)
{ {
QTC_ASSERT(editor, return); QTC_ASSERT(editor, return);
Core::IDocument *document = editor->document(); Core::IDocument *document = editor->document();
@@ -247,19 +247,19 @@ void ModelManagerSupportClang::onEditorOpened(Core::IEditor *editor)
} }
} }
void ModelManagerSupportClang::onEditorClosed(const QList<Core::IEditor *> &) void ClangModelManagerSupport::onEditorClosed(const QList<Core::IEditor *> &)
{ {
m_communicator.documentVisibilityChanged(); m_communicator.documentVisibilityChanged();
} }
void ModelManagerSupportClang::onCppDocumentAboutToReloadOnTranslationUnit() void ClangModelManagerSupport::onCppDocumentAboutToReloadOnTranslationUnit()
{ {
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender()); TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
disconnect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition, disconnect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition,
this, &ModelManagerSupportClang::onCppDocumentContentsChangedOnTranslationUnit); this, &ClangModelManagerSupport::onCppDocumentContentsChangedOnTranslationUnit);
} }
void ModelManagerSupportClang::onCppDocumentReloadFinishedOnTranslationUnit(bool success) void ClangModelManagerSupport::onCppDocumentReloadFinishedOnTranslationUnit(bool success)
{ {
if (success) { if (success) {
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender()); TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
@@ -277,7 +277,7 @@ void clearDiagnosticFixIts(const QString &filePath)
} }
} }
void ModelManagerSupportClang::onCppDocumentContentsChangedOnTranslationUnit(int position, void ClangModelManagerSupport::onCppDocumentContentsChangedOnTranslationUnit(int position,
int /*charsRemoved*/, int /*charsRemoved*/,
int /*charsAdded*/) int /*charsAdded*/)
{ {
@@ -290,14 +290,14 @@ void ModelManagerSupportClang::onCppDocumentContentsChangedOnTranslationUnit(int
clearDiagnosticFixIts(document->filePath().toString()); clearDiagnosticFixIts(document->filePath().toString());
} }
void ModelManagerSupportClang::onCppDocumentAboutToReloadOnUnsavedFile() void ClangModelManagerSupport::onCppDocumentAboutToReloadOnUnsavedFile()
{ {
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender()); TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
disconnect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition, disconnect(textDocument, &TextEditor::TextDocument::contentsChangedWithPosition,
this, &ModelManagerSupportClang::onCppDocumentContentsChangedOnUnsavedFile); this, &ClangModelManagerSupport::onCppDocumentContentsChangedOnUnsavedFile);
} }
void ModelManagerSupportClang::onCppDocumentReloadFinishedOnUnsavedFile(bool success) void ClangModelManagerSupport::onCppDocumentReloadFinishedOnUnsavedFile(bool success)
{ {
if (success) { if (success) {
TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender()); TextEditor::TextDocument *textDocument = qobject_cast<TextEditor::TextDocument *>(sender());
@@ -306,13 +306,13 @@ void ModelManagerSupportClang::onCppDocumentReloadFinishedOnUnsavedFile(bool suc
} }
} }
void ModelManagerSupportClang::onCppDocumentContentsChangedOnUnsavedFile() void ClangModelManagerSupport::onCppDocumentContentsChangedOnUnsavedFile()
{ {
Core::IDocument *document = qobject_cast<Core::IDocument *>(sender()); Core::IDocument *document = qobject_cast<Core::IDocument *>(sender());
m_communicator.unsavedFilesUpdated(document); m_communicator.unsavedFilesUpdated(document);
} }
void ModelManagerSupportClang::onAbstractEditorSupportContentsUpdated(const QString &filePath, void ClangModelManagerSupport::onAbstractEditorSupportContentsUpdated(const QString &filePath,
const QByteArray &content) const QByteArray &content)
{ {
QTC_ASSERT(!filePath.isEmpty(), return); QTC_ASSERT(!filePath.isEmpty(), return);
@@ -321,7 +321,7 @@ void ModelManagerSupportClang::onAbstractEditorSupportContentsUpdated(const QStr
m_communicator.unsavedFilesUpdated(mappedPath, content, 0); m_communicator.unsavedFilesUpdated(mappedPath, content, 0);
} }
void ModelManagerSupportClang::onAbstractEditorSupportRemoved(const QString &filePath) void ClangModelManagerSupport::onAbstractEditorSupportRemoved(const QString &filePath)
{ {
QTC_ASSERT(!filePath.isEmpty(), return); QTC_ASSERT(!filePath.isEmpty(), return);
@@ -358,7 +358,7 @@ static TextEditor::AssistInterface createAssistInterface(TextEditor::TextEditorW
TextEditor::IdleEditor); TextEditor::IdleEditor);
} }
void ModelManagerSupportClang::onTextMarkContextMenuRequested(TextEditor::TextEditorWidget *widget, void ClangModelManagerSupport::onTextMarkContextMenuRequested(TextEditor::TextEditorWidget *widget,
int lineNumber, int lineNumber,
QMenu *menu) QMenu *menu)
{ {
@@ -402,7 +402,7 @@ static void updateProcessors(const ClangEditorDocumentProcessors &processors)
modelManager->updateCppEditorDocuments(/*projectsUpdated=*/ false); modelManager->updateCppEditorDocuments(/*projectsUpdated=*/ false);
} }
void ModelManagerSupportClang::onProjectAdded(ProjectExplorer::Project *project) void ClangModelManagerSupport::onProjectAdded(ProjectExplorer::Project *project)
{ {
QTC_ASSERT(!m_projectSettings.value(project), return); QTC_ASSERT(!m_projectSettings.value(project), return);
@@ -414,7 +414,7 @@ void ModelManagerSupportClang::onProjectAdded(ProjectExplorer::Project *project)
m_projectSettings.insert(project, settings); m_projectSettings.insert(project, settings);
} }
void ModelManagerSupportClang::onAboutToRemoveProject(ProjectExplorer::Project *project) void ClangModelManagerSupport::onAboutToRemoveProject(ProjectExplorer::Project *project)
{ {
ClangProjectSettings * const settings = m_projectSettings.value(project); ClangProjectSettings * const settings = m_projectSettings.value(project);
QTC_ASSERT(settings, return); QTC_ASSERT(settings, return);
@@ -422,7 +422,7 @@ void ModelManagerSupportClang::onAboutToRemoveProject(ProjectExplorer::Project *
delete settings; delete settings;
} }
void ModelManagerSupportClang::onProjectPartsUpdated(ProjectExplorer::Project *project) void ClangModelManagerSupport::onProjectPartsUpdated(ProjectExplorer::Project *project)
{ {
QTC_ASSERT(project, return); QTC_ASSERT(project, return);
const CppTools::ProjectInfo projectInfo = cppModelManager()->projectInfo(project); const CppTools::ProjectInfo projectInfo = cppModelManager()->projectInfo(project);
@@ -434,7 +434,7 @@ void ModelManagerSupportClang::onProjectPartsUpdated(ProjectExplorer::Project *p
onProjectPartsRemoved(projectPartIds); onProjectPartsRemoved(projectPartIds);
} }
void ModelManagerSupportClang::onProjectPartsRemoved(const QStringList &projectPartIds) void ClangModelManagerSupport::onProjectPartsRemoved(const QStringList &projectPartIds)
{ {
if (!projectPartIds.isEmpty()) if (!projectPartIds.isEmpty())
reinitializeBackendDocuments(projectPartIds); reinitializeBackendDocuments(projectPartIds);
@@ -448,7 +448,7 @@ static ClangEditorDocumentProcessors clangProcessorsWithDiagnosticConfig(
}); });
} }
void ModelManagerSupportClang::onDiagnosticConfigsInvalidated(const QVector<Core::Id> &configIds) void ClangModelManagerSupport::onDiagnosticConfigsInvalidated(const QVector<Core::Id> &configIds)
{ {
updateProcessors(clangProcessorsWithDiagnosticConfig(configIds)); updateProcessors(clangProcessorsWithDiagnosticConfig(configIds));
} }
@@ -461,7 +461,7 @@ clangProcessorsWithProjectParts(const QStringList &projectPartIds)
}); });
} }
void ModelManagerSupportClang::reinitializeBackendDocuments(const QStringList &projectPartIds) void ClangModelManagerSupport::reinitializeBackendDocuments(const QStringList &projectPartIds)
{ {
const auto processors = clangProcessorsWithProjectParts(projectPartIds); const auto processors = clangProcessorsWithProjectParts(projectPartIds);
foreach (ClangEditorDocumentProcessor *processor, processors) { foreach (ClangEditorDocumentProcessor *processor, processors) {
@@ -471,45 +471,45 @@ void ModelManagerSupportClang::reinitializeBackendDocuments(const QStringList &p
} }
} }
ModelManagerSupportClang *ModelManagerSupportClang::instance() ClangModelManagerSupport *ClangModelManagerSupport::instance()
{ {
return m_instance; return m_instance;
} }
BackendCommunicator &ModelManagerSupportClang::communicator() BackendCommunicator &ClangModelManagerSupport::communicator()
{ {
return m_communicator; return m_communicator;
} }
QString ModelManagerSupportClang::dummyUiHeaderOnDiskPath(const QString &filePath) const QString ClangModelManagerSupport::dummyUiHeaderOnDiskPath(const QString &filePath) const
{ {
return m_uiHeaderOnDiskManager.mapPath(filePath); return m_uiHeaderOnDiskManager.mapPath(filePath);
} }
ClangProjectSettings &ModelManagerSupportClang::projectSettings( ClangProjectSettings &ClangModelManagerSupport::projectSettings(
ProjectExplorer::Project *project) const ProjectExplorer::Project *project) const
{ {
return *m_projectSettings.value(project); return *m_projectSettings.value(project);
} }
QString ModelManagerSupportClang::dummyUiHeaderOnDiskDirPath() const QString ClangModelManagerSupport::dummyUiHeaderOnDiskDirPath() const
{ {
return m_uiHeaderOnDiskManager.directoryPath(); return m_uiHeaderOnDiskManager.directoryPath();
} }
QString ModelManagerSupportProviderClang::id() const QString ClangModelManagerSupportProvider::id() const
{ {
return QLatin1String(Constants::CLANG_MODELMANAGERSUPPORT_ID); return QLatin1String(Constants::CLANG_MODELMANAGERSUPPORT_ID);
} }
QString ModelManagerSupportProviderClang::displayName() const QString ClangModelManagerSupportProvider::displayName() const
{ {
//: Display name //: Display name
return QCoreApplication::translate("ClangCodeModel::Internal::ModelManagerSupport", return QCoreApplication::translate("ClangCodeModel::Internal::ModelManagerSupport",
"Clang"); "Clang");
} }
CppTools::ModelManagerSupport::Ptr ModelManagerSupportProviderClang::createModelManagerSupport() CppTools::ModelManagerSupport::Ptr ClangModelManagerSupportProvider::createModelManagerSupport()
{ {
return CppTools::ModelManagerSupport::Ptr(new ModelManagerSupportClang); return CppTools::ModelManagerSupport::Ptr(new ClangModelManagerSupport);
} }

View File

@@ -55,15 +55,15 @@ namespace Internal {
class ClangProjectSettings; class ClangProjectSettings;
class ModelManagerSupportClang: class ClangModelManagerSupport:
public QObject, public QObject,
public CppTools::ModelManagerSupport public CppTools::ModelManagerSupport
{ {
Q_OBJECT Q_OBJECT
public: public:
ModelManagerSupportClang(); ClangModelManagerSupport();
~ModelManagerSupportClang() override; ~ClangModelManagerSupport() override;
CppTools::CppCompletionAssistProvider *completionAssistProvider() override; CppTools::CppCompletionAssistProvider *completionAssistProvider() override;
TextEditor::BaseHoverHandler *createHoverHandler() override; TextEditor::BaseHoverHandler *createHoverHandler() override;
@@ -80,7 +80,7 @@ public:
ClangProjectSettings &projectSettings(ProjectExplorer::Project *project) const; ClangProjectSettings &projectSettings(ProjectExplorer::Project *project) const;
static ModelManagerSupportClang *instance(); static ClangModelManagerSupport *instance();
private: private:
bool eventFilter(QObject *obj, QEvent *e) override; bool eventFilter(QObject *obj, QEvent *e) override;
@@ -131,7 +131,7 @@ private:
QHash<ProjectExplorer::Project *, ClangProjectSettings *> m_projectSettings; QHash<ProjectExplorer::Project *, ClangProjectSettings *> m_projectSettings;
}; };
class ModelManagerSupportProviderClang : public CppTools::ModelManagerSupportProvider class ClangModelManagerSupportProvider : public CppTools::ModelManagerSupportProvider
{ {
public: public:
QString id() const override; QString id() const override;

View File

@@ -53,7 +53,7 @@ static Core::Id configIdForProject(ClangProjectSettings &projectSettings)
} }
ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project *project) ClangProjectSettingsWidget::ClangProjectSettingsWidget(ProjectExplorer::Project *project)
: m_projectSettings(ModelManagerSupportClang::instance()->projectSettings(project)) : m_projectSettings(ClangModelManagerSupport::instance()->projectSettings(project))
{ {
m_ui.setupUi(this); m_ui.setupUi(this);

View File

@@ -95,7 +95,7 @@ public:
private: private:
void addDummyUiHeaderOnDiskIncludePath() void addDummyUiHeaderOnDiskIncludePath()
{ {
const QString path = ModelManagerSupportClang::instance()->dummyUiHeaderOnDiskDirPath(); const QString path = ClangModelManagerSupport::instance()->dummyUiHeaderOnDiskDirPath();
if (!path.isEmpty()) { if (!path.isEmpty()) {
add("-I"); add("-I");
add(QDir::toNativeSeparators(path)); add(QDir::toNativeSeparators(path));

View File

@@ -158,7 +158,7 @@ void ClangFormatConfigWidget::initialize()
m_ui->projectHasClangFormat->hide(); m_ui->projectHasClangFormat->hide();
} else { } else {
m_ui->projectHasClangFormat->setText( m_ui->projectHasClangFormat->setText(
tr(" Current project has its own .clang-format file " tr("Current project has its own .clang-format file "
"and can be configured in Projects > Clang Format.")); "and can be configured in Projects > Clang Format."));
} }
const QString settingsDir = Core::ICore::userResourcePath(); const QString settingsDir = Core::ICore::userResourcePath();

View File

@@ -11,7 +11,7 @@
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
<string>Form</string> <string/>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout"> <layout class="QVBoxLayout" name="verticalLayout">
<property name="leftMargin"> <property name="leftMargin">

View File

@@ -567,7 +567,7 @@ QList<Task> CMakeConfigurationKitInformation::validate(const Kit *k) const
Utils::FileName tcCPath; Utils::FileName tcCPath;
Utils::FileName tcCxxPath; Utils::FileName tcCxxPath;
foreach (const CMakeConfigItem &i, config) { foreach (const CMakeConfigItem &i, config) {
// Do not use expand(QByteArray) as we can not be sure the input is latin1 // Do not use expand(QByteArray) as we cannot be sure the input is latin1
const Utils::FileName expandedValue const Utils::FileName expandedValue
= Utils::FileName::fromString(k->macroExpander()->expand(QString::fromUtf8(i.value))); = Utils::FileName::fromString(k->macroExpander()->expand(QString::fromUtf8(i.value)));
if (i.key == CMAKE_QMAKE_KEY) if (i.key == CMAKE_QMAKE_KEY)

View File

@@ -170,7 +170,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
if (senderBc && senderBc->isActive()) { if (senderBc && senderBc->isActive()) {
// The environment on our BC has changed: // The environment on our BC has changed:
// * Error out if the reader updates, can not happen since all BCs share a target/kit. // * Error out if the reader updates, cannot happen since all BCs share a target/kit.
// * run cmake without configuration arguments if the reader stays // * run cmake without configuration arguments if the reader stays
m_buildDirManager.setParametersAndRequestParse( m_buildDirManager.setParametersAndRequestParse(
BuildDirParameters(senderBc), BuildDirParameters(senderBc),
@@ -183,7 +183,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
if (senderBc && senderBc->isActive() && senderBc == m_buildDirManager.buildConfiguration()) { if (senderBc && senderBc->isActive() && senderBc == m_buildDirManager.buildConfiguration()) {
// The build directory of our BC has changed: // The build directory of our BC has changed:
// * Error out if the reader updates, can not happen since all BCs share a target/kit. // * Error out if the reader updates, cannot happen since all BCs share a target/kit.
// * run cmake without configuration arguments if the reader stays // * run cmake without configuration arguments if the reader stays
// If no configuration exists, then the arguments will get added automatically by // If no configuration exists, then the arguments will get added automatically by
// the reader. // the reader.
@@ -198,7 +198,7 @@ CMakeProject::CMakeProject(const FileName &fileName) : Project(Constants::CMAKEM
if (senderBc && senderBc->isActive() && senderBc == m_buildDirManager.buildConfiguration()) { if (senderBc && senderBc->isActive() && senderBc == m_buildDirManager.buildConfiguration()) {
// The CMake configuration has changed on our BC: // The CMake configuration has changed on our BC:
// * Error out if the reader updates, can not happen since all BCs share a target/kit. // * Error out if the reader updates, cannot happen since all BCs share a target/kit.
// * run cmake with configuration arguments if the reader stays // * run cmake with configuration arguments if the reader stays
m_buildDirManager.setParametersAndRequestParse( m_buildDirManager.setParametersAndRequestParse(
BuildDirParameters(senderBc), BuildDirParameters(senderBc),

View File

@@ -197,10 +197,10 @@ bool CorePlugin::initialize(const QStringList &arguments, QString *errorMessage)
.arg(Constants::IDE_DISPLAY_NAME), .arg(Constants::IDE_DISPLAY_NAME),
[]() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); }); []() { return QVariant(Utils::HostOsInfo::isAnyUnixHost()).toString(); });
expander->registerVariable("HostOs:PathListSeparator", expander->registerVariable("HostOs:PathListSeparator",
tr("Return the path list separator for the platform."), tr("The path list separator for the platform."),
[]() { return QString(Utils::HostOsInfo::pathListSeparator()); }); []() { return QString(Utils::HostOsInfo::pathListSeparator()); });
expander->registerVariable("HostOs:ExecutableSuffix", expander->registerVariable("HostOs:ExecutableSuffix",
tr("Return the platform executable suffix."), tr("The platform executable suffix."),
[]() { return QString(Utils::HostOsInfo::withExecutableSuffix("")); }); []() { return QString(Utils::HostOsInfo::withExecutableSuffix("")); });
expander->registerVariable("IDE:ResourcePath", expander->registerVariable("IDE:ResourcePath",
tr("The directory where %1 finds its pre-installed resources.") tr("The directory where %1 finds its pre-installed resources.")

View File

@@ -126,7 +126,7 @@ Id IDocument::id() const
* In that case, the contents of the auto save file should be loaded, the file name of the * In that case, the contents of the auto save file should be loaded, the file name of the
* IDocument should be set to \a fileName, and the document state be set to modified. * IDocument should be set to \a fileName, and the document state be set to modified.
* If the editor is opened from a regular file, \a fileName and \a realFileName are the same. * If the editor is opened from a regular file, \a fileName and \a realFileName are the same.
* Use \a errorString to return an error message, if this document can not handle the * Use \a errorString to return an error message, if this document cannot handle the
* file contents. * file contents.
* Returns whether the file was opened and read successfully. * Returns whether the file was opened and read successfully.
*/ */

View File

@@ -111,7 +111,7 @@ void InfoBar::suppressInfo(Id id)
m_suppressed << id; m_suppressed << id;
} }
// Info can not be added more than once, or if it is suppressed // Info cannot be added more than once, or if it is suppressed
bool InfoBar::canInfoBeAdded(Id id) const bool InfoBar::canInfoBeAdded(Id id) const
{ {
return !containsInfo(id) && !m_suppressed.contains(id) && !globallySuppressed.contains(id); return !containsInfo(id) && !m_suppressed.contains(id) && !globallySuppressed.contains(id);

View File

@@ -36,6 +36,8 @@
#include <coreplugin/icore.h> #include <coreplugin/icore.h>
#include <coreplugin/variablechooser.h> #include <coreplugin/variablechooser.h>
#include <debugger/analyzer/analyzericons.h>
#include <QCheckBox> #include <QCheckBox>
#include <QDir> #include <QDir>
#include <QFormLayout> #include <QFormLayout>
@@ -164,6 +166,8 @@ CppcheckOptionsPage::CppcheckOptionsPage(CppcheckTool &tool, CppcheckTrigger &tr
setId(Constants::OPTIONS_PAGE_ID); setId(Constants::OPTIONS_PAGE_ID);
setDisplayName(tr("Cppcheck")); setDisplayName(tr("Cppcheck"));
setCategory("T.Analyzer"); setCategory("T.Analyzer");
setDisplayCategory(QCoreApplication::translate("Analyzer", "Analyzer"));
setCategoryIcon(Analyzer::Icons::SETTINGSCATEGORY_ANALYZER);
CppcheckOptions options; CppcheckOptions options;
if (Utils::HostOsInfo::isAnyUnixHost()) { if (Utils::HostOsInfo::isAnyUnixHost()) {

View File

@@ -24,7 +24,7 @@
****************************************************************************/ ****************************************************************************/
#include "cppcompletionassist.h" #include "cppcompletionassist.h"
#include "cppmodelmanagersupportinternal.h" #include "cppbuiltinmodelmanagersupport.h"
#include "cppfollowsymbolundercursor.h" #include "cppfollowsymbolundercursor.h"
#include "cpphoverhandler.h" #include "cpphoverhandler.h"
#include "cppoverviewmodel.h" #include "cppoverviewmodel.h"
@@ -38,60 +38,60 @@
using namespace CppTools; using namespace CppTools;
using namespace CppTools::Internal; using namespace CppTools::Internal;
QString ModelManagerSupportProviderInternal::id() const QString BuiltinModelManagerSupportProvider::id() const
{ {
return QLatin1String("CppTools.BuiltinCodeModel"); return QLatin1String("CppTools.BuiltinCodeModel");
} }
QString ModelManagerSupportProviderInternal::displayName() const QString BuiltinModelManagerSupportProvider::displayName() const
{ {
return QCoreApplication::translate("ModelManagerSupportInternal::displayName", return QCoreApplication::translate("ModelManagerSupportInternal::displayName",
"%1 Built-in").arg(Core::Constants::IDE_DISPLAY_NAME); "%1 Built-in").arg(Core::Constants::IDE_DISPLAY_NAME);
} }
ModelManagerSupport::Ptr ModelManagerSupportProviderInternal::createModelManagerSupport() ModelManagerSupport::Ptr BuiltinModelManagerSupportProvider::createModelManagerSupport()
{ {
return ModelManagerSupport::Ptr(new ModelManagerSupportInternal); return ModelManagerSupport::Ptr(new BuiltinModelManagerSupport);
} }
ModelManagerSupportInternal::ModelManagerSupportInternal() BuiltinModelManagerSupport::BuiltinModelManagerSupport()
: m_completionAssistProvider(new InternalCompletionAssistProvider), : m_completionAssistProvider(new InternalCompletionAssistProvider),
m_followSymbol(new FollowSymbolUnderCursor), m_followSymbol(new FollowSymbolUnderCursor),
m_refactoringEngine(new CppRefactoringEngine) m_refactoringEngine(new CppRefactoringEngine)
{ {
} }
ModelManagerSupportInternal::~ModelManagerSupportInternal() BuiltinModelManagerSupport::~BuiltinModelManagerSupport()
{ {
} }
BaseEditorDocumentProcessor *ModelManagerSupportInternal::createEditorDocumentProcessor( BaseEditorDocumentProcessor *BuiltinModelManagerSupport::createEditorDocumentProcessor(
TextEditor::TextDocument *baseTextDocument) TextEditor::TextDocument *baseTextDocument)
{ {
return new BuiltinEditorDocumentProcessor(baseTextDocument); return new BuiltinEditorDocumentProcessor(baseTextDocument);
} }
CppCompletionAssistProvider *ModelManagerSupportInternal::completionAssistProvider() CppCompletionAssistProvider *BuiltinModelManagerSupport::completionAssistProvider()
{ {
return m_completionAssistProvider.data(); return m_completionAssistProvider.data();
} }
TextEditor::BaseHoverHandler *ModelManagerSupportInternal::createHoverHandler() TextEditor::BaseHoverHandler *BuiltinModelManagerSupport::createHoverHandler()
{ {
return new CppHoverHandler; return new CppHoverHandler;
} }
FollowSymbolInterface &ModelManagerSupportInternal::followSymbolInterface() FollowSymbolInterface &BuiltinModelManagerSupport::followSymbolInterface()
{ {
return *m_followSymbol; return *m_followSymbol;
} }
RefactoringEngineInterface &ModelManagerSupportInternal::refactoringEngineInterface() RefactoringEngineInterface &BuiltinModelManagerSupport::refactoringEngineInterface()
{ {
return *m_refactoringEngine; return *m_refactoringEngine;
} }
std::unique_ptr<AbstractOverviewModel> ModelManagerSupportInternal::createOverviewModel() std::unique_ptr<AbstractOverviewModel> BuiltinModelManagerSupport::createOverviewModel()
{ {
return std::make_unique<CppTools::OverviewModel>(); return std::make_unique<CppTools::OverviewModel>();
} }

View File

@@ -32,13 +32,13 @@
namespace CppTools { namespace CppTools {
namespace Internal { namespace Internal {
class ModelManagerSupportInternal: public ModelManagerSupport class BuiltinModelManagerSupport: public ModelManagerSupport
{ {
Q_DISABLE_COPY(ModelManagerSupportInternal) Q_DISABLE_COPY(BuiltinModelManagerSupport)
public: public:
ModelManagerSupportInternal(); BuiltinModelManagerSupport();
virtual ~ModelManagerSupportInternal(); virtual ~BuiltinModelManagerSupport();
CppCompletionAssistProvider *completionAssistProvider() final; CppCompletionAssistProvider *completionAssistProvider() final;
TextEditor::BaseHoverHandler *createHoverHandler() final; TextEditor::BaseHoverHandler *createHoverHandler() final;
@@ -55,7 +55,7 @@ private:
QScopedPointer<RefactoringEngineInterface> m_refactoringEngine; QScopedPointer<RefactoringEngineInterface> m_refactoringEngine;
}; };
class ModelManagerSupportProviderInternal : public ModelManagerSupportProvider class BuiltinModelManagerSupportProvider : public ModelManagerSupportProvider
{ {
public: public:
QString id() const override; QString id() const override;

View File

@@ -38,7 +38,7 @@
#include "cppindexingsupport.h" #include "cppindexingsupport.h"
#include "cpplocatordata.h" #include "cpplocatordata.h"
#include "cpplocatorfilter.h" #include "cpplocatorfilter.h"
#include "cppmodelmanagersupportinternal.h" #include "cppbuiltinmodelmanagersupport.h"
#include "cppqtstyleindenter.h" #include "cppqtstyleindenter.h"
#include "cpprefactoringchanges.h" #include "cpprefactoringchanges.h"
#include "cpprefactoringengine.h" #include "cpprefactoringengine.h"
@@ -502,7 +502,7 @@ void CppModelManager::initCppTools()
void CppModelManager::initializeBuiltinModelManagerSupport() void CppModelManager::initializeBuiltinModelManagerSupport()
{ {
d->m_builtinModelManagerSupport d->m_builtinModelManagerSupport
= ModelManagerSupportProviderInternal().createModelManagerSupport(); = BuiltinModelManagerSupportProvider().createModelManagerSupport();
d->m_activeModelManagerSupport = d->m_builtinModelManagerSupport; d->m_activeModelManagerSupport = d->m_builtinModelManagerSupport;
d->m_refactoringEngines[RefactoringEngineType::BuiltIn] = d->m_refactoringEngines[RefactoringEngineType::BuiltIn] =
&d->m_activeModelManagerSupport->refactoringEngineInterface(); &d->m_activeModelManagerSupport->refactoringEngineInterface();

View File

@@ -48,7 +48,6 @@ HEADERS += \
cpplocatorfilter.h \ cpplocatorfilter.h \
cppmodelmanager.h \ cppmodelmanager.h \
cppmodelmanagersupport.h \ cppmodelmanagersupport.h \
cppmodelmanagersupportinternal.h \
cppoverviewmodel.h \ cppoverviewmodel.h \
cpppointerdeclarationformatter.h \ cpppointerdeclarationformatter.h \
cppprojectfile.h \ cppprojectfile.h \
@@ -101,7 +100,8 @@ HEADERS += \
wrappablelineedit.h \ wrappablelineedit.h \
usages.h \ usages.h \
cpptools_clangtidychecks.h \ cpptools_clangtidychecks.h \
cppmodelmanagerinterface.h cppmodelmanagerinterface.h \
cppbuiltinmodelmanagersupport.h
SOURCES += \ SOURCES += \
abstracteditorsupport.cpp \ abstracteditorsupport.cpp \
@@ -146,7 +146,6 @@ SOURCES += \
cpplocatorfilter.cpp \ cpplocatorfilter.cpp \
cppmodelmanager.cpp \ cppmodelmanager.cpp \
cppmodelmanagersupport.cpp \ cppmodelmanagersupport.cpp \
cppmodelmanagersupportinternal.cpp \
cppoverviewmodel.cpp \ cppoverviewmodel.cpp \
cpppointerdeclarationformatter.cpp \ cpppointerdeclarationformatter.cpp \
cppprojectfile.cpp \ cppprojectfile.cpp \
@@ -187,7 +186,8 @@ SOURCES += \
compileroptionsbuilder.cpp \ compileroptionsbuilder.cpp \
cppprojectfilecategorizer.cpp \ cppprojectfilecategorizer.cpp \
cppprojectpartchooser.cpp \ cppprojectpartchooser.cpp \
wrappablelineedit.cpp wrappablelineedit.cpp \
cppbuiltinmodelmanagersupport.cpp
FORMS += \ FORMS += \
clangdiagnosticconfigswidget.ui \ clangdiagnosticconfigswidget.ui \

View File

@@ -56,6 +56,8 @@ Project {
"clazychecks.ui", "clazychecks.ui",
"compileroptionsbuilder.cpp", "compileroptionsbuilder.cpp",
"compileroptionsbuilder.h", "compileroptionsbuilder.h",
"cppbuiltinmodelmanagersupport.cpp",
"cppbuiltinmodelmanagersupport.h",
"cppcanonicalsymbol.cpp", "cppcanonicalsymbol.cpp",
"cppcanonicalsymbol.h", "cppcanonicalsymbol.h",
"cppchecksymbols.cpp", "cppchecksymbols.cpp",
@@ -123,8 +125,6 @@ Project {
"cppmodelmanager.h", "cppmodelmanager.h",
"cppmodelmanagersupport.cpp", "cppmodelmanagersupport.cpp",
"cppmodelmanagersupport.h", "cppmodelmanagersupport.h",
"cppmodelmanagersupportinternal.cpp",
"cppmodelmanagersupportinternal.h",
"cppoverviewmodel.cpp", "cppoverviewmodel.cpp",
"cppoverviewmodel.h", "cppoverviewmodel.h",
"cpppointerdeclarationformatter.cpp", "cpppointerdeclarationformatter.cpp",
@@ -215,7 +215,7 @@ Project {
"tidychecks.ui", "tidychecks.ui",
"typehierarchybuilder.cpp", "typehierarchybuilder.cpp",
"typehierarchybuilder.h", "typehierarchybuilder.h",
"usages.h" "usages.h",
] ]
Group { Group {

View File

@@ -99,7 +99,7 @@ const char SYMBOLS_FIND_FILTER_DISPLAY_NAME[] = QT_TRANSLATE_NOOP("CppTools", "C
// CLANG_VERSION here because it might denote a version that was not yet // CLANG_VERSION here because it might denote a version that was not yet
// released (e.g. 6.0.1, but only 6.0.0 was released). // released (e.g. 6.0.1, but only 6.0.0 was released).
constexpr const char TIDY_DOCUMENTATION_URL_TEMPLATE[] constexpr const char TIDY_DOCUMENTATION_URL_TEMPLATE[]
= "https://releases.llvm.org/6.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/%1.html"; = "https://releases.llvm.org/7.0.0/tools/clang/tools/extra/docs/clang-tidy/checks/%1.html";
} // namespace Constants } // namespace Constants
} // namespace CppTools } // namespace CppTools

View File

@@ -1331,12 +1331,6 @@ void BreakpointItem::setEnabled(bool on)
adjustMarker(); adjustMarker();
} }
void BreakHandler::setBreakpointEnabled(const Breakpoint &bp, bool on)
{
bp->setEnabled(on);
requestBreakpointUpdate(bp);
}
void DebuggerEngine::notifyBreakpointInsertProceeding(const Breakpoint &bp) void DebuggerEngine::notifyBreakpointInsertProceeding(const Breakpoint &bp)
{ {
QTC_ASSERT(bp, return); QTC_ASSERT(bp, return);

View File

@@ -257,7 +257,6 @@ public:
// Convenience. // Convenience.
void setWatchpointAtAddress(quint64 address, unsigned size); void setWatchpointAtAddress(quint64 address, unsigned size);
void setWatchpointAtExpression(const QString &exp); void setWatchpointAtExpression(const QString &exp);
void setBreakpointEnabled(const Breakpoint &bp, bool on);
void updateDisassemblerMarker(const Breakpoint &bp); void updateDisassemblerMarker(const Breakpoint &bp);
void removeDisassemblerMarker(const Breakpoint &bp); void removeDisassemblerMarker(const Breakpoint &bp);

View File

@@ -610,7 +610,7 @@ void CdbEngine::runEngine()
const auto cb = [this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); }; const auto cb = [this](const DebuggerResponse &r) { handleBreakInsert(r, Breakpoint()); };
if (boolSetting(CdbBreakOnCrtDbgReport)) { if (boolSetting(CdbBreakOnCrtDbgReport)) {
Abi::OSFlavor flavor = runParameters().toolChainAbi.osFlavor(); Abi::OSFlavor flavor = runParameters().toolChainAbi.osFlavor();
// CrtDebugReport can not be safely resolved for vc 19 // CrtDebugReport cannot be safely resolved for vc 19
if ((flavor > Abi::WindowsMsvc2005Flavor && flavor <= Abi::WindowsMsvc2013Flavor) || if ((flavor > Abi::WindowsMsvc2005Flavor && flavor <= Abi::WindowsMsvc2013Flavor) ||
flavor > Abi::WindowsMSysFlavor || flavor <= Abi::WindowsCEFlavor) { flavor > Abi::WindowsMSysFlavor || flavor <= Abi::WindowsCEFlavor) {
const QString module = msvcRunTime(flavor); const QString module = msvcRunTime(flavor);
@@ -743,18 +743,23 @@ static inline bool isWatchIName(const QString &iname)
bool CdbEngine::hasCapability(unsigned cap) const bool CdbEngine::hasCapability(unsigned cap) const
{ {
return cap & (DisassemblerCapability | RegisterCapability return cap & (DisassemblerCapability
| RegisterCapability
| ShowMemoryCapability | ShowMemoryCapability
|WatchpointByAddressCapability|JumpToLineCapability|AddWatcherCapability|WatchWidgetsCapability | WatchpointByAddressCapability
|ReloadModuleCapability | JumpToLineCapability
|BreakOnThrowAndCatchCapability // Sort-of: Can break on throw(). | AddWatcherCapability
|BreakConditionCapability|TracePointCapability | WatchWidgetsCapability
|BreakModuleCapability | ReloadModuleCapability
|CreateFullBacktraceCapability | BreakOnThrowAndCatchCapability // Sort-of: Can break on throw().
|OperateByInstructionCapability | BreakConditionCapability|TracePointCapability
|RunToLineCapability | BreakIndividualLocationsCapability
|MemoryAddressCapability | BreakModuleCapability
|AdditionalQmlStackCapability); | CreateFullBacktraceCapability
| OperateByInstructionCapability
| RunToLineCapability
| MemoryAddressCapability
| AdditionalQmlStackCapability);
} }
void CdbEngine::executeStepIn(bool byInstruction) void CdbEngine::executeStepIn(bool byInstruction)
@@ -832,6 +837,7 @@ void CdbEngine::handleDoInterruptInferior(const QString &errorMessage)
void CdbEngine::doInterruptInferior(const InterruptCallback &callback) void CdbEngine::doInterruptInferior(const InterruptCallback &callback)
{ {
const bool requestInterrupt = m_stopMode == NoStopRequested;
if (callback) { if (callback) {
m_interrupCallbacks.push_back(callback); m_interrupCallbacks.push_back(callback);
if (!m_initialSessionIdleHandled) if (!m_initialSessionIdleHandled)
@@ -842,6 +848,8 @@ void CdbEngine::doInterruptInferior(const InterruptCallback &callback)
m_stopMode = Interrupt; m_stopMode = Interrupt;
} }
if (!requestInterrupt)
return; // we already requested a stop no need to interrupt twice
showMessage(QString("Interrupting process %1...").arg(inferiorPid()), LogMisc); showMessage(QString("Interrupting process %1...").arg(inferiorPid()), LogMisc);
QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return); QTC_ASSERT(!m_signalOperation, notifyInferiorStopFailed(); return);
QTC_ASSERT(device(), notifyInferiorRunFailed(); return); QTC_ASSERT(device(), notifyInferiorRunFailed(); return);
@@ -2489,7 +2497,7 @@ void CdbEngine::insertBreakpoint(const Breakpoint &bp)
BreakpointParameters parameters = bp->requestedParameters(); BreakpointParameters parameters = bp->requestedParameters();
const auto handleBreakInsertCB = [this, bp](const DebuggerResponse &r) { handleBreakInsert(r, bp); }; const auto handleBreakInsertCB = [this, bp](const DebuggerResponse &r) { handleBreakInsert(r, bp); };
BreakpointParameters response = parameters; BreakpointParameters response = parameters;
auto responseId = QString::number(breakPointIdToCdbId(bp)); const QString responseId = breakPointCdbId(bp);
QScopedPointer<BreakpointCorrectionContext> lineCorrection( QScopedPointer<BreakpointCorrectionContext> lineCorrection(
new BreakpointCorrectionContext(m_codeModelSnapshot, CppTools::CppModelManager::instance()->workingCopy())); new BreakpointCorrectionContext(m_codeModelSnapshot, CppTools::CppModelManager::instance()->workingCopy()));
if (!m_autoBreakPointCorrection if (!m_autoBreakPointCorrection
@@ -2536,7 +2544,7 @@ void CdbEngine::updateBreakpoint(const Breakpoint &bp)
BreakpointParameters parameters = bp->requestedParameters(); BreakpointParameters parameters = bp->requestedParameters();
const auto handleBreakInsertCB = [this, bp](const DebuggerResponse &r) { handleBreakInsert(r, bp); }; const auto handleBreakInsertCB = [this, bp](const DebuggerResponse &r) { handleBreakInsert(r, bp); };
BreakpointParameters response = parameters; BreakpointParameters response = parameters;
auto responseId = QString::number(breakPointIdToCdbId(bp)); const QString responseId = breakPointCdbId(bp);
notifyBreakpointChangeProceeding(bp); notifyBreakpointChangeProceeding(bp);
if (debugBreakpoints) if (debugBreakpoints)
qDebug("Changing %d:\n %s\nTo %s\n", bp->modelId(), qDebug("Changing %d:\n %s\nTo %s\n", bp->modelId(),
@@ -2745,7 +2753,7 @@ void CdbEngine::setupScripting(const DebuggerResponse &response)
} }
if (!ok) { if (!ok) {
m_pythonVersion = 0; m_pythonVersion = 0;
showMessage(QString("Can not parse sys.version:\n%1").arg(verOutput), LogWarning); showMessage(QString("Cannot parse sys.version:\n%1").arg(verOutput), LogWarning);
return; return;
} }

View File

@@ -106,7 +106,7 @@
<item> <item>
<widget class="QGroupBox" name="exceptions"> <widget class="QGroupBox" name="exceptions">
<property name="title"> <property name="title">
<string>Task Entries for Exceptions </string> <string>Add Exceptions to Issues View</string>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout"> <layout class="QHBoxLayout" name="horizontalLayout">
<item> <item>

View File

@@ -128,25 +128,14 @@ static BreakpointParameters fixWinMSVCBreakpoint(const BreakpointParameters &p)
return p; return p;
} }
int breakPointIdToCdbId(const Breakpoint &bp) QString breakPointCdbId(const Breakpoint &bp)
{ {
// return cdbBreakPointStartId + bp.majorPart() * cdbBreakPointIdMinorPart + bp.minorPart(); static int bpId = 1;
if (!bp->responseId().isEmpty()) if (!bp->responseId().isEmpty())
return bp->responseId().toInt(); return bp->responseId();
return cdbBreakPointStartId + bp->modelId() * cdbBreakPointIdMinorPart; return QString::number(cdbBreakPointStartId + (bpId++) * cdbBreakPointIdMinorPart);
} }
//static int cdbIdToBreakpointModel(int cdbid)
//{
// if (cdbid >= cdbBreakPointStartId) {
// int major = (cdbid - cdbBreakPointStartId) / cdbBreakPointIdMinorPart;
// int minor = cdbid % cdbBreakPointIdMinorPart;
// (void) minor;
// return major;
// }
// return 0;
//}
QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn, QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
const QList<QPair<QString, QString> > &sourcePathMapping, const QList<QPair<QString, QString> > &sourcePathMapping,
const QString &responseId, const QString &responseId,
@@ -212,11 +201,11 @@ QString cdbAddBreakpointCommand(const BreakpointParameters &bpIn,
QString cdbClearBreakpointCommand(const Breakpoint &bp) QString cdbClearBreakpointCommand(const Breakpoint &bp)
{ {
// FIME: Check // FIME: Check
// const int firstBreakPoint = breakPointIdToCdbId(id); // const int firstBreakPoint = breakPointCdbId(id);
// if (id.isMinor()) // if (id.isMinor())
// return "bc " + QString::number(firstBreakPoint); // return "bc " + QString::number(firstBreakPoint);
// If this is a major break point we also want to delete all sub break points // If this is a major break point we also want to delete all sub break points
const int firstBreakPoint = cdbBreakPointStartId + bp->modelId() * cdbBreakPointIdMinorPart; const int firstBreakPoint = bp->responseId().toInt();
const int lastBreakPoint = firstBreakPoint + cdbBreakPointIdMinorPart - 1; const int lastBreakPoint = firstBreakPoint + cdbBreakPointIdMinorPart - 1;
return "bc " + QString::number(firstBreakPoint) + '-' + QString::number(lastBreakPoint); return "bc " + QString::number(firstBreakPoint) + '-' + QString::number(lastBreakPoint);
} }

View File

@@ -53,7 +53,7 @@ QString cdbSourcePathMapping(QString fileName,
enum { cdbBreakPointStartId = 100000, enum { cdbBreakPointStartId = 100000,
cdbBreakPointIdMinorPart = 100}; cdbBreakPointIdMinorPart = 100};
int breakPointIdToCdbId(const Breakpoint &bp); QString breakPointCdbId(const Breakpoint &bp);
// Convert breakpoint in CDB syntax (applying source path mappings using native paths). // Convert breakpoint in CDB syntax (applying source path mappings using native paths).
QString cdbAddBreakpointCommand(const BreakpointParameters &d, QString cdbAddBreakpointCommand(const BreakpointParameters &d,

View File

@@ -1261,11 +1261,13 @@ void DebuggerEnginePrivate::setInitialActionStates()
m_recordForReverseOperationAction.setCheckable(true); m_recordForReverseOperationAction.setCheckable(true);
m_recordForReverseOperationAction.setChecked(false); m_recordForReverseOperationAction.setChecked(false);
m_recordForReverseOperationAction.setIcon(Icons::RECORD_OFF.icon()); m_recordForReverseOperationAction.setIcon(Icons::RECORD_OFF.icon());
m_recordForReverseOperationAction.setToolTip(tr( m_recordForReverseOperationAction.setToolTip(QString("<html><head/><body><p>%1</p><p>"
"<html><head/><body><p>Record information to enable stepping backwards.</p><p>" "<b>%2</b>%3</p></body></html>").arg(
"<b>Note:</b> This feature is very slow and unstable on the GDB side. " tr("Record information to enable stepping backwards."),
tr("Note: "),
tr("This feature is very slow and unstable on the GDB side. "
"It exhibits unpredictable behavior when going backwards over system " "It exhibits unpredictable behavior when going backwards over system "
"calls and is very likely to destroy your debugging session.</p></body></html>")); "calls and is very likely to destroy your debugging session.")));
m_operateInReverseDirectionAction.setCheckable(true); m_operateInReverseDirectionAction.setCheckable(true);
m_operateInReverseDirectionAction.setChecked(false); m_operateInReverseDirectionAction.setChecked(false);
@@ -1847,7 +1849,7 @@ void DebuggerEngine::handleBeginOfRecordingReached()
void DebuggerEngine::handleRecordingFailed() void DebuggerEngine::handleRecordingFailed()
{ {
showStatusMessage(tr("Reverse-execution recording failed..")); showStatusMessage(tr("Reverse-execution recording failed."));
d->m_operateInReverseDirectionAction.setChecked(false); d->m_operateInReverseDirectionAction.setChecked(false);
d->m_recordForReverseOperationAction.setChecked(false); d->m_recordForReverseOperationAction.setChecked(false);
d->updateReverseActions(); d->updateReverseActions();

View File

@@ -1963,7 +1963,7 @@ void DebuggerPluginPrivate::requestContextMenu(TextEditorWidget *widget,
} }
// Edit existing breakpoint. // Edit existing breakpoint.
act = menu->addAction(tr("Edit Breakpoint ...")); act = menu->addAction(tr("Edit Breakpoint..."));
connect(act, &QAction::triggered, [gbp] { connect(act, &QAction::triggered, [gbp] {
BreakpointManager::editBreakpoint(gbp, ICore::dialogParent()); BreakpointManager::editBreakpoint(gbp, ICore::dialogParent());
}); });

View File

@@ -238,9 +238,10 @@ void MergeTool::readData()
} else if (m_line.startsWith("Hit return")) { } else if (m_line.startsWith("Hit return")) {
QMessageBox::warning( QMessageBox::warning(
Core::ICore::dialogParent(), tr("Merge Tool"), Core::ICore::dialogParent(), tr("Merge Tool"),
tr("<html><body><p>Merge tool is not configured.</p>\n" QString("<html><body><p>%1</p>\n<p>%2</p></body></html>").arg(
"<p>Run git config --global merge.tool &lt;tool&gt; to configure it, " tr("Merge tool is not configured."),
"then try again</p></body></html>")); tr("Run git config --global merge.tool &lt;tool&gt; "
"to configure it, then try again.")));
m_process->kill(); m_process->kill();
} else if (m_line.endsWith('\n')) { } else if (m_line.endsWith('\n')) {
// Skip unidentified lines // Skip unidentified lines

View File

@@ -126,7 +126,7 @@ void IosBuildSettingsWidget::setDefaultSigningIdentfier(const QString &identifie
} else { } else {
// Reset to default // Reset to default
ui->m_signEntityCombo->setCurrentIndex(0); ui->m_signEntityCombo->setCurrentIndex(0);
qCDebug(iosSettingsLog) << "Can not find default" qCDebug(iosSettingsLog) << "Cannot find default"
<< (ui->m_autoSignCheckbox->isChecked() ? "team": "provisioning profile") << (ui->m_autoSignCheckbox->isChecked() ? "team": "provisioning profile")
<< ". Identifier: " << identifier; << ". Identifier: " << identifier;
} }

View File

@@ -107,7 +107,7 @@ static bool launchSimulator(const QString &simUdid) {
return runSimCtlCommand(QStringList({"boot", simUdid}), nullptr); return runSimCtlCommand(QStringList({"boot", simUdid}), nullptr);
} }
} else { } else {
qCDebug(simulatorLog) << "Can not start Simulator device." qCDebug(simulatorLog) << "Cannot start Simulator device."
<< "Error probing Simulator.app instance"; << "Error probing Simulator.app instance";
return false; return false;
} }
@@ -438,7 +438,7 @@ void SimulatorControlPrivate::startSimulator(QFutureInterface<SimulatorControl::
} }
if (simInfo.isShuttingDown()) { if (simInfo.isShuttingDown()) {
qCDebug(simulatorLog) << "Can not start Simulator device. " qCDebug(simulatorLog) << "Cannot start Simulator device. "
<< "Previous instance taking too long to shutdown." << simInfo; << "Previous instance taking too long to shutdown." << simInfo;
return; return;
} }
@@ -465,7 +465,7 @@ void SimulatorControlPrivate::startSimulator(QFutureInterface<SimulatorControl::
qCDebug(simulatorLog) << "Error starting simulator."; qCDebug(simulatorLog) << "Error starting simulator.";
} }
} else { } else {
qCDebug(simulatorLog) << "Can not start Simulator device. Simulator not in shutdown state." qCDebug(simulatorLog) << "Cannot start Simulator device. Simulator not in shutdown state."
<< simInfo; << simInfo;
} }

View File

@@ -658,7 +658,7 @@ void BaseClient::intializeCallback(const InitializeResponse &initResponse)
if (optional<ResponseError<InitializeError>> error = initResponse.error()) { if (optional<ResponseError<InitializeError>> error = initResponse.error()) {
if (error.value().data().has_value() if (error.value().data().has_value()
&& error.value().data().value().retry().value_or(false)) { && error.value().data().value().retry().value_or(false)) {
const QString title(tr("Language Server \"%1\" Initialize Error")); const QString title(tr("Language Server \"%1\" Initialize Error").arg(m_displayName));
auto result = QMessageBox::warning(Core::ICore::dialogParent(), auto result = QMessageBox::warning(Core::ICore::dialogParent(),
title, title,
error.value().message(), error.value().message(),
@@ -813,7 +813,7 @@ void StdIOClient::sendData(const QByteArray &data)
void StdIOClient::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus) void StdIOClient::onProcessFinished(int exitCode, QProcess::ExitStatus exitStatus)
{ {
if (exitStatus == QProcess::CrashExit) if (exitStatus == QProcess::CrashExit)
setError(tr("Crashed with exit code %1 : %2").arg(exitCode).arg(m_process.error())); setError(tr("Crashed with exit code %1: %2").arg(exitCode, m_process.error()));
emit finished(); emit finished();
} }

View File

@@ -372,6 +372,7 @@ void LanguageClientCompletionAssistProcessor::handleCompletionResponse(
proposal->m_document = m_document; proposal->m_document = m_document;
proposal->m_pos = m_pos; proposal->m_pos = m_pos;
proposal->setFragile(true); proposal->setFragile(true);
proposal->setSupportsPrefix(false);
setAsyncProposalAvailable(proposal); setAsyncProposalAvailable(proposal);
qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : " qCDebug(LOGLSPCOMPLETION) << QTime::currentTime() << " : "
<< items.count() << " completions handled"; << items.count() << " completions handled";

View File

@@ -127,7 +127,7 @@ protected:
~IBuildConfigurationFactory() override; ~IBuildConfigurationFactory() override;
public: public:
// The priority is negative if this factory can not create anything for the target. // The priority is negative if this factory cannot create anything for the target.
// It is 0 for the "default" factory that wants to handle the target. // It is 0 for the "default" factory that wants to handle the target.
// Add 100 for each specialization. // Add 100 for each specialization.
virtual int priority(const Target *parent) const; virtual int priority(const Target *parent) const;

View File

@@ -373,13 +373,25 @@ FolderNavigationWidget::FolderNavigationWidget(QWidget *parent) : QWidget(parent
connect(m_listView, &QAbstractItemView::activated, this, [this](const QModelIndex &index) { connect(m_listView, &QAbstractItemView::activated, this, [this](const QModelIndex &index) {
openItem(m_sortProxyModel->mapToSource(index)); openItem(m_sortProxyModel->mapToSource(index));
}); });
// use QueuedConnection for updating crumble path, because that can scroll, which doesn't // Delay updating crumble path by event loop cylce, because that can scroll, which doesn't
// work well when done directly in currentChanged (the wrong item can get highlighted) // work well when done directly in currentChanged (the wrong item can get highlighted).
// We cannot use Qt::QueuedConnection directly, because the QModelIndex could get invalidated
// in the meantime, so use a queued invokeMethod instead.
connect(m_listView->selectionModel(), connect(m_listView->selectionModel(),
&QItemSelectionModel::currentChanged, &QItemSelectionModel::currentChanged,
this, this,
&FolderNavigationWidget::setCrumblePath, [this](const QModelIndex &index) {
Qt::QueuedConnection); const QModelIndex sourceIndex = m_sortProxyModel->mapToSource(index);
const auto filePath = Utils::FileName::fromString(
m_fileSystemModel->filePath(sourceIndex));
// QTimer::singleShot only posts directly onto the event loop if you use the SLOT("...")
// notation, so using a singleShot with a lambda would flicker
// QTimer::singleShot(0, this, [this, filePath]() { setCrumblePath(filePath); });
QMetaObject::invokeMethod(this,
"setCrumblePath",
Qt::QueuedConnection,
Q_ARG(Utils::FileName, filePath));
});
connect(m_crumbLabel, &Utils::FileCrumbLabel::pathClicked, [this](const Utils::FileName &path) { connect(m_crumbLabel, &Utils::FileCrumbLabel::pathClicked, [this](const Utils::FileName &path) {
const QModelIndex rootIndex = m_sortProxyModel->mapToSource(m_listView->rootIndex()); const QModelIndex rootIndex = m_sortProxyModel->mapToSource(m_listView->rootIndex());
const QModelIndex fileIndex = m_fileSystemModel->index(path.toString()); const QModelIndex fileIndex = m_fileSystemModel->index(path.toString());
@@ -623,7 +635,7 @@ void FolderNavigationWidget::selectFile(const Utils::FileName &filePath)
} else { } else {
m_listView->scrollTo(fileIndex); m_listView->scrollTo(fileIndex);
} }
setCrumblePath(fileIndex); setCrumblePath(filePath);
}); });
} }
} }
@@ -699,12 +711,12 @@ void FolderNavigationWidget::createNewFolder(const QModelIndex &parent)
m_listView->edit(index); m_listView->edit(index);
} }
void FolderNavigationWidget::setCrumblePath(const QModelIndex &index) void FolderNavigationWidget::setCrumblePath(const Utils::FileName &filePath)
{ {
const QModelIndex sourceIndex = m_sortProxyModel->mapToSource(index); const QModelIndex index = m_fileSystemModel->index(filePath.toString());
const int width = m_crumbLabel->width(); const int width = m_crumbLabel->width();
const int previousHeight = m_crumbLabel->immediateHeightForWidth(width); const int previousHeight = m_crumbLabel->immediateHeightForWidth(width);
m_crumbLabel->setPath(Utils::FileName::fromString(m_fileSystemModel->filePath(sourceIndex))); m_crumbLabel->setPath(filePath);
const int currentHeight = m_crumbLabel->immediateHeightForWidth(width); const int currentHeight = m_crumbLabel->immediateHeightForWidth(width);
const int diff = currentHeight - previousHeight; const int diff = currentHeight - previousHeight;
if (diff != 0 && m_crumbLabel->isVisible()) { if (diff != 0 && m_crumbLabel->isVisible()) {

View File

@@ -118,6 +118,9 @@ public:
protected: protected:
void contextMenuEvent(QContextMenuEvent *ev) override; void contextMenuEvent(QContextMenuEvent *ev) override;
private slots:
void setCrumblePath(const Utils::FileName &filePath);
private: private:
bool rootAutoSynchronization() const; bool rootAutoSynchronization() const;
void setRootAutoSynchronization(bool sync); void setRootAutoSynchronization(bool sync);
@@ -131,7 +134,6 @@ private:
QStringList projectsInDirectory(const QModelIndex &index) const; QStringList projectsInDirectory(const QModelIndex &index) const;
void openProjectsInDirectory(const QModelIndex &index); void openProjectsInDirectory(const QModelIndex &index);
void createNewFolder(const QModelIndex &parent); void createNewFolder(const QModelIndex &parent);
void setCrumblePath(const QModelIndex &index);
Core::IContext *m_context = nullptr; Core::IContext *m_context = nullptr;
Utils::NavigationTreeView *m_listView = nullptr; Utils::NavigationTreeView *m_listView = nullptr;

View File

@@ -360,7 +360,7 @@ static Utils::FileName findLocalCompiler(const Utils::FileName &compilerPath,
// Find the "real" compiler if icecc, distcc or similar are in use. Ignore ccache, since that // Find the "real" compiler if icecc, distcc or similar are in use. Ignore ccache, since that
// is local already. // is local already.
// Get the path to the compiler, ignoring direct calls to icecc and distcc as we can not // Get the path to the compiler, ignoring direct calls to icecc and distcc as we cannot
// do anything about those. // do anything about those.
const Utils::FileName compilerDir = compilerPath.parentDir(); const Utils::FileName compilerDir = compilerPath.parentDir();
const QString compilerDirString = compilerDir.toString(); const QString compilerDirString = compilerDir.toString();

View File

@@ -180,7 +180,7 @@ void GnuMakeParser::taskAdded(const Task &task, int linkedLines, int skippedLine
if (possibleFiles.size() == 1) if (possibleFiles.size() == 1)
editable.file = Utils::FileName(possibleFiles.first()); editable.file = Utils::FileName(possibleFiles.first());
// Let the Makestep apply additional heuristics (based on // Let the Makestep apply additional heuristics (based on
// files in ther project) if we can not uniquely // files in ther project) if we cannot uniquely
// identify the file! // identify the file!
} }

View File

@@ -181,7 +181,7 @@ QVariant JsonWizard::value(const QString &n) const
if (v.isValid()) if (v.isValid())
return v; return v;
if (hasField(n)) if (hasField(n))
return field(n); // Can not contain macros! return field(n); // Cannot contain macros!
return QVariant(); return QVariant();
} }

View File

@@ -25,6 +25,8 @@
#include "jsonwizardfactory.h" #include "jsonwizardfactory.h"
#include <coreplugin/icore.h>
#include <projectexplorer/projectexplorer.h> #include <projectexplorer/projectexplorer.h>
#include <QJsonDocument> #include <QJsonDocument>
@@ -246,6 +248,12 @@ void ProjectExplorer::ProjectExplorerPlugin::testJsonWizardsComboBox()
QCOMPARE(qPrintable(disabledComboBox->currentText()), "fgh"); QCOMPARE(qPrintable(disabledComboBox->currentText()), "fgh");
} }
static const char *iconInsideResource(const QString &relativePathToIcon)
{
const QDir resourcePath(Core::ICore::resourcePath());
return resourcePath.filePath(relativePathToIcon).toLocal8Bit().data();
}
void ProjectExplorer::ProjectExplorerPlugin::testJsonWizardsIconList() void ProjectExplorer::ProjectExplorerPlugin::testJsonWizardsIconList()
{ {
QString errorMessage; QString errorMessage;
@@ -255,8 +263,7 @@ void ProjectExplorer::ProjectExplorerPlugin::testJsonWizardsIconList()
QJsonObject{ QJsonObject{
{"trKey", "item no1"}, {"trKey", "item no1"},
{"condition", true}, {"condition", true},
{"icon", "../share/qtcreator/templates/wizards/qtquickstyleicons/default.png"} {"icon", iconInsideResource("templates/wizards/qtquickstyleicons/default.png")}
}, },
QJsonObject{ QJsonObject{
{"trKey", "item no2"}, {"trKey", "item no2"},
@@ -268,7 +275,7 @@ void ProjectExplorer::ProjectExplorerPlugin::testJsonWizardsIconList()
{"trKey", "item no3"}, {"trKey", "item no3"},
{"condition", true}, {"condition", true},
{"trToolTip", "MyToolTip"}, {"trToolTip", "MyToolTip"},
{"icon", "../share/qtcreator/templates/wizards/qtquickstyleicons/default.png"} {"icon", iconInsideResource("templates/wizards/qtquickstyleicons/default.png")}
} }
}); });

View File

@@ -52,7 +52,7 @@ void OsParser::stdOutput(const QString &line)
if (Utils::HostOsInfo::isWindowsHost()) { if (Utils::HostOsInfo::isWindowsHost()) {
const QString trimmed = line.trimmed(); const QString trimmed = line.trimmed();
if (trimmed == QLatin1String("The process cannot access the file because it is being used by another process.")) { if (trimmed == QLatin1String("The process cannot access the file because it is being used by another process.")) {
addTask(Task(Task::Error, tr("The process can not access the file because it is being used by another process.\n" addTask(Task(Task::Error, tr("The process cannot access the file because it is being used by another process.\n"
"Please close all running instances of your application before starting a build."), "Please close all running instances of your application before starting a build."),
Utils::FileName(), -1, Constants::TASK_CATEGORY_COMPILE)); Utils::FileName(), -1, Constants::TASK_CATEGORY_COMPILE));
m_hasFatalError = true; m_hasFatalError = true;

View File

@@ -398,7 +398,7 @@ QVariantMap UserFileAccessor::preprocessReadSettings(const QVariantMap &data) co
QVariantMap tmp = MergingSettingsAccessor::preprocessReadSettings(data); QVariantMap tmp = MergingSettingsAccessor::preprocessReadSettings(data);
// Move from old Version field to new one: // Move from old Version field to new one:
// This can not be done in a normal upgrader since the version information is needed // This cannot be done in a normal upgrader since the version information is needed
// to decide which upgraders to run // to decide which upgraders to run
const QString obsoleteKey = OBSOLETE_VERSION_KEY; const QString obsoleteKey = OBSOLETE_VERSION_KEY;
const int obsoleteVersion = tmp.value(obsoleteKey, -1).toInt(); const int obsoleteVersion = tmp.value(obsoleteKey, -1).toInt();

View File

@@ -129,7 +129,7 @@ bool QmakeMakeStep::init(QList<const BuildStep *> &earlierSteps)
} }
} }
Utils::QtcProcess::addArgs(&args, userArguments()); Utils::QtcProcess::addArgs(&args, allArguments());
if (bc->fileNodeBuild() && subProFile) { if (bc->fileNodeBuild() && subProFile) {
QString objectsDir = subProFile->objectsDirectory(); QString objectsDir = subProFile->objectsDirectory();
if (objectsDir.isEmpty()) { if (objectsDir.isEmpty()) {

View File

@@ -58,7 +58,7 @@ AbstractProperty::AbstractProperty(const PropertyName &propertyName, const Inter
m_view(view) m_view(view)
{ {
Q_ASSERT(!m_model || m_view); Q_ASSERT(!m_model || m_view);
Q_ASSERT_X(!m_propertyName.contains(' '), Q_FUNC_INFO, "a property name can not contain a space"); Q_ASSERT_X(!m_propertyName.contains(' '), Q_FUNC_INFO, "a property name cannot contain a space");
} }
AbstractProperty::AbstractProperty(const Internal::InternalPropertyPointer &property, Model* model, AbstractView *view) AbstractProperty::AbstractProperty(const Internal::InternalPropertyPointer &property, Model* model, AbstractView *view)

View File

@@ -122,7 +122,7 @@ QWidget *SwitchSplitTabWidget::currentWidget() const
void SwitchSplitTabWidget::updateSplitterSizes(int index) void SwitchSplitTabWidget::updateSplitterSizes(int index)
{ {
if (isHidden()) { if (isHidden()) {
// we can not get the sizes if the splitter is hidden // we cannot get the sizes if the splitter is hidden
m_splittSizesAreDirty = true; m_splittSizesAreDirty = true;
return; return;
} }

View File

@@ -278,7 +278,7 @@ QmlProjectRunConfiguration::QmlProjectRunConfiguration(Target *target, Id id)
{ {
addAspect<QmlProjectEnvironmentAspect>(target); addAspect<QmlProjectEnvironmentAspect>(target);
m_qmlViewerAspect = addAspect<BaseStringAspect>(); m_qmlViewerAspect = addAspect<BaseStringAspect>();
m_qmlViewerAspect->setLabelText(tr("QML viewer:")); m_qmlViewerAspect->setLabelText(tr("QML Viewer:"));
m_qmlViewerAspect->setPlaceHolderText(executable()); m_qmlViewerAspect->setPlaceHolderText(executable());
m_qmlViewerAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay); m_qmlViewerAspect->setDisplayStyle(BaseStringAspect::LineEditDisplay);

View File

@@ -1807,7 +1807,7 @@ FileNameList BaseQtVersion::qtCorePaths() const
} }
} }
} }
// Only handle static libs if we can not find dynamic ones: // Only handle static libs if we cannot find dynamic ones:
if (dynamicLibs.isEmpty()) if (dynamicLibs.isEmpty())
return staticLibs; return staticLibs;
return dynamicLibs; return dynamicLibs;

View File

@@ -198,7 +198,7 @@ SubversionDiffEditorController::SubversionDiffEditorController(
: VcsBaseDiffEditorController(document, SubversionPlugin::instance()->client(), workingDirectory) : VcsBaseDiffEditorController(document, SubversionPlugin::instance()->client(), workingDirectory)
, m_state(Idle) , m_state(Idle)
{ {
forceContextLineCount(3); // SVN can not change that when using internal diff forceContextLineCount(3); // SVN cannot change that when using internal diff
} }
void SubversionDiffEditorController::setFilesList(const QStringList &filesList) void SubversionDiffEditorController::setFilesList(const QStringList &filesList)

View File

@@ -440,7 +440,7 @@ void CodeAssistantPrivate::notifyChange()
QTC_ASSERT(m_proposal, return); QTC_ASSERT(m_proposal, return);
if (m_editorWidget->position() < m_proposal->basePosition()) { if (m_editorWidget->position() < m_proposal->basePosition()) {
destroyContext(); destroyContext();
} else if (!m_proposal->isFragile()) { } else if (m_proposal->supportsPrefix()) {
m_proposalWidget->updateProposal( m_proposalWidget->updateProposal(
m_editorWidget->textAt(m_proposal->basePosition(), m_editorWidget->textAt(m_proposal->basePosition(),
m_editorWidget->position() - m_proposal->basePosition())); m_editorWidget->position() - m_proposal->basePosition()));

View File

@@ -90,6 +90,11 @@ bool IAssistProposal::isFragile() const
return m_isFragile; return m_isFragile;
} }
bool IAssistProposal::supportsPrefix() const
{
return m_supportsPrefix;
}
/*! /*!
\fn bool TextEditor::IAssistProposal::isCorrective() const \fn bool TextEditor::IAssistProposal::isCorrective() const
@@ -120,6 +125,11 @@ void IAssistProposal::setFragile(bool fragile)
m_isFragile = fragile; m_isFragile = fragile;
} }
void IAssistProposal::setSupportsPrefix(bool supportsPrefix)
{
m_supportsPrefix = supportsPrefix;
}
/*! /*!
\fn IAssistModel *TextEditor::IAssistProposal::model() const \fn IAssistModel *TextEditor::IAssistProposal::model() const

View File

@@ -43,6 +43,7 @@ public:
int basePosition() const; int basePosition() const;
bool isFragile() const; bool isFragile() const;
bool supportsPrefix() const;
virtual bool hasItemsToPropose(const QString &, AssistReason) const { return true; } virtual bool hasItemsToPropose(const QString &, AssistReason) const { return true; }
virtual bool isCorrective(TextEditorWidget *editorWidget) const; virtual bool isCorrective(TextEditorWidget *editorWidget) const;
virtual void makeCorrection(TextEditorWidget *editorWidget); virtual void makeCorrection(TextEditorWidget *editorWidget);
@@ -50,9 +51,11 @@ public:
virtual IAssistProposalWidget *createWidget() const = 0; virtual IAssistProposalWidget *createWidget() const = 0;
void setFragile(bool fragile); void setFragile(bool fragile);
void setSupportsPrefix(bool supportsPrefix);
protected: protected:
int m_basePosition; int m_basePosition;
bool m_isFragile = false; bool m_isFragile = false;
bool m_supportsPrefix = true;
}; };
} // TextEditor } // TextEditor

View File

@@ -388,8 +388,7 @@ void Visualization::populateScene()
ratioPercentString.append(QLocale::system().percent()); ratioPercentString.append(QLocale::system().percent());
const int hiddenFunctions = d->m_model->sourceModel()->rowCount() - d->m_model->rowCount(); const int hiddenFunctions = d->m_model->sourceModel()->rowCount() - d->m_model->rowCount();
text = tr("All functions with an inclusive cost ratio higher than %1 (%2 are hidden)") text = tr("All functions with an inclusive cost ratio higher than %1 (%2 are hidden)")
.arg(ratioPercentString) .arg(ratioPercentString, hiddenFunctions);
.arg(hiddenFunctions);
} }
const qreal height = sceneHeight * (costs.isEmpty() ? 1.0 : 0.1); const qreal height = sceneHeight * (costs.isEmpty() ? 1.0 : 0.1);

View File

@@ -423,6 +423,7 @@ public:
void requestDeviceInfo(const QString &deviceId, int timeout); void requestDeviceInfo(const QString &deviceId, int timeout);
QStringList errors(); QStringList errors();
void addError(QString errorMsg); void addError(QString errorMsg);
QString deviceId(AMDeviceRef device);
void addDevice(AMDeviceRef device); void addDevice(AMDeviceRef device);
void removeDevice(AMDeviceRef device); void removeDevice(AMDeviceRef device);
void checkPendingLookups(); void checkPendingLookups();
@@ -654,11 +655,18 @@ void IosDeviceManagerPrivate::addError(QString errorMsg)
emit q->errorMsg(errorMsg); emit q->errorMsg(errorMsg);
} }
void IosDeviceManagerPrivate::addDevice(AMDeviceRef device) QString IosDeviceManagerPrivate::deviceId(AMDeviceRef device)
{ {
CFStringRef s = m_lib.deviceCopyDeviceIdentifier(device); CFStringRef s = m_lib.deviceCopyDeviceIdentifier(device);
QString devId = QString::fromCFString(s); // remove dashes as a hotfix for QTCREATORBUG-21291
const auto id = QString::fromCFString(s).remove('-');
if (s) CFRelease(s); if (s) CFRelease(s);
return id;
}
void IosDeviceManagerPrivate::addDevice(AMDeviceRef device)
{
const QString devId = deviceId(device);
CFRetain(device); CFRetain(device);
DeviceInterfaceType interfaceType = static_cast<DeviceInterfaceType>(lib()->deviceGetInterfaceType(device)); DeviceInterfaceType interfaceType = static_cast<DeviceInterfaceType>(lib()->deviceGetInterfaceType(device));
@@ -703,10 +711,7 @@ void IosDeviceManagerPrivate::addDevice(AMDeviceRef device)
void IosDeviceManagerPrivate::removeDevice(AMDeviceRef device) void IosDeviceManagerPrivate::removeDevice(AMDeviceRef device)
{ {
CFStringRef s = m_lib.deviceCopyDeviceIdentifier(device); const QString devId = deviceId(device);
QString devId = QString::fromCFString(s);
if (s)
CFRelease(s);
if (debugAll) if (debugAll)
qDebug() << "removeDevice " << devId; qDebug() << "removeDevice " << devId;
if (m_devices.contains(devId)) { if (m_devices.contains(devId)) {

View File

@@ -280,7 +280,7 @@ bool AddKitOperation::setArguments(const QStringList &args)
if (m_deviceType.isEmpty()) if (m_deviceType.isEmpty())
std::cerr << "No devicetype given for kit." << std::endl << std::endl; std::cerr << "No devicetype given for kit." << std::endl << std::endl;
if (!m_debuggerId.isEmpty() && (!m_debugger.isEmpty() || m_debuggerEngine != 0)) { if (!m_debuggerId.isEmpty() && (!m_debugger.isEmpty() || m_debuggerEngine != 0)) {
std::cerr << "Can not set both debugger id and debugger/debuggerengine." << std::endl << std::endl; std::cerr << "Cannot set both debugger id and debugger/debuggerengine." << std::endl << std::endl;
return false; return false;
} }

View File

@@ -192,7 +192,7 @@ void tst_TestCore::initTestCase()
// Load plugins // Load plugins
#ifdef Q_OS_MAC #ifdef Q_OS_MAC
const QString pluginPath = QTCREATORDIR "/bin/Qt Creator.app/Contents/PlugIns/QtCreator/QmlDesigner"; const QString pluginPath = QTCREATORDIR "/bin/Qt Creator.app/Contents/PlugIns/QmlDesigner";
#else #else
const QString pluginPath = QTCREATORDIR "/lib/qtcreator/plugins/qmldesigner"; const QString pluginPath = QTCREATORDIR "/lib/qtcreator/plugins/qmldesigner";
#endif #endif

View File

@@ -64,9 +64,9 @@ void tst_fileutils::parentDir_data()
QTest::newRow("C:/data") << "C:/data" << "C:/" << ""; QTest::newRow("C:/data") << "C:/data" << "C:/" << "";
QTest::newRow("C:/") << "C:/" << "" << ""; QTest::newRow("C:/") << "C:/" << "" << "";
QTest::newRow("//./com1") << "//./com1" << "/" << ""; QTest::newRow("//./com1") << "//./com1" << "/" << "";
QTest::newRow("//?/path") << "//?/path" << "/" << "Qt 4 can not handle this path."; QTest::newRow("//?/path") << "//?/path" << "/" << "Qt 4 cannot handle this path.";
QTest::newRow("/Global?\?/UNC/host") << "/Global?\?/UNC/host" << "/Global?\?/UNC/host" QTest::newRow("/Global?\?/UNC/host") << "/Global?\?/UNC/host" << "/Global?\?/UNC/host"
<< "Qt 4 can not handle this path."; << "Qt 4 cannot handle this path.";
QTest::newRow("//server/directory/file") QTest::newRow("//server/directory/file")
<< "//server/directory/file" << "//server/directory" << ""; << "//server/directory/file" << "//server/directory" << "";
QTest::newRow("//server/directory") << "//server/directory" << "//server" << ""; QTest::newRow("//server/directory") << "//server/directory" << "//server" << "";