diff options
Diffstat (limited to 'src/plugins/coreplugin')
-rw-r--r-- | src/plugins/coreplugin/coreplugin.pro | 5 | ||||
-rw-r--r-- | src/plugins/coreplugin/coreplugin.qbs | 10 | ||||
-rw-r--r-- | src/plugins/coreplugin/editormanager/editormanager.cpp | 2 | ||||
-rw-r--r-- | src/plugins/coreplugin/plugintestutils.cpp | 50 | ||||
-rw-r--r-- | src/plugins/coreplugin/plugintestutils.h | 50 |
5 files changed, 1 insertions, 116 deletions
diff --git a/src/plugins/coreplugin/coreplugin.pro b/src/plugins/coreplugin/coreplugin.pro index accc477d71..192c16f4bb 100644 --- a/src/plugins/coreplugin/coreplugin.pro +++ b/src/plugins/coreplugin/coreplugin.pro @@ -241,8 +241,3 @@ else:unix { } } OTHER_FILES += editormanager/BinFiles.mimetypes.xml - -equals(TEST, 1) { - SOURCES += plugintestutils.cpp - HEADERS += plugintestutils.h -} diff --git a/src/plugins/coreplugin/coreplugin.qbs b/src/plugins/coreplugin/coreplugin.qbs index 374da3f4d4..6ebcfb76a0 100644 --- a/src/plugins/coreplugin/coreplugin.qbs +++ b/src/plugins/coreplugin/coreplugin.qbs @@ -1,6 +1,5 @@ import qbs.base 1.0 import "../QtcPlugin.qbs" as QtcPlugin -import "../../../qbs/defaults.js" as Defaults QtcPlugin { name: "Core" @@ -259,15 +258,6 @@ QtcPlugin { ] } - Group { - name: "Tests" - condition: Defaults.testsEnabled(qbs) - files: [ - "plugintestutils.cpp", - "plugintestutils.h" - ] - } - Export { Depends { name: "Aggregation" } Depends { name: "Utils" } diff --git a/src/plugins/coreplugin/editormanager/editormanager.cpp b/src/plugins/coreplugin/editormanager/editormanager.cpp index 2f1cc62df8..420b3a7940 100644 --- a/src/plugins/coreplugin/editormanager/editormanager.cpp +++ b/src/plugins/coreplugin/editormanager/editormanager.cpp @@ -1162,7 +1162,7 @@ bool EditorManager::closeEditors(const QList<IEditor*> &editorsToClose, bool ask emit editorsClosed(acceptedEditors); foreach (IEditor *editor, acceptedEditors) - editor->deleteLater(); + delete editor; if (currentView) { if (IEditor *editor = currentView->currentEditor()) diff --git a/src/plugins/coreplugin/plugintestutils.cpp b/src/plugins/coreplugin/plugintestutils.cpp deleted file mode 100644 index d94f606da1..0000000000 --- a/src/plugins/coreplugin/plugintestutils.cpp +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - - -#include "plugintestutils.h" - -#include "editormanager/editormanager.h" -#include "editormanager/ieditor.h" - -#include <QCoreApplication> - -void Core::Tests::closeAndDeleteEditors(QList<IEditor *> editorsToClose) -{ - EditorManager::instance()->closeEditors(editorsToClose, /*askAboutModifiedEditors=*/ false); - // The editors are going to be deleted by the event loop (deleteLater()), - // but for tests we need them deleted now. - foreach (Core::IEditor *editor, editorsToClose) - QCoreApplication::sendPostedEvents(editor, QEvent::DeferredDelete); -} - -void Core::Tests::closeAndDeleteEditor(Core::IEditor *editor) -{ - closeAndDeleteEditors(QList<IEditor *>() << editor); -} diff --git a/src/plugins/coreplugin/plugintestutils.h b/src/plugins/coreplugin/plugintestutils.h deleted file mode 100644 index 69ada2bad3..0000000000 --- a/src/plugins/coreplugin/plugintestutils.h +++ /dev/null @@ -1,50 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of Qt Creator. -** -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -****************************************************************************/ - - -#ifndef PLUGINTESTUTILS_H -#define PLUGINTESTUTILS_H - -#include "core_global.h" - -#include <QList> - -namespace Core { - -class IEditor; - -namespace Tests { - -void CORE_EXPORT closeAndDeleteEditor(Core::IEditor *editor); -void CORE_EXPORT closeAndDeleteEditors(QList<Core::IEditor *> editorsToClose); - -} // namespace Tests -} // namespace Core - -#endif // PLUGINTESTUTILS_H |