forked from qt-creator/qt-creator
Cpp{Editor,Tools}: Remove some Qt4-only code
Change-Id: I94ca7b239e974b6b400933466ee2ef5ae4def336 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -53,13 +53,6 @@
|
|||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
#define MSKIP_SINGLE(x) QSKIP(x)
|
|
||||||
#else
|
|
||||||
#include <QtTest/qtestkeyboard.h>
|
|
||||||
#define MSKIP_SINGLE(x) QSKIP(x, SkipSingle)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
Tests for executing "test actions" for
|
Tests for executing "test actions" for
|
||||||
(1) each file of each loaded project (file actions) or
|
(1) each file of each loaded project (file actions) or
|
||||||
@@ -154,7 +147,7 @@ TestActionsTestCase::TestActionsTestCase(const Actions &tokenActions, const Acti
|
|||||||
const QList<ProjectInfo> projectInfos
|
const QList<ProjectInfo> projectInfos
|
||||||
= m_modelManager->projectInfos();
|
= m_modelManager->projectInfos();
|
||||||
if (projectInfos.isEmpty())
|
if (projectInfos.isEmpty())
|
||||||
MSKIP_SINGLE("No project(s) loaded. Test operates only on loaded projects.");
|
QSKIP("No project(s) loaded. Test operates only on loaded projects.");
|
||||||
|
|
||||||
foreach (const ProjectInfo &info, projectInfos) {
|
foreach (const ProjectInfo &info, projectInfos) {
|
||||||
QPointer<ProjectExplorer::Project> project = info.project();
|
QPointer<ProjectExplorer::Project> project = info.project();
|
||||||
|
|||||||
@@ -35,11 +35,8 @@
|
|||||||
#include "cppworkingcopy.h"
|
#include "cppworkingcopy.h"
|
||||||
|
|
||||||
#include <cplusplus/Icons.h>
|
#include <cplusplus/Icons.h>
|
||||||
|
#include <cplusplus/Symbol.h>
|
||||||
#include <cplusplus/TypeOfExpression.h>
|
#include <cplusplus/TypeOfExpression.h>
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
// Qt 5 requires the types to be defined for Q_DECLARE_METATYPE
|
|
||||||
# include <cplusplus/Symbol.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <texteditor/basetexteditor.h>
|
#include <texteditor/basetexteditor.h>
|
||||||
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
|
#include <texteditor/codeassist/basicproposalitemlistmodel.h>
|
||||||
|
|||||||
@@ -46,12 +46,6 @@
|
|||||||
#include <QFileInfo>
|
#include <QFileInfo>
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
#define MSKIP_SINGLE(x) QSKIP(x)
|
|
||||||
#else
|
|
||||||
#define MSKIP_SINGLE(x) QSKIP(x, SkipSingle)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
using namespace CppTools::Internal;
|
using namespace CppTools::Internal;
|
||||||
using namespace ProjectExplorer;
|
using namespace ProjectExplorer;
|
||||||
|
|
||||||
@@ -247,7 +241,7 @@ void CppToolsPlugin::test_modelmanager_paths_are_clean()
|
|||||||
void CppToolsPlugin::test_modelmanager_framework_headers()
|
void CppToolsPlugin::test_modelmanager_framework_headers()
|
||||||
{
|
{
|
||||||
if (Utils::HostOsInfo::isWindowsHost())
|
if (Utils::HostOsInfo::isWindowsHost())
|
||||||
MSKIP_SINGLE("Can't resolve framework soft links on Windows.");
|
QSKIP("Can't resolve framework soft links on Windows.");
|
||||||
|
|
||||||
ModelManagerTestHelper helper;
|
ModelManagerTestHelper helper;
|
||||||
CppModelManager *mm = CppModelManager::instance();
|
CppModelManager *mm = CppModelManager::instance();
|
||||||
|
|||||||
@@ -60,7 +60,7 @@ QString StringTable::insert(const QString &string)
|
|||||||
if (string.isEmpty())
|
if (string.isEmpty())
|
||||||
return string;
|
return string;
|
||||||
|
|
||||||
#if QT_VERSION >= 0x050000 && QT_SUPPORTS(UNSHARABLE_CONTAINERS)
|
#if QT_SUPPORTS(UNSHARABLE_CONTAINERS)
|
||||||
QTC_ASSERT(const_cast<QString&>(string).data_ptr()->ref.isSharable(), return string);
|
QTC_ASSERT(const_cast<QString&>(string).data_ptr()->ref.isSharable(), return string);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -90,12 +90,8 @@ enum {
|
|||||||
|
|
||||||
static inline bool isQStringInUse(const QString &string)
|
static inline bool isQStringInUse(const QString &string)
|
||||||
{
|
{
|
||||||
#if QT_VERSION >= 0x050000
|
|
||||||
QArrayData *data_ptr = const_cast<QString&>(string).data_ptr();
|
QArrayData *data_ptr = const_cast<QString&>(string).data_ptr();
|
||||||
return data_ptr->ref.isShared() || data_ptr->ref.isStatic();
|
return data_ptr->ref.isShared() || data_ptr->ref.isStatic();
|
||||||
#else
|
|
||||||
return const_cast<QString&>(string).data_ptr()->ref != 1;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void StringTable::GC()
|
void StringTable::GC()
|
||||||
|
|||||||
@@ -27,21 +27,13 @@
|
|||||||
**
|
**
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#include <QStringList>
|
|
||||||
#include <QTextDocument>
|
|
||||||
#include <QTextCursor>
|
|
||||||
#include <QTextBlock>
|
|
||||||
#include <QDir>
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QDir>
|
||||||
#if QT_VERSION >= 0x050000
|
#include <QGuiApplication>
|
||||||
// Qt5: QTextDocument needs access to Fonts via QGuiApplication.
|
#include <QStringList>
|
||||||
#include <QGuiApplication>
|
#include <QTextBlock>
|
||||||
typedef QGuiApplication MyQApplication;
|
#include <QTextCursor>
|
||||||
#else
|
#include <QTextDocument>
|
||||||
#include <QCoreApplication>
|
|
||||||
typedef QCoreApplication MyQApplication;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <cplusplus/Control.h>
|
#include <cplusplus/Control.h>
|
||||||
#include <cplusplus/Parser.h>
|
#include <cplusplus/Parser.h>
|
||||||
@@ -1720,7 +1712,7 @@ void printUsage()
|
|||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
MyQApplication app(argc, argv);
|
QGuiApplication app(argc, argv);
|
||||||
QStringList args = app.arguments();
|
QStringList args = app.arguments();
|
||||||
args.removeFirst();
|
args.removeFirst();
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user