diff options
Diffstat (limited to 'src/libs')
-rw-r--r-- | src/libs/clangsupport/commandlinebuilder.h | 3 | ||||
-rw-r--r-- | src/libs/clangsupport/refactoringdatabaseinitializer.h | 8 | ||||
-rw-r--r-- | src/libs/cplusplus/ExpressionUnderCursor.cpp | 2 | ||||
-rw-r--r-- | src/libs/libs.pro | 24 | ||||
-rw-r--r-- | src/libs/qmljs/qmljscheck.cpp | 4 | ||||
-rw-r--r-- | src/libs/ssh/sshremoteprocess.cpp | 2 | ||||
-rw-r--r-- | src/libs/utils/fileutils.cpp | 7 | ||||
-rw-r--r-- | src/libs/utils/jsontreeitem.cpp | 4 | ||||
-rw-r--r-- | src/libs/utils/textutils.cpp | 7 |
9 files changed, 44 insertions, 17 deletions
diff --git a/src/libs/clangsupport/commandlinebuilder.h b/src/libs/clangsupport/commandlinebuilder.h index 7367f080360..9de1da68d3c 100644 --- a/src/libs/clangsupport/commandlinebuilder.h +++ b/src/libs/clangsupport/commandlinebuilder.h @@ -51,6 +51,7 @@ public: commandLine.reserve(1024); addCompiler(projectInfo.language); + disableWarnings(); addToolChainArguments(toolChainArguments); addExtraFlags(); addLanguage(projectInfo, sourceType); @@ -74,6 +75,8 @@ public: commandLine.emplace_back("clang"); } + void disableWarnings() { commandLine.emplace_back("-w"); } + void addToolChainArguments(const Utils::SmallStringVector &toolChainArguments) { for (Utils::SmallStringView argument : toolChainArguments) diff --git a/src/libs/clangsupport/refactoringdatabaseinitializer.h b/src/libs/clangsupport/refactoringdatabaseinitializer.h index cce203f0d44..f6d64a81d31 100644 --- a/src/libs/clangsupport/refactoringdatabaseinitializer.h +++ b/src/libs/clangsupport/refactoringdatabaseinitializer.h @@ -143,6 +143,8 @@ public: const Sqlite::Column &projectPartIdColumn = table.addColumn("projectPartId", Sqlite::ColumnType::Integer); const Sqlite::Column &sourceIdColumn = table.addColumn("sourceId", Sqlite::ColumnType::Integer); table.addColumn("sourceType", Sqlite::ColumnType::Integer); + table.addColumn("pchCreationTimeStamp", Sqlite::ColumnType::Integer); + table.addColumn("hasMissingIncludes", Sqlite::ColumnType::Integer); table.addUniqueIndex({sourceIdColumn, projectPartIdColumn}); table.addIndex({projectPartIdColumn}); @@ -168,11 +170,11 @@ public: Sqlite::Table table; table.setUseIfNotExists(true); table.setName("fileStatuses"); - table.addColumn("sourceId", Sqlite::ColumnType::Integer, Sqlite::Contraint::PrimaryKey); + table.addColumn("sourceId", + Sqlite::ColumnType::Integer, + Sqlite::Contraint::PrimaryKey); table.addColumn("size", Sqlite::ColumnType::Integer); table.addColumn("lastModified", Sqlite::ColumnType::Integer); - table.addColumn("buildDependencyTimeStamp", Sqlite::ColumnType::Integer); - table.addColumn("isInPrecompiledHeader", Sqlite::ColumnType::Integer); table.initialize(database); } diff --git a/src/libs/cplusplus/ExpressionUnderCursor.cpp b/src/libs/cplusplus/ExpressionUnderCursor.cpp index e176cbde355..6df396d8cfc 100644 --- a/src/libs/cplusplus/ExpressionUnderCursor.cpp +++ b/src/libs/cplusplus/ExpressionUnderCursor.cpp @@ -264,7 +264,7 @@ int ExpressionUnderCursor::startOfFunctionCall(const QTextCursor &cursor) const break; } else if (tk.is(T_LPAREN) || tk.is(T_LBRACE)) { return scanner.startPosition() + tk.utf16charsBegin(); - } else if (tk.is(T_RPAREN)) { + } else if (tk.is(T_RPAREN) || tk.is(T_RBRACE)) { int matchingBrace = scanner.startOfMatchingBrace(index); if (matchingBrace == index) // If no matching brace found diff --git a/src/libs/libs.pro b/src/libs/libs.pro index 8bc99461a71..26495bbbf04 100644 --- a/src/libs/libs.pro +++ b/src/libs/libs.pro @@ -31,9 +31,27 @@ for(l, SUBDIRS) { } SUBDIRS += \ - utils/process_stub.pro \ - 3rdparty/syntax-highlighting \ - 3rdparty/syntax-highlighting/data + utils/process_stub.pro + +isEmpty(KSYNTAXHIGHLIGHTING_LIB_DIR): KSYNTAXHIGHLIGHTING_LIB_DIR=$$(KSYNTAXHIGHLIGHTING_LIB_DIR) +!isEmpty(KSYNTAXHIGHLIGHTING_LIB_DIR) { + # enable short information message + KSYNTAX_WARN_ON = 1 +} + +include(../shared/syntax/syntax_shared.pri) +isEmpty(KSYNTAXHIGHLIGHTING_LIB_DIR) { + SUBDIRS += \ + 3rdparty/syntax-highlighting \ + 3rdparty/syntax-highlighting/data + + equals(KSYNTAX_WARN_ON, 1) { + message("Either KSYNTAXHIGHLIGHTING_LIB_DIR does not exist or include path could not be deduced.") + unset(KSYNTAX_WARN_ON) + } +} else { + message("Using KSyntaxHighlighting provided at $${KSYNTAXHIGHLIGHTING_LIB_DIR}.") +} win32:SUBDIRS += utils/process_ctrlc_stub.pro diff --git a/src/libs/qmljs/qmljscheck.cpp b/src/libs/qmljs/qmljscheck.cpp index a38a2fa906c..ea43a4dec86 100644 --- a/src/libs/qmljs/qmljscheck.cpp +++ b/src/libs/qmljs/qmljscheck.cpp @@ -748,8 +748,8 @@ void Check::endVisit(UiObjectInitializer *) { m_propertyStack.pop(); m_typeStack.pop(); - UiObjectDefinition *objectDenition = cast<UiObjectDefinition *>(parent()); - if (objectDenition && objectDenition->qualifiedTypeNameId->name == "Component") + UiObjectDefinition *objectDefinition = cast<UiObjectDefinition *>(parent()); + if (objectDefinition && objectDefinition->qualifiedTypeNameId->name == "Component") m_idStack.pop(); UiObjectBinding *objectBinding = cast<UiObjectBinding *>(parent()); if (objectBinding && objectBinding->qualifiedTypeNameId->name == "Component") diff --git a/src/libs/ssh/sshremoteprocess.cpp b/src/libs/ssh/sshremoteprocess.cpp index 48e965d6fa8..a769484735c 100644 --- a/src/libs/ssh/sshremoteprocess.cpp +++ b/src/libs/ssh/sshremoteprocess.cpp @@ -69,7 +69,7 @@ SshRemoteProcess::SshRemoteProcess(const QByteArray &command, const QStringList connect(this, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, [this] { QString error; if (exitStatus() == QProcess::CrashExit) - error = tr("The ssh binary crashed: %1").arg(errorString()); + error = tr("The ssh process crashed: %1").arg(errorString()); else if (exitCode() == 255) error = tr("Remote process crashed."); emit done(error); diff --git a/src/libs/utils/fileutils.cpp b/src/libs/utils/fileutils.cpp index 708595aa4d8..a476cd8d892 100644 --- a/src/libs/utils/fileutils.cpp +++ b/src/libs/utils/fileutils.cpp @@ -311,9 +311,10 @@ QString FileUtils::normalizePathName(const QString &name) if (FAILED(hr)) return name; TCHAR buffer[MAX_PATH]; - if (!SHGetPathFromIDList(file, buffer)) - return name; - return QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const ushort *>(buffer))); + const bool success = SHGetPathFromIDList(file, buffer); + ILFree(file); + return success ? QDir::fromNativeSeparators(QString::fromUtf16(reinterpret_cast<const ushort *>(buffer))) + : name; #elif defined(Q_OS_OSX) return Internal::normalizePathName(name); #else // do not try to handle case-insensitive file systems on Linux diff --git a/src/libs/utils/jsontreeitem.cpp b/src/libs/utils/jsontreeitem.cpp index a70f5631ec8..16da8e803e6 100644 --- a/src/libs/utils/jsontreeitem.cpp +++ b/src/libs/utils/jsontreeitem.cpp @@ -63,9 +63,9 @@ QVariant Utils::JsonTreeItem::data(int column, int role) const if (column == 2) return typeName(m_value.type()); if (m_value.isObject()) - return QString('[' + QString::number(m_value.toObject().size()) + ' ' + tr("Items") + ']'); + return QString('[' + tr("%n Items", nullptr, m_value.toObject().size()) + ']'); if (m_value.isArray()) - return QString('[' + QString::number(m_value.toArray().size()) + ' ' + tr("Items") + ']'); + return QString('[' + tr("%n Items", nullptr, m_value.toArray().size()) + ']'); return m_value.toVariant(); } diff --git a/src/libs/utils/textutils.cpp b/src/libs/utils/textutils.cpp index 0d8009fef89..ba10ca56ae4 100644 --- a/src/libs/utils/textutils.cpp +++ b/src/libs/utils/textutils.cpp @@ -171,7 +171,8 @@ LineColumn utf16LineColumn(const QByteArray &utf8Buffer, int utf8Offset) lineColumn.line = static_cast<int>( std::count(utf8Buffer.begin(), utf8Buffer.begin() + utf8Offset, '\n')) + 1; - const int startOfLineOffset = utf8Buffer.lastIndexOf('\n', utf8Offset - 1) + 1; + const int startOfLineOffset = utf8Offset ? (utf8Buffer.lastIndexOf('\n', utf8Offset - 1) + 1) + : 0; lineColumn.column = QString::fromUtf8( utf8Buffer.mid(startOfLineOffset, utf8Offset - startOfLineOffset)) .length() @@ -181,7 +182,9 @@ LineColumn utf16LineColumn(const QByteArray &utf8Buffer, int utf8Offset) QString utf16LineTextInUtf8Buffer(const QByteArray &utf8Buffer, int currentUtf8Offset) { - const int lineStartUtf8Offset = utf8Buffer.lastIndexOf('\n', currentUtf8Offset - 1) + 1; + const int lineStartUtf8Offset = currentUtf8Offset + ? (utf8Buffer.lastIndexOf('\n', currentUtf8Offset - 1) + 1) + : 0; const int lineEndUtf8Offset = utf8Buffer.indexOf('\n', currentUtf8Offset); return QString::fromUtf8( utf8Buffer.mid(lineStartUtf8Offset, lineEndUtf8Offset - lineStartUtf8Offset)); |