diff --git a/language/backgroundparser/backgroundparser.cpp b/language/backgroundparser/backgroundparser.cpp
--- a/language/backgroundparser/backgroundparser.cpp
+++ b/language/backgroundparser/backgroundparser.cpp
@@ -57,8 +57,6 @@
namespace {
-const bool separateThreadForHighPriority = true;
-
/**
* Elides string in @p path, e.g. "VEEERY/LONG/PATH" -> ".../LONG/PATH"
* - probably much faster than QFontMetrics::elidedText()
@@ -278,8 +276,7 @@
return;
//Only create parse-jobs for up to thread-count * 2 documents, so we don't fill the memory unnecessarily
- if (m_parseJobs.count() >= m_threads+1
- || (m_parseJobs.count() >= m_threads && !separateThreadForHighPriority))
+ if (m_parseJobs.count() >= m_threads+1)
{
return;
}
diff --git a/language/codecompletion/codecompletionhelper.cpp b/language/codecompletion/codecompletionhelper.cpp
--- a/language/codecompletion/codecompletionhelper.cpp
+++ b/language/codecompletion/codecompletionhelper.cpp
@@ -49,12 +49,14 @@
if( declaration->kind() == Declaration::Instance && !declaration->isFunctionDeclaration())
haveArguments = true; //probably a constructor initializer
+ if( !view )
+ return;
+
//Need to have a paren behind
QString suffix = view->document()->text( KTextEditor::Range( pos, pos + KTextEditor::Cursor(1, 0) ) );
if( suffix.trimmed().startsWith('(') ) {
//Move the cursor behind the opening paren
- if( view )
- view->setCursorPosition( pos + KTextEditor::Cursor( 0, suffix.indexOf('(')+1 ) );
+ view->setCursorPosition( pos + KTextEditor::Cursor( 0, suffix.indexOf('(')+1 ) );
}else{
//We need to insert an opening paren
QString openingParen;
@@ -92,11 +94,10 @@
lock.unlock();
- if(view) {
- view->document()->insertText( pos, openingParen + closingParen );
- if(!jumpForbidden) {
- view->setCursorPosition( jumpPos );
- }
+
+ view->document()->insertText( pos, openingParen + closingParen );
+ if(!jumpForbidden) {
+ view->setCursorPosition( jumpPos );
}
}
diff --git a/language/duchain/declaration.cpp b/language/duchain/declaration.cpp
--- a/language/duchain/declaration.cpp
+++ b/language/duchain/declaration.cpp
@@ -445,7 +445,7 @@
}
DUCHAIN_D_DYNAMIC(Declaration);
- if( context == d->m_internalContext.context() )
+ if( !context || context == d->m_internalContext.context() )
return;
if(!m_topContext) {
@@ -462,9 +462,7 @@
if( oldInternalContext && oldInternalContext->owner() == this )
oldInternalContext->setOwner(nullptr);
-
- if( context )
- context->setOwner(this);
+ context->setOwner(this);
}
diff --git a/language/duchain/duchainutils.cpp b/language/duchain/duchainutils.cpp
--- a/language/duchain/duchainutils.cpp
+++ b/language/duchain/duchainutils.cpp
@@ -168,10 +168,6 @@
RETURN_CACHED_ICON("CVprivate_var")
else
RETURN_CACHED_ICON("CVpublic_var")
- else
- if( (p & CodeCompletionModel::Union) && (p & CodeCompletionModel::Protected) )
- RETURN_CACHED_ICON("protected_union")
-
else if( p & CodeCompletionModel::Enum )
if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("protected_enum")
@@ -201,15 +197,17 @@
RETURN_CACHED_ICON("signal")
else if( p & CodeCompletionModel::Class )
- if( (p & CodeCompletionModel::Class) && (p & CodeCompletionModel::Protected) )
+ if( p & CodeCompletionModel::Protected )
RETURN_CACHED_ICON("protected_class")
- else if( (p & CodeCompletionModel::Class) && (p & CodeCompletionModel::Private) )
+ else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_class")
else
RETURN_CACHED_ICON("code-class")
else if( p & CodeCompletionModel::Union )
- if( p & CodeCompletionModel::Private )
+ if( p & CodeCompletionModel::Protected )
+ RETURN_CACHED_ICON("protected_union")
+ else if( p & CodeCompletionModel::Private )
RETURN_CACHED_ICON("private_union")
else
RETURN_CACHED_ICON("union")
diff --git a/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp b/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
--- a/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
+++ b/language/duchain/navigation/abstractdeclarationnavigationcontext.cpp
@@ -253,10 +253,9 @@
modifyHtml() += QStringLiteral("
");
- if(!shorten)
+ if( !shorten ) {
htmlAdditionalNavigation();
- if( !shorten ) {
if(dynamic_cast(m_declaration.data()))
modifyHtml() += labelHighlight(i18n( "Def.: " ));
else
diff --git a/language/duchain/navigation/abstractincludenavigationcontext.cpp b/language/duchain/navigation/abstractincludenavigationcontext.cpp
--- a/language/duchain/navigation/abstractincludenavigationcontext.cpp
+++ b/language/duchain/navigation/abstractincludenavigationcontext.cpp
@@ -54,17 +54,15 @@
}
if(!duchain && maxDepth != 0) {
- if(maxDepth != 0) {
- foreach(TopDUContext* ctx, duchains) {
- QList children;
- foreach(const DUContext::Import &import, ctx->importedParentContexts())
- if(import.context(nullptr))
- children << import.context(nullptr)->topContext();
-
- duchain = pickContextWithData(children, maxDepth-1, type, false);
- if(duchain)
- break;
- }
+ foreach(TopDUContext* ctx, duchains) {
+ QList children;
+ foreach(const DUContext::Import &import, ctx->importedParentContexts())
+ if(import.context(nullptr))
+ children << import.context(nullptr)->topContext();
+
+ duchain = pickContextWithData(children, maxDepth-1, type, false);
+ if(duchain)
+ break;
}
}
@@ -146,7 +144,7 @@
if(childIterator != children.constEnd())
currentDeclarationLine = (*childIterator)->rangeInCurrentRevision().start().line();
- if((currentDeclarationLine <= currentContextLine || currentContextLine == -1 || childIterator == children.constEnd()) && declarationIterator != declarations.constEnd() )
+ if((currentDeclarationLine <= currentContextLine || childIterator == children.constEnd()) && declarationIterator != declarations.constEnd() )
{
IdentifierPair id = qMakePair(static_cast((*declarationIterator)->kind()),
(*declarationIterator)->qualifiedIdentifier().index());
diff --git a/plugins/contextbrowser/contextbrowserview.cpp b/plugins/contextbrowser/contextbrowserview.cpp
--- a/plugins/contextbrowser/contextbrowserview.cpp
+++ b/plugins/contextbrowser/contextbrowserview.cpp
@@ -191,11 +191,9 @@
TopDUContext* top = m_lastUsedTopContext.data();
if(top && m_navigationWidgetDeclaration.isValid() && m_navigationWidgetDeclaration.getDeclaration(top)) {
- if(top) {
- //Update the navigation-widget
- Declaration* decl = m_navigationWidgetDeclaration.getDeclaration(top);
- setDeclaration(decl, top, true);
- }
+ //Update the navigation-widget
+ Declaration* decl = m_navigationWidgetDeclaration.getDeclaration(top);
+ setDeclaration(decl, top, true);
}
QWidget::showEvent(event);
}
diff --git a/plugins/externalscript/externalscriptjob.cpp b/plugins/externalscript/externalscriptjob.cpp
--- a/plugins/externalscript/externalscriptjob.cpp
+++ b/plugins/externalscript/externalscriptjob.cpp
@@ -151,7 +151,7 @@
}
}
} else {
- if ( m_url.isLocalFile() && workingDir.isEmpty() ) {
+ if ( m_url.isLocalFile() && workingDir.isEmpty() && view->document()) {
///TODO: make configurable, use fallback to project dir
workingDir = view->document()->url().adjusted(QUrl::RemoveFilename).toLocalFile();
}
diff --git a/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp b/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp
--- a/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp
+++ b/plugins/quickopen/expandingtree/expandingwidgetmodel.cpp
@@ -344,14 +344,14 @@
}
}
- //Eventually partially expand the row
- if( !expanded && firstColumn(treeView()->currentIndex()) == idx && (isPartiallyExpanded(idx) == ExpandingWidgetModel::ExpansionType::NotExpanded) )
- rowSelected(idx); //Partially expand the row.
+ if(treeView()) {
+ //Eventually partially expand the row
+ if( !expanded && firstColumn(treeView()->currentIndex()) == idx && (isPartiallyExpanded(idx) == ExpandingWidgetModel::ExpansionType::NotExpanded) )
+ rowSelected(idx); //Partially expand the row.
- emit dataChanged(idx, idx);
-
- if(treeView())
treeView()->scrollTo(idx);
+ }
+ emit dataChanged(idx, idx);
}
}
diff --git a/util/dbus_socket_transformer/main.cpp b/util/dbus_socket_transformer/main.cpp
--- a/util/dbus_socket_transformer/main.cpp
+++ b/util/dbus_socket_transformer/main.cpp
@@ -261,9 +261,6 @@
if(path.find(",guid=") != std::string::npos)
path = path.substr(0, path.find(",guid="));
- // Mark it as an abstract unix domain socket
- path = path;
-
serverfd = socket(AF_INET, SOCK_STREAM, 0);
if (serverfd < 0)