forked from qt-creator/qt-creator
Fix build of Clang code model and CppEditor with Qt 6
QStringRef gone. QSharedPointer is no longer auto-converted to bool. Small things. Task-number: QTCREATORBUG-24098 Change-Id: I3a2a55459b905118d1ca81ec015d741ab273471d Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -55,8 +55,9 @@
|
||||
#include <utils/algorithm.h>
|
||||
#include <utils/mimetypes/mimedatabase.h>
|
||||
#include <utils/optional.h>
|
||||
#include <utils/textutils.h>
|
||||
#include <utils/porting.h>
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/textutils.h>
|
||||
|
||||
#include <QDirIterator>
|
||||
#include <QTextDocument>
|
||||
@@ -450,9 +451,9 @@ bool ClangCompletionAssistProcessor::accepts() const
|
||||
&& tokens.at(1).kind() == T_IDENTIFIER) {
|
||||
const QString &line = tc.block().text();
|
||||
const Token &idToken = tokens.at(1);
|
||||
const QStringRef &identifier =
|
||||
line.midRef(idToken.bytesBegin(),
|
||||
idToken.bytesEnd() - idToken.bytesBegin());
|
||||
const QStringView &identifier = Utils::midView(line,
|
||||
idToken.utf16charsBegin(),
|
||||
idToken.utf16chars());
|
||||
if (identifier == QLatin1String("include")
|
||||
|| identifier == QLatin1String("include_next")
|
||||
|| (m_interface->objcEnabled() && identifier == QLatin1String("import"))) {
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
class QLayout;
|
||||
class QWidget;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
namespace ClangCodeModel {
|
||||
|
||||
@@ -172,7 +172,7 @@ bool ClangEditorDocumentProcessor::isParserRunning() const
|
||||
|
||||
bool ClangEditorDocumentProcessor::hasProjectPart() const
|
||||
{
|
||||
return m_projectPart;
|
||||
return !m_projectPart.isNull();
|
||||
}
|
||||
|
||||
CppTools::ProjectPart::Ptr ClangEditorDocumentProcessor::projectPart() const
|
||||
|
||||
@@ -129,7 +129,7 @@ ProjectPart::Ptr projectPartForFileBasedOnProcessor(const QString &filePath)
|
||||
bool isProjectPartLoaded(const ProjectPart::Ptr projectPart)
|
||||
{
|
||||
if (projectPart)
|
||||
return CppModelManager::instance()->projectPartForId(projectPart->id());
|
||||
return !CppModelManager::instance()->projectPartForId(projectPart->id()).isNull();
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user