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

Merge branch '5.5'

parents 9331c48d f0406e69
......@@ -25,10 +25,15 @@
#include <QMimeType>
#include <QMimeDatabase>
#include <QSignalSpy>
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
#include <QAbstractItemModelTester>
#endif
#include <projectmodel.h>
#include <projectproxymodel.h>
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
#include <tests/modeltest.h>
#endif
#include <tests/testproject.h>
#include <tests/kdevsignalspy.h>
#include <tests/autotestshell.h>
......@@ -53,9 +58,17 @@ void TestProjectModel::initTestCase()
qRegisterMetaType<QModelIndex>("QModelIndex");
model = ICore::self()->projectController()->projectModel();
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
new QAbstractItemModelTester( model, this );
#else
new ModelTest( model, this );
#endif
proxy = new ProjectProxyModel( model );
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
new QAbstractItemModelTester(proxy, proxy);
#else
new ModelTest(proxy, proxy);
#endif
proxy->setSourceModel(model);
}
......
......@@ -29,8 +29,6 @@ namespace KDevelop
class ProjectModel;
}
class ModelTest;
class TestProjectModel : public QObject
{
Q_OBJECT
......
......@@ -27,8 +27,11 @@ ecm_add_test(test_controller.cpp
ecm_add_test(test_viewactivation.cpp
LINK_LIBRARIES Qt5::Test KF5::Parts KDev::Sublime)
if(Qt5_VERSION VERSION_LESS "5.11.0")
set(test_aggregatemodel_extra_link_libs KDev::Tests)
endif()
ecm_add_test(test_aggregatemodel.cpp
LINK_LIBRARIES Qt5::Test KF5::Parts KDev::Sublime KDev::Tests)
LINK_LIBRARIES Qt5::Test KF5::Parts KDev::Sublime ${test_aggregatemodel_extra_link_libs})
ecm_add_test(test_toolviewtoolbar.cpp
LINK_LIBRARIES Qt5::Test KF5::Parts KDev::Sublime)
......@@ -18,13 +18,19 @@
***************************************************************************/
#include "test_aggregatemodel.h"
// KDevPlatform
#include <sublime/aggregatemodel.h>
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
#include <tests/modeltest.h>
#endif
// Qt
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
#include <QAbstractItemModelTester>
#endif
#include <QTest>
#include <QStandardItem>
#include <QStandardItemModel>
#include <sublime/aggregatemodel.h>
#include <tests/modeltest.h>
using namespace Sublime;
void TestAggregateModel::modelAggregationInASingleView()
......@@ -33,9 +39,11 @@ void TestAggregateModel::modelAggregationInASingleView()
model->addModel(QStringLiteral("First Model"), newModel());
model->addModel(QStringLiteral("Second Model"), newModel());
//this will assert in case of model problems and the test will fail
//for detailed explanation why the test failed refer to test/modeltest.cpp
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
new QAbstractItemModelTester(model, this);
#else
new ModelTest(model, this);
#endif
}
QStandardItemModel * TestAggregateModel::newModel()
......
......@@ -11,12 +11,16 @@ set(kdevtests_LIB_SRCS
testvariablecontroller.cpp
testbreakpointcontroller.cpp
testframestackmodel.cpp
modeltest.cpp
json/delayedoutput.cpp
json/declarationvalidator.cpp
json/testsuite.cpp
)
if(Qt5_VERSION VERSION_LESS "5.11.0")
list(APPEND kdevtests_LIB_SRCS
modeltest.cpp
)
endif()
kdevplatform_add_library(KDevPlatformTests SOURCES ${kdevtests_LIB_SRCS})
target_link_libraries(KDevPlatformTests
......@@ -32,7 +36,6 @@ PRIVATE
install(FILES
autotestshell.h
kdevsignalspy.h
modeltest.h
testcore.h
testproject.h
testfile.h
......
......@@ -197,6 +197,7 @@ void ProjectSelectionPage::validateData()
if( validator.validate(projectName, pos) == QValidator::Invalid )
{
ui->locationValidWidget->setText( i18n("Invalid project name") );
ui->locationValidWidget->animatedShow();
emit invalid();
return;
}
......
......@@ -12,6 +12,15 @@ set(test_manpagemodel_SRCS
../manpageplugin.cpp
)
if(Qt5_VERSION VERSION_LESS "5.11.0")
set(test_manpagemodel_extra_link_libs KDev::Tests)
endif()
ecm_add_test(${test_manpagemodel_SRCS}
TEST_NAME test_manpagemodel
LINK_LIBRARIES Qt5::Test KDev::Documentation KDev::Interfaces KDev::Tests)
LINK_LIBRARIES
Qt5::Test
KDev::Documentation
KDev::Interfaces
KDev::Language
${test_manpagemodel_extra_link_libs}
)
......@@ -19,9 +19,14 @@
#include "../manpagedocumentation.h"
#include "../manpagemodel.h"
// KDevPlatform
#if QT_VERSION < QT_VERSION_CHECK(5, 11, 0)
#include <tests/modeltest.h>
#endif
// Qt
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
#include <QAbstractItemModelTester>
#endif
#include <QDebug>
#include <QSignalSpy>
#include <QTest>
......@@ -43,7 +48,11 @@ void TestManPageModel::testModel()
if (model.isLoaded()) {
QVERIFY(model.rowCount() > 0);
#if QT_VERSION >= QT_VERSION_CHECK(5, 11, 0)
new QAbstractItemModelTester(&model, this);
#else
new ModelTest(&model);
#endif
} else {
QCOMPARE(model.rowCount(), 0);
}
......
......@@ -270,7 +270,7 @@ void PatchReviewPlugin::updateKompareModel() {
try {
m_modelList->openDirAndDiff();
} catch ( const QString & str ) {
} catch ( const QString & /*str*/ ) {
throw;
} catch ( ... ) {
throw QStringLiteral( "lib/libdiff2 crashed, memory may be corrupted. Please restart kdevelop." );
......
......@@ -46,8 +46,6 @@
#include <shell/problem.h>
#include <shell/problemconstants.h>
//#include "modeltest.h"
using namespace KDevelop;
namespace {
......
......@@ -76,6 +76,9 @@ if (CMAKE_CXX_COMPILER_ID STREQUAL "GNU")
add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-class-memaccess")
add_target_compile_flag_if_supported(kdevqtc-qmlsupport PRIVATE "-Wno-deprecated-copy")
endif()
if (MSVC)
target_compile_options(kdevqtc-qmlsupport PRIVATE "/wd4996") # C4996: warns about deprecated declarations
endif()
target_compile_definitions(kdevqtc-qmlsupport PUBLIC -DLANGUAGEUTILS_LIBRARY -DUTILS_LIBRARY -DQT_CREATOR -DQML_BUILD_STATIC_LIB)
# add as SYSTEM include dir so compiler does not emit warnings for the lib headers
......
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