Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit bb2d6105 authored by Friedrich W. H. Kossebau's avatar Friedrich W. H. Kossebau

Merge branch '5.5'

parents dd71cc60 1cfcd90d
......@@ -66,7 +66,6 @@ Boston, MA 02110-1301, USA.
#include <projectconfigpage.h>
#include <language/backgroundparser/parseprojectjob.h>
#include <interfaces/iruncontroller.h>
#include <sublime/message.h>
#include <util/scopeddialog.h>
#include <vcs/widgets/vcsdiffpatchsources.h>
#include <vcs/widgets/vcscommitdialog.h>
......
......@@ -284,8 +284,8 @@ void MainWindowPrivate::showRightDock(bool b)
void MainWindowPrivate::setBackgroundCentralWidget(QWidget* w)
{
delete bgCentralWidget;
QLayout* l=m_mainWindow->centralWidget()->layout();
l->addWidget(w);
auto* l = static_cast<QVBoxLayout*>(centralWidget->layout());
l->addWidget(w, 2);
bgCentralWidget=w;
setBackgroundVisible(area->views().isEmpty());
}
......
......@@ -68,6 +68,8 @@ MessageWidget::MessageWidget(QWidget* parent)
// setup autoHide timer details
m_autoHideTimer->setSingleShot(true);
connect(m_messageWidget, &KMessageWidget::hideAnimationFinished,
this, &MessageWidget::showNextMessage);
connect(m_messageWidget, &KMessageWidget::linkHovered,
this, &MessageWidget::linkHovered);
}
......
......@@ -18,8 +18,8 @@
* 02110-1301, USA.
*/
#ifndef KDEVPLATFORM_VCSANNITATIONITEMDELEGATE_H
#define KDEVPLATFORM_VCSANNITATIONITEMDELEGATE_H
#ifndef KDEVPLATFORM_VCSANNOTATIONITEMDELEGATE_H
#define KDEVPLATFORM_VCSANNOTATIONITEMDELEGATE_H
// KDev
#include <vcsrevision.h>
......
......@@ -21,8 +21,8 @@
*
*/
#ifndef SIMPLEREFACTORING_H
#define SIMPLEREFACTORING_H
#ifndef CLANGREFACTORING_H
#define CLANGREFACTORING_H
#include "clangprivateexport.h"
......
......@@ -559,8 +559,11 @@ QList<ProblemPointer> ParseSession::problemsForFile(CXFile file) const
// see also TestDUChain::testReparseIncludeGuard
const QString path = QDir(ClangString(clang_getFileName(file)).toString()).canonicalPath();
const IndexedString indexedPath(path);
const auto location = clang_getLocationForOffset(d->m_unit, file, 0);
if (ClangHelpers::isHeader(path) && !clang_isFileMultipleIncludeGuarded(unit(), file)
&& !clang_Location_isInSystemHeader(clang_getLocationForOffset(d->m_unit, file, 0)))
&& !clang_Location_isInSystemHeader(location)
// clang_isFileMultipleIncludeGuarded always returns 0 in case our only file is the header
&& !clang_Location_isFromMainFile(location))
{
QExplicitlySharedDataPointer<StaticAssistantProblem> problem(new StaticAssistantProblem);
problem->setSeverity(IProblem::Warning);
......
......@@ -819,18 +819,19 @@ void TestAssistants::testHeaderGuardAssistant()
QFETCH(QString, pragmaExpected);
QFETCH(QString, macroExpected);
TestFile pragmaFile (code, QStringLiteral("h"));
TestFile macroFile (code, QStringLiteral("h"), filename);
TestFile pragmaFile(code, QStringLiteral("h"));
TestFile macroFile(code, QStringLiteral("h"), filename);
TestFile impl("#include \"" + pragmaFile.url().str() + "\"\n"
"#include \"" + macroFile.url().str() + "\"\n", QStringLiteral("cpp"));
QExplicitlySharedDataPointer<IAssistant> pragmaAssistant;
QExplicitlySharedDataPointer<IAssistant> macroAssistant;
pragmaFile.parse(TopDUContext::Empty);
macroFile.parse(TopDUContext::Empty);
QVERIFY(pragmaFile.waitForParsed());
QVERIFY(macroFile.waitForParsed());
QVERIFY(impl.parseAndWait(TopDUContext::Empty));
DUChainReadLocker lock;
QVERIFY(impl.topContext());
const auto pragmaTopContext = DUChain::self()->chainForDocument(pragmaFile.url());
const auto macroTopContext = DUChain::self()->chainForDocument(macroFile.url());
QVERIFY(pragmaTopContext);
......
......@@ -1616,6 +1616,58 @@ void TestDUChain::testReparseIncludeGuard()
}
}
void TestDUChain::testIncludeGuardHeaderHeaderOnly()
{
QFETCH(QString, code);
// test that we do NOT get a warning for single standalone header file with include guards
TestFile header(code, QStringLiteral("h"));
QVERIFY(header.parseAndWait(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses | TopDUContext::AST)));
{
DUChainReadLocker lock;
QCOMPARE(header.topContext()->problems().size(), 0);
}
}
void TestDUChain::testIncludeGuardHeaderHeaderOnly_data()
{
QTest::addColumn<QString>("code");
QTest::newRow("guard-ifdef") << QStringLiteral(
"#ifndef GUARD\n"
"#define GUARD\n"
"int something;\n"
"#endif\n"
);
QTest::newRow("guard-pragma") << QStringLiteral(
"#pragma once\n"
"int something;\n"
);
}
void TestDUChain::testIncludeGuardHeaderWarning()
{
// test that we do get a warning for a header file without include guards
TestFile header(QStringLiteral("int something;\n"), QStringLiteral("h"));
TestFile impl("#include \"" + header.url().str() + "\"\n", QStringLiteral("cpp"));
QVERIFY(impl.parseAndWait(TopDUContext::Features(TopDUContext::AllDeclarationsContextsAndUses | TopDUContext::AST | TopDUContext::ForceUpdate)));
{
DUChainReadLocker lock;
QVERIFY(impl.topContext());
auto context = DUChain::self()->chainForDocument(impl.url());
QVERIFY(context);
QCOMPARE(context->problems().size(), 0);
context = DUChain::self()->chainForDocument(header.url());
QVERIFY(context);
QCOMPARE(context->problems().size(), 1);
}
}
void TestDUChain::testExternC()
{
auto code = R"(extern "C" { void foo(); })";
......
......@@ -87,6 +87,9 @@ private Q_SLOTS:
void testActiveDocumentsGetBestPriority();
void testUsesCreatedForDeclarations();
void testReparseIncludeGuard();
void testIncludeGuardHeaderHeaderOnly();
void testIncludeGuardHeaderHeaderOnly_data();
void testIncludeGuardHeaderWarning();
void testExternC();
void testLambda();
void testReparseUnchanged_data();
......
......@@ -19,8 +19,8 @@
* 02110-1301, USA.
*/
#ifndef CLANGTIDY_REPLACEMENT_H
#define CLANGTIDY_REPLACEMENT_H
#ifndef CLANGTIDY_REPLACEMENTPARSER_H
#define CLANGTIDY_REPLACEMENTPARSER_H
// KDevPlatform
#include <language/editor/documentrange.h>
......
......@@ -118,4 +118,4 @@ KDevelop::CompileAnalyzeJob * Analyzer::createJob(KDevelop::IProject* project,
return new Job(params, db);
}
}
\ No newline at end of file
}
......@@ -18,8 +18,8 @@
* 02110-1301, USA.
*/
#ifndef CMAKEHELPDOC_H
#define CMAKEHELPDOC_H
#ifndef CMAKEDOC_H
#define CMAKEDOC_H
#include <interfaces/idocumentation.h>
class CMakeDocumentation;
......
......@@ -19,8 +19,8 @@
* 02110-1301, USA.
*/
#ifndef COMPILEANALYZER_PROBLEMMODEL_H
#define COMPILEANALYZER_PROBLEMMODEL_H
#ifndef COMPILEANALYZER_COMPILEANALYZEPROBLEMMODEL_H
#define COMPILEANALYZER_COMPILEANALYZEPROBLEMMODEL_H
// KDevPlatfrom
#include <shell/problemmodel.h>
......
......@@ -21,8 +21,8 @@
*
*/
#ifndef COMPILERSPROVIDER_H
#define COMPILERSPROVIDER_H
#ifndef COMPILERPROVIDER_H
#define COMPILERPROVIDER_H
#include "icompilerfactory.h"
......
......@@ -21,8 +21,8 @@
*
*/
#ifndef COMPILERMODEL_H
#define COMPILERMODEL_H
#ifndef COMPILERSMODEL_H
#define COMPILERSMODEL_H
#include <QAbstractItemModel>
#include <QItemSelection>
......
......@@ -21,8 +21,8 @@
*
*/
#ifndef COMPILERWIDGET_H
#define COMPILERWIDGET_H
#ifndef COMPILERSWIDGET_H
#define COMPILERSWIDGET_H
#include <QVector>
#include <QWidget>
......
......@@ -16,8 +16,8 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>. *
************************************************************************/
#ifndef KCM_CUSTOMBUILDSYSTEM_H
#define KCM_CUSTOMBUILDSYSTEM_H
#ifndef KCM_DEFINESANDINCLUDESCONFIGPAGE_H
#define KCM_DEFINESANDINCLUDESCONFIGPAGE_H
#include <project/projectconfigpage.h>
......
......@@ -20,8 +20,8 @@
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef INCLUDEPATHRESOLVER_H
#define INCLUDEPATHRESOLVER_H
#ifndef MAKEFILERESOLVER_H
#define MAKEFILERESOLVER_H
#include <QString>
......
......@@ -18,8 +18,8 @@
Boston, MA 02110-1301, USA.
*/
#ifndef SCRIPTAPPCONFIGTYPE_H
#define SCRIPTAPPCONFIGTYPE_H
#ifndef PLASMOIDEXECUTIONCONFIG_H
#define PLASMOIDEXECUTIONCONFIG_H
#include <interfaces/launchconfigurationtype.h>
#include <interfaces/launchconfigurationpage.h>
......
......@@ -20,8 +20,8 @@
*
*/
#ifndef _DEBUGGERPART_H_
#define _DEBUGGERPART_H_
#ifndef GDBDEBUGGERPLUGIN_H
#define GDBDEBUGGERPLUGIN_H
#include <config-kdevelop.h>
......
......@@ -20,8 +20,9 @@
* Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef GDBLAUNCHCONFIG
#define GDBLAUNCHCONFIG
#ifndef GDBCONFIGPAGE_H
#define GDBCONFIGPAGE_H
#include <interfaces/ilauncher.h>
#include <interfaces/launchconfigurationpage.h>
......
......@@ -17,8 +17,8 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA *
*************************************************************************************/
#ifndef PARSEQMLJSJOB_H
#define PARSEQMLJSJOB_H
#ifndef QMLJSPARSEJOB_H
#define QMLJSPARSEJOB_H
#include <language/backgroundparser/parsejob.h>
......
......@@ -17,8 +17,8 @@
Boston, MA 02110-1301, USA.
*/
#ifndef KDEVPLATFORM_PLUGIN_VCSPROJECTINTEGRATIONPLUGIN_H
#define KDEVPLATFORM_PLUGIN_VCSPROJECTINTEGRATIONPLUGIN_H
#ifndef KDEVPLATFORM_PLUGIN_VCSCHANGESVIEWPLUGIN_H
#define KDEVPLATFORM_PLUGIN_VCSCHANGESVIEWPLUGIN_H
#include <interfaces/iplugin.h>
#include <QVariant>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment