From ae19d452b6ec8c9cf9cff828b83db5702010789a Mon Sep 17 00:00:00 2001 From: hjk <hjk@theqtcompany.com> Date: Mon, 30 May 2016 16:29:51 +0200 Subject: [PATCH] Debugger: Move remaining Analyzer overlay icon to ProjectExplorer It's the only remaining item and loosens the dependencies of ex-AnalyzerBase based plugins on the the Debugger. Change-Id: I943ac44401c440dd6d3d5c1f54f8f996accd2b4a Reviewed-by: Alessandro Portale <alessandro.portale@theqtcompany.com> --- src/plugins/debugger/analyzer/analyzer.pri | 3 +- .../debugger/analyzer/analyzerbase.qrc | 2 - src/plugins/debugger/analyzer/analyzericons.h | 42 ------------------ .../debugger/analyzer/analyzerruncontrol.cpp | 4 +- src/plugins/debugger/debugger.qbs | 1 - src/plugins/debugger/debuggermainwindow.cpp | 1 - src/plugins/debugger/debuggerplugin.cpp | 3 +- .../images/analyzer_overlay_small.png | Bin .../images/analyzer_overlay_small@2x.png | Bin .../projectexplorer/projectexplorer.qrc | 2 + .../projectexplorer/projectexplorericons.h | 7 +++ src/plugins/valgrind/callgrindtool.cpp | 3 +- src/tools/icons/qtcreatoricons.svg | 2 +- 13 files changed, 15 insertions(+), 55 deletions(-) delete mode 100644 src/plugins/debugger/analyzer/analyzericons.h rename src/plugins/{debugger/analyzer => projectexplorer}/images/analyzer_overlay_small.png (100%) rename src/plugins/{debugger/analyzer => projectexplorer}/images/analyzer_overlay_small@2x.png (100%) diff --git a/src/plugins/debugger/analyzer/analyzer.pri b/src/plugins/debugger/analyzer/analyzer.pri index 2ae4afc5987..dc2d12eff6f 100644 --- a/src/plugins/debugger/analyzer/analyzer.pri +++ b/src/plugins/debugger/analyzer/analyzer.pri @@ -20,8 +20,7 @@ HEADERS += \ $$PWD/analyzerutils.h \ $$PWD/detailederrorview.h \ $$PWD/diagnosticlocation.h \ - $$PWD/startremotedialog.h \ - $$PWD/analyzericons.h + $$PWD/startremotedialog.h RESOURCES += \ $$PWD/analyzerbase.qrc diff --git a/src/plugins/debugger/analyzer/analyzerbase.qrc b/src/plugins/debugger/analyzer/analyzerbase.qrc index a6e642fc61b..57e529f246e 100644 --- a/src/plugins/debugger/analyzer/analyzerbase.qrc +++ b/src/plugins/debugger/analyzer/analyzerbase.qrc @@ -1,7 +1,5 @@ <RCC> <qresource prefix="/"> <file>images/analyzer_category.png</file> - <file>images/analyzer_overlay_small.png</file> - <file>images/analyzer_overlay_small@2x.png</file> </qresource> </RCC> diff --git a/src/plugins/debugger/analyzer/analyzericons.h b/src/plugins/debugger/analyzer/analyzericons.h deleted file mode 100644 index 8976379a32f..00000000000 --- a/src/plugins/debugger/analyzer/analyzericons.h +++ /dev/null @@ -1,42 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2016 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** 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 The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -****************************************************************************/ - -#pragma once - -#include <utils/icon.h> - -namespace Debugger { -namespace Icons { - -const Utils::Icon ANALYZER_CONTROL_START({ - {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}, - {QLatin1String(":/images/analyzer_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, - Utils::Icon::MenuTintedStyle); -const Utils::Icon ANALYZER_CONTROL_START_TOOLBAR({ - {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunToolBarColor}, - {QLatin1String(":/images/analyzer_overlay_small.png"), Utils::Theme::IconsBaseColor}}); - -} // namespace Icons -} // namespace Debugger diff --git a/src/plugins/debugger/analyzer/analyzerruncontrol.cpp b/src/plugins/debugger/analyzer/analyzerruncontrol.cpp index b72d5998497..41b1b5ea8f7 100644 --- a/src/plugins/debugger/analyzer/analyzerruncontrol.cpp +++ b/src/plugins/debugger/analyzer/analyzerruncontrol.cpp @@ -24,12 +24,12 @@ ** ****************************************************************************/ -#include "analyzericons.h" #include "analyzermanager.h" #include "analyzerruncontrol.h" #include <projectexplorer/project.h> #include <projectexplorer/runconfigurationaspects.h> +#include <projectexplorer/projectexplorericons.h> #include <projectexplorer/target.h> #include <QDebug> @@ -42,7 +42,7 @@ namespace Debugger { AnalyzerRunControl::AnalyzerRunControl(RunConfiguration *runConfiguration, Core::Id runMode) : RunControl(runConfiguration, runMode) { - setIcon(Icons::ANALYZER_CONTROL_START_TOOLBAR); + setIcon(Icons::ANALYZER_START_SMALL_TOOLBAR); } } // namespace Debugger diff --git a/src/plugins/debugger/debugger.qbs b/src/plugins/debugger/debugger.qbs index 2241b60da7c..276e2967829 100644 --- a/src/plugins/debugger/debugger.qbs +++ b/src/plugins/debugger/debugger.qbs @@ -246,7 +246,6 @@ QtcPlugin { files: [ "analyzerbase.qrc", "analyzerconstants.h", - "analyzericons.h", "analyzermanager.h", "analyzerrunconfigwidget.cpp", "analyzerrunconfigwidget.h", diff --git a/src/plugins/debugger/debuggermainwindow.cpp b/src/plugins/debugger/debuggermainwindow.cpp index 208558e8954..d3d5ceb3f85 100644 --- a/src/plugins/debugger/debuggermainwindow.cpp +++ b/src/plugins/debugger/debuggermainwindow.cpp @@ -26,7 +26,6 @@ #include "debuggermainwindow.h" #include "debuggerconstants.h" #include "debuggerinternalconstants.h" -#include "analyzer/analyzericons.h" #include <coreplugin/actionmanager/actioncontainer.h> #include <coreplugin/actionmanager/actionmanager.h> diff --git a/src/plugins/debugger/debuggerplugin.cpp b/src/plugins/debugger/debuggerplugin.cpp index 417b3d501e4..06e7b258c39 100644 --- a/src/plugins/debugger/debuggerplugin.cpp +++ b/src/plugins/debugger/debuggerplugin.cpp @@ -72,7 +72,6 @@ #include "gdb/startgdbserverdialog.h" #include "analyzer/analyzerconstants.h" -#include "analyzer/analyzericons.h" #include "analyzer/analyzermanager.h" #include "analyzer/analyzerruncontrol.h" #include "analyzer/analyzerstartparameters.h" @@ -3571,7 +3570,7 @@ void registerToolbar(const QByteArray &perspectiveId, const ToolbarDescription & QAction *createStartAction() { auto action = new QAction(DebuggerMainWindow::tr("Start"), DebuggerPlugin::instance()); - action->setIcon(Icons::ANALYZER_CONTROL_START_TOOLBAR.icon()); + action->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL_TOOLBAR.icon()); action->setEnabled(true); return action; } diff --git a/src/plugins/debugger/analyzer/images/analyzer_overlay_small.png b/src/plugins/projectexplorer/images/analyzer_overlay_small.png similarity index 100% rename from src/plugins/debugger/analyzer/images/analyzer_overlay_small.png rename to src/plugins/projectexplorer/images/analyzer_overlay_small.png diff --git a/src/plugins/debugger/analyzer/images/analyzer_overlay_small@2x.png b/src/plugins/projectexplorer/images/analyzer_overlay_small@2x.png similarity index 100% rename from src/plugins/debugger/analyzer/images/analyzer_overlay_small@2x.png rename to src/plugins/projectexplorer/images/analyzer_overlay_small@2x.png diff --git a/src/plugins/projectexplorer/projectexplorer.qrc b/src/plugins/projectexplorer/projectexplorer.qrc index 701466ac803..6f2bac4a903 100644 --- a/src/plugins/projectexplorer/projectexplorer.qrc +++ b/src/plugins/projectexplorer/projectexplorer.qrc @@ -22,6 +22,8 @@ <file>images/run_mask@2x.png</file> <file>images/debugger_overlay_small.png</file> <file>images/debugger_overlay_small@2x.png</file> + <file>images/analyzer_overlay_small.png</file> + <file>images/analyzer_overlay_small@2x.png</file> <file>images/session.png</file> <file>images/targetrunselected.png</file> <file>images/targetrunselected@2x.png</file> diff --git a/src/plugins/projectexplorer/projectexplorericons.h b/src/plugins/projectexplorer/projectexplorericons.h index 72cbda74d6d..e65e5ecd964 100644 --- a/src/plugins/projectexplorer/projectexplorericons.h +++ b/src/plugins/projectexplorer/projectexplorericons.h @@ -58,6 +58,13 @@ const Utils::Icon DEBUG_START_SMALL({ const Utils::Icon DEBUG_START_SMALL_TOOLBAR({ {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunToolBarColor}, {QLatin1String(":/projectexplorer/images/debugger_overlay_small.png"), Utils::Theme::IconsDebugColor}}); +const Utils::Icon ANALYZER_START_SMALL({ + {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunColor}, + {QLatin1String(":/projectexplorer/images/analyzer_overlay_small.png"), Utils::Theme::PanelTextColorMid}}, + Utils::Icon::MenuTintedStyle); +const Utils::Icon ANALYZER_START_SMALL_TOOLBAR({ + {QLatin1String(":/core/images/run_small.png"), Utils::Theme::IconsRunToolBarColor}, + {QLatin1String(":/projectexplorer/images/analyzer_overlay_small.png"), Utils::Theme::IconsBaseColor}}); const Utils::Icon BUILDSTEP_MOVEUP({ {QLatin1String(":/projectexplorer/images/buildstepmoveup.png"), Utils::Theme::PanelTextColorDark}}, Utils::Icon::Tint); diff --git a/src/plugins/valgrind/callgrindtool.cpp b/src/plugins/valgrind/callgrindtool.cpp index 917703743c5..39bedd859ed 100644 --- a/src/plugins/valgrind/callgrindtool.cpp +++ b/src/plugins/valgrind/callgrindtool.cpp @@ -46,7 +46,6 @@ #include <debugger/debuggerconstants.h> #include <debugger/analyzer/analyzerconstants.h> -#include <debugger/analyzer/analyzericons.h> #include <debugger/analyzer/analyzermanager.h> #include <debugger/analyzer/analyzerstartparameters.h> #include <debugger/analyzer/analyzerutils.h> @@ -297,7 +296,7 @@ CallgrindTool::CallgrindTool(QObject *parent) editorContextMenu->addSeparator(analyzerContext); auto action = new QAction(tr("Profile Costs of This Function and Its Callees"), this); - action->setIcon(Debugger::Icons::ANALYZER_CONTROL_START.icon()); + action->setIcon(ProjectExplorer::Icons::ANALYZER_START_SMALL.icon()); connect(action, &QAction::triggered, this, &CallgrindTool::handleShowCostsOfFunction); Command *cmd = ActionManager::registerAction(action, "Analyzer.Callgrind.ShowCostsOfFunction", diff --git a/src/tools/icons/qtcreatoricons.svg b/src/tools/icons/qtcreatoricons.svg index acdb7bf914b..4215cc2cd89 100644 --- a/src/tools/icons/qtcreatoricons.svg +++ b/src/tools/icons/qtcreatoricons.svg @@ -2416,7 +2416,7 @@ y="578.5" /> </g> <g - id="src/plugins/debugger/analyzer/images/analyzer_overlay_small" + id="src/plugins/projectexplorer/images/analyzer_overlay_small" transform="translate(16,0)"> <rect id="rect4959-4-5" -- GitLab