Commit 3aa3c568 authored by Alessandro Portale's avatar Alessandro Portale
Browse files

Pedantic cleanup of filename parameters for QIcon constructor

Using more *::Constants::ICON_* where it makes sense and
wrapping the file names into QLatin1String where they were
missing.

The increased usage of the ICON constants needed a few more
cross plugin includes of *constants.h, here and there.
I think that it is OK, since the dependencies were alredy there
icon resource wise.
parent e55c346f
......@@ -15,15 +15,15 @@ QmlToolbar::QmlToolbar(QWidget *parent) :
m_isRunning(false),
ui(new Ui)
{
ui->designmode = new QAction(QIcon(":/qml/images/designmode.png"), tr("Design Mode"), this);
ui->play = new QAction(QIcon(":/qml/images/play.png"), tr("Play"), this);
ui->pause = new QAction(QIcon(":/qml/images/pause.png"), tr("Pause"), this);
ui->select = new QAction(QIcon(":/qml/images/select.png"), tr("Select"), this);
ui->selectMarquee = new QAction(QIcon(":/qml/images/select-marquee.png"), tr("Select (Marquee)"), this);
ui->zoom = new QAction(QIcon(":/qml/images/zoom.png"), tr("Zoom"), this);
ui->colorPicker = new QAction(QIcon(":/qml/images/color-picker-hicontrast.png"), tr("Color Picker"), this);
ui->toQml = new QAction(QIcon(":/qml/images/to-qml.png"), tr("Apply Changes to QML Viewer"), this);
ui->fromQml = new QAction(QIcon(":/qml/images/from-qml.png"), tr("Apply Changes to Document"), this);
ui->designmode = new QAction(QIcon(QLatin1String(":/qml/images/designmode.png")), tr("Design Mode"), this);
ui->play = new QAction(QIcon(QLatin1String(":/qml/images/play.png")), tr("Play"), this);
ui->pause = new QAction(QIcon(QLatin1String(":/qml/images/pause.png")), tr("Pause"), this);
ui->select = new QAction(QIcon(QLatin1String(":/qml/images/select.png")), tr("Select"), this);
ui->selectMarquee = new QAction(QIcon(QLatin1String(":/qml/images/select-marquee.png")), tr("Select (Marquee)"), this);
ui->zoom = new QAction(QIcon(QLatin1String(":/qml/images/zoom.png")), tr("Zoom"), this);
ui->colorPicker = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")), tr("Color Picker"), this);
ui->toQml = new QAction(QIcon(QLatin1String(":/qml/images/to-qml.png")), tr("Apply Changes to QML Viewer"), this);
ui->fromQml = new QAction(QIcon(QLatin1String(":/qml/images/from-qml.png")), tr("Apply Changes to Document"), this);
ui->designmode->setCheckable(true);
ui->designmode->setChecked(false);
......
......@@ -19,7 +19,7 @@ namespace QmlViewer {
ToolBarColorBox::ToolBarColorBox(QWidget *parent) :
QLabel(parent)
{
m_copyHexColor = new QAction(QIcon(":/qml/images/color-picker-hicontrast.png"), tr("Copy"), this);
m_copyHexColor = new QAction(QIcon(QLatin1String(":/qml/images/color-picker-hicontrast.png")), tr("Copy"), this);
connect(m_copyHexColor, SIGNAL(triggered()), SLOT(copyColorToClipboard()));
setScaledContents(false);
}
......
......@@ -41,7 +41,7 @@ FilterLineEdit::FilterLineEdit(QWidget *parent) :
QIcon icon = QIcon::fromTheme(layoutDirection() == Qt::LeftToRight ?
QLatin1String("edit-clear-locationbar-rtl") :
QLatin1String("edit-clear-locationbar-ltr"),
QIcon::fromTheme("edit-clear", QIcon(QLatin1String(":/core/images/editclear.png"))));
QIcon::fromTheme(QLatin1String("edit-clear"), QIcon(QLatin1String(":/core/images/editclear.png"))));
setButtonPixmap(Right, icon.pixmap(16));
setButtonVisible(Right, true);
......
......@@ -115,7 +115,7 @@ LinearProgressWidget::LinearProgressWidget(WizardProgress *progress, QWidget *pa
m_dotsItemWidget(0),
m_disableUpdatesCount(0)
{
m_indicatorPixmap = QIcon::fromTheme("go-next", QIcon(QLatin1String(":/utils/images/arrow.png"))).pixmap(16);
m_indicatorPixmap = QIcon::fromTheme(QLatin1String("go-next"), QIcon(QLatin1String(":/utils/images/arrow.png"))).pixmap(16);
m_wizardProgress = progress;
m_mainLayout = new QVBoxLayout(this);
m_itemWidgetLayout = new QVBoxLayout();
......
......@@ -34,6 +34,7 @@
#include "cmakeprojectconstants.h"
#include "cmaketarget.h"
#include <coreplugin/coreconstants.h>
#include <projectexplorer/environment.h>
#include <projectexplorer/debugginghelper.h>
#include <utils/qtcassert.h>
......@@ -330,7 +331,7 @@ CMakeRunConfigurationWidget::CMakeRunConfigurationWidget(CMakeRunConfiguration *
QToolButton *resetButton = new QToolButton();
resetButton->setToolTip(tr("Reset to default"));
resetButton->setIcon(QIcon(":/core/images/reset.png"));
resetButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_RESET)));
QHBoxLayout *boxlayout = new QHBoxLayout();
boxlayout->addWidget(m_workingDirectoryEdit);
......
......@@ -230,6 +230,13 @@ const char * const ICON_REPLACE = ":/core/images/replace.png";
const char * const ICON_RESET = ":/core/images/reset.png";
const char * const ICON_MAGNIFIER = ":/core/images/magnifier.png";
const char * const ICON_TOGGLE_SIDEBAR = ":/core/images/sidebaricon.png";
const char * const ICON_CLOSE = ":/core/images/closebutton.png";
const char * const ICON_CLOSE_DARK = ":/core/images/darkclosebutton.png";
const char * const ICON_SPLIT_HORIZONTAL = ":/core/images/splitbutton_horizontal.png";
const char * const ICON_FILTER = ":/core/images/filtericon.png";
const char * const ICON_LINK = ":/core/images/linkicon.png";
const char * const ICON_QTLOGO_32 = ":/core/images/qtcreator_logo_32.png";
const char * const ICON_QTLOGO_128 = ":/core/images/qtcreator_logo_128.png";
const char * const WIZARD_CATEGORY_QT = "R.Qt";
const char * const WIZARD_TR_CATEGORY_QT = QT_TRANSLATE_NOOP("Core", "Qt");
......
......@@ -230,8 +230,8 @@ EditorManagerPrivate::EditorManagerPrivate(ICore *core, QWidget *parent) :
m_closeOtherEditorsAction(new QAction(EditorManager::tr("Close Others"), parent)),
m_gotoNextDocHistoryAction(new QAction(EditorManager::tr("Next Open Document in History"), parent)),
m_gotoPreviousDocHistoryAction(new QAction(EditorManager::tr("Previous Open Document in History"), parent)),
m_goBackAction(new QAction(QIcon(QLatin1String(":/help/images/previous.png")), EditorManager::tr("Go Back"), parent)),
m_goForwardAction(new QAction(QIcon(QLatin1String(":/help/images/next.png")), EditorManager::tr("Go Forward"), parent)),
m_goBackAction(new QAction(QIcon(QLatin1String(Constants::ICON_PREV)), EditorManager::tr("Go Back"), parent)),
m_goForwardAction(new QAction(QIcon(QLatin1String(Constants::ICON_NEXT)), EditorManager::tr("Go Forward"), parent)),
m_openInExternalEditorAction(new QAction(EditorManager::tr("Open in External Editor"), parent)),
m_windowPopup(0),
m_coreListener(0),
......
......@@ -114,7 +114,7 @@ EditorView::EditorView(QWidget *parent) :
m_infoWidgetCloseButton = new QToolButton;
m_infoWidgetCloseButton->setAutoRaise(true);
m_infoWidgetCloseButton->setIcon(QIcon(":/core/images/clear.png"));
m_infoWidgetCloseButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR)));
m_infoWidgetCloseButton->setToolTip(tr("Close"));
hbox->addWidget(m_infoWidgetCloseButton);
......@@ -146,7 +146,7 @@ EditorView::EditorView(QWidget *parent) :
m_statusWidgetButton = new QToolButton;
m_statusWidgetButton->setContentsMargins(0, 0, 0, 0);
//m_statusWidgetButton->setIcon(QIcon(":/core/images/clear.png"));
//m_statusWidgetButton->setIcon(QIcon(QLatin1String(Core::Constants::ICON_CLEAR)));
hbox->addWidget(m_statusWidgetButton);
m_statusHLine->setVisible(false);
......
......@@ -77,8 +77,8 @@ void OpenEditorsDelegate::paint(QPainter *painter, const QStyleOptionViewItem &o
QStyledItemDelegate::paint(painter, option, index);
if (index.column() == 1 && option.state & QStyle::State_MouseOver) {
QIcon icon((option.state & QStyle::State_Selected) ? ":/core/images/closebutton.png"
: ":/core/images/darkclosebutton.png");
const QIcon icon(QLatin1String((option.state & QStyle::State_Selected) ?
Constants::ICON_CLOSE : Constants::ICON_CLOSE_DARK));
QRect iconRect(option.rect.right() - option.rect.height(),
option.rect.top(),
......
......@@ -110,7 +110,7 @@ EditorToolBar::EditorToolBar(QWidget *parent) :
m_lockButton->setVisible(false);
m_closeButton->setAutoRaise(true);
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
m_closeButton->setProperty("type", QLatin1String("dockbutton"));
m_closeButton->setEnabled(false);
......
......@@ -161,13 +161,13 @@ MainWindow::MainWindow() :
setWindowTitle(tr("Qt Creator"));
#ifndef Q_WS_MAC
qApp->setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png"));
QApplication::setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));
#endif
QCoreApplication::setApplicationName(QLatin1String("QtCreator"));
QCoreApplication::setApplicationVersion(QLatin1String(Core::Constants::IDE_VERSION_LONG));
QCoreApplication::setOrganizationName(QLatin1String("Nokia"));
QSettings::setDefaultFormat(QSettings::IniFormat);
QString baseName = qApp->style()->objectName();
QString baseName = QApplication::style()->objectName();
#ifdef Q_WS_X11
if (baseName == QLatin1String("windows")) {
// Sometimes we get the standard windows 95 style as a fallback
......
......@@ -33,6 +33,8 @@
#include <QtCore/QLibrary>
#include <coreplugin/coreconstants.h>
#include <utils/qtcassert.h>
#include <utils/stylehelper.h>
......@@ -141,7 +143,7 @@ ManhattanStylePrivate::ManhattanStylePrivate() :
lineeditImage(QLatin1String(":/core/images/inputfield.png")),
lineeditImage_disabled(QLatin1String(":/core/images/inputfield_disabled.png")),
extButtonPixmap(QLatin1String(":/core/images/extension.png")),
closeButtonPixmap(QLatin1String(":/core/images/closebutton.png"))
closeButtonPixmap(QLatin1String(Core::Constants::ICON_CLOSE))
{
}
......
......@@ -408,10 +408,10 @@ NavigationSubWidget::NavigationSubWidget(NavigationWidget *parentWidget, int pos
toolBarLayout->addWidget(m_navigationComboBox);
QToolButton *splitAction = new QToolButton();
splitAction->setIcon(QIcon(":/core/images/splitbutton_horizontal.png"));
splitAction->setIcon(QIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)));
splitAction->setToolTip(tr("Split"));
QToolButton *close = new QToolButton();
close->setIcon(QIcon(":/core/images/closebutton.png"));
close->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
close->setToolTip(tr("Close"));
toolBarLayout->addWidget(splitAction);
......
......@@ -209,17 +209,17 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
setWindowTitle(tr("Output"));
connect(m_widgetComboBox, SIGNAL(currentIndexChanged(int)), this, SLOT(changePage()));
m_clearButton->setIcon(QIcon(Constants::ICON_CLEAN_PANE));
m_clearButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLEAN_PANE)));
m_clearButton->setToolTip(tr("Clear"));
connect(m_clearButton, SIGNAL(clicked()), this, SLOT(clearPage()));
m_nextAction = new QAction(this);
m_nextAction->setIcon(QIcon(":/core/images/next.png"));
m_nextAction->setIcon(QIcon(QLatin1String(Constants::ICON_NEXT)));
m_nextAction->setText(tr("Next Item"));
connect(m_nextAction, SIGNAL(triggered()), this, SLOT(slotNext()));
m_prevAction = new QAction(this);
m_prevAction->setIcon(QIcon(":/core/images/prev.png"));
m_prevAction->setIcon(QIcon(QLatin1String(Constants::ICON_PREV)));
m_prevAction->setText(tr("Previous Item"));
connect(m_prevAction, SIGNAL(triggered()), this, SLOT(slotPrev()));
......@@ -227,7 +227,7 @@ OutputPaneManager::OutputPaneManager(QWidget *parent) :
m_minMaxAction->setIcon(m_maximizeIcon);
m_minMaxAction->setText(tr("Maximize Output Pane"));
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
connect(m_closeButton, SIGNAL(clicked()), this, SLOT(slotHide()));
QVBoxLayout *mainlayout = new QVBoxLayout;
......
......@@ -30,6 +30,8 @@
#include "sidebar.h"
#include "imode.h"
#include <coreplugin/coreconstants.h>
#include "actionmanager/actionmanager.h"
#include "actionmanager/command.h"
......@@ -324,12 +326,12 @@ SideBarWidget::SideBarWidget(SideBar *sideBar, const QString &id)
m_toolbar->addWidget(m_comboBox);
m_splitButton = new QToolButton;
m_splitButton->setIcon(QIcon(":/core/images/splitbutton_horizontal.png"));
m_splitButton->setIcon(QIcon(QLatin1String(Constants::ICON_SPLIT_HORIZONTAL)));
m_splitButton->setToolTip(tr("Split"));
connect(m_splitButton, SIGNAL(clicked(bool)), this, SIGNAL(splitMe()));
m_closeButton = new QToolButton;
m_closeButton->setIcon(QIcon(":/core/images/closebutton.png"));
m_closeButton->setIcon(QIcon(QLatin1String(Constants::ICON_CLOSE)));
m_closeButton->setToolTip(tr("Close"));
connect(m_closeButton, SIGNAL(clicked(bool)), this, SIGNAL(closeMe()));
......
......@@ -53,7 +53,7 @@ VersionDialog::VersionDialog(QWidget *parent)
{
// We need to set the window icon explicitly here since for some reason the
// application icon isn't used when the size of the dialog is fixed (at least not on X11/GNOME)
setWindowIcon(QIcon(":/core/images/qtcreator_logo_128.png"));
setWindowIcon(QIcon(QLatin1String(Constants::ICON_QTLOGO_128)));
setWindowTitle(tr("About Qt Creator"));
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
......@@ -104,7 +104,7 @@ VersionDialog::VersionDialog(QWidget *parent)
connect(buttonBox , SIGNAL(rejected()), this, SLOT(reject()));
QLabel *logoLabel = new QLabel;
logoLabel->setPixmap(QPixmap(QLatin1String(":/core/images/qtcreator_logo_128.png")));
logoLabel->setPixmap(QPixmap(QLatin1String(Constants::ICON_QTLOGO_128)));
layout->addWidget(logoLabel , 0, 0, 1, 1);
layout->addWidget(copyRightLabel, 0, 1, 4, 4);
layout->addWidget(buttonBox, 4, 0, 1, 5);
......
......@@ -81,11 +81,11 @@ CppEditorFactory::CppEditorFactory(CppPlugin *owner) :
#if !defined(Q_WS_MAC) && !defined(Q_WS_WIN)
Core::FileIconProvider *iconProvider = Core::FileIconProvider::instance();
Core::MimeDatabase *mimeDatabase = Core::ICore::instance()->mimeDatabase();
iconProvider->registerIconOverlayForMimeType(QIcon(":/cppeditor/images/qt_cpp.png"),
iconProvider->registerIconOverlayForMimeType(QIcon(QLatin1String(":/cppeditor/images/qt_cpp.png")),
mimeDatabase->findByType(QLatin1String(CppEditor::Constants::CPP_SOURCE_MIMETYPE)));
iconProvider->registerIconOverlayForMimeType(QIcon(":/cppeditor/images/qt_c.png"),
iconProvider->registerIconOverlayForMimeType(QIcon(QLatin1String(":/cppeditor/images/qt_c.png")),
mimeDatabase->findByType(QLatin1String(CppEditor::Constants::C_SOURCE_MIMETYPE)));
iconProvider->registerIconOverlayForMimeType(QIcon(":/cppeditor/images/qt_h.png"),
iconProvider->registerIconOverlayForMimeType(QIcon(QLatin1String(":/cppeditor/images/qt_h.png")),
mimeDatabase->findByType(QLatin1String(CppEditor::Constants::CPP_HEADER_MIMETYPE)));
#endif
}
......
......@@ -87,7 +87,7 @@ BreakWindow::BreakWindow(QWidget *parent)
setFrameStyle(QFrame::NoFrame);
setAttribute(Qt::WA_MacShowFocusRect, false);
setWindowTitle(tr("Breakpoints"));
setWindowIcon(QIcon(":/debugger/images/debugger_breakpoints.png"));
setWindowIcon(QIcon(QLatin1String(":/debugger/images/debugger_breakpoints.png")));
setAlternatingRowColors(act->isChecked());
setRootIsDecorated(false);
setIconSize(QSize(10, 10));
......
......@@ -227,7 +227,7 @@ DebuggerSettings *DebuggerSettings::instance()
item->setText(tr("Operate by Instruction"));
item->setCheckable(true);
item->setDefaultValue(false);
item->setIcon(QIcon(":/debugger/images/debugger_singleinstructionmode.png"));
item->setIcon(QIcon(QLatin1String(":/debugger/images/debugger_singleinstructionmode.png")));
item->setToolTip(tr("This switches the debugger to instruction-wise "
"operation mode. In this mode, stepping operates on single "
"instructions and the source location view also shows the "
......
......@@ -443,7 +443,7 @@ public:
{
setDisplayName(QCoreApplication::translate("Debugger::Internal::DebugMode", "Debug"));
setId(MODE_DEBUG);
setIcon(QIcon(":/fancyactionbar/images/mode_Debug.png"));
setIcon(QIcon(__(":/fancyactionbar/images/mode_Debug.png")));
setPriority(P_MODE_DEBUG);
}
......@@ -1083,9 +1083,9 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
const Core::Context cppeditorcontext(CppEditor::Constants::C_CPPEDITOR);
m_stopIcon = QIcon(_(":/debugger/images/debugger_stop_small.png"));
m_stopIcon.addFile(":/debugger/images/debugger_stop.png");
m_stopIcon.addFile(__(":/debugger/images/debugger_stop.png"));
m_interruptIcon = QIcon(_(":/debugger/images/debugger_interrupt_small.png"));
m_interruptIcon.addFile(":/debugger/images/debugger_interrupt.png");
m_interruptIcon.addFile(__(":/debugger/images/debugger_interrupt.png"));
m_locationMarkIcon = QIcon(_(":/debugger/images/location_16.png"));
m_busy = false;
......@@ -1133,8 +1133,8 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
this, SLOT(updateWatchersHeader(int,int,int)), Qt::QueuedConnection);
m_actions.continueAction = new QAction(tr("Continue"), this);
QIcon continueIcon = QIcon(":/debugger/images/debugger_continue_small.png");
continueIcon.addFile(":/debugger/images/debugger_continue.png");
QIcon continueIcon = QIcon(__(":/debugger/images/debugger_continue_small.png"));
continueIcon.addFile(__(":/debugger/images/debugger_continue.png"));
m_actions.continueAction->setIcon(continueIcon);
m_actions.continueAction->setProperty(Role, RequestExecContinueRole);
......@@ -1154,17 +1154,17 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
m_actions.nextAction = new QAction(tr("Step Over"), this);
m_actions.nextAction->setProperty(Role, RequestExecNextRole);
m_actions.nextAction->setIcon(
QIcon(":/debugger/images/debugger_stepover_small.png"));
QIcon(__(":/debugger/images/debugger_stepover_small.png")));
m_actions.stepAction = new QAction(tr("Step Into"), this);
m_actions.stepAction->setProperty(Role, RequestExecStepRole);
m_actions.stepAction->setIcon(
QIcon(":/debugger/images/debugger_stepinto_small.png"));
QIcon(__(":/debugger/images/debugger_stepinto_small.png")));
m_actions.stepOutAction = new QAction(tr("Step Out"), this);
m_actions.stepOutAction->setProperty(Role, RequestExecStepOutRole);
m_actions.stepOutAction->setIcon(
QIcon(":/debugger/images/debugger_stepout_small.png"));
QIcon(__(":/debugger/images/debugger_stepout_small.png")));
m_actions.runToLineAction1 = new QAction(tr("Run to Line"), this);
m_actions.runToLineAction1->setProperty(Role, RequestExecRunToLineRole);
......@@ -1194,14 +1194,14 @@ bool DebuggerPluginPrivate::initialize(const QStringList &arguments, QString *er
m_actions.snapshotAction = new QAction(tr("Create Snapshot"), this);
m_actions.snapshotAction->setProperty(Role, RequestCreateSnapshotRole);
m_actions.snapshotAction->setIcon(
QIcon(":/debugger/images/debugger_snapshot_small.png"));
QIcon(__(":/debugger/images/debugger_snapshot_small.png")));
m_actions.reverseDirectionAction =
new QAction(tr("Reverse Direction"), this);
m_actions.reverseDirectionAction->setCheckable(true);
m_actions.reverseDirectionAction->setChecked(false);
m_actions.reverseDirectionAction->setIcon(
QIcon(":/debugger/images/debugger_reversemode_16.png"));
QIcon(__(":/debugger/images/debugger_reversemode_16.png")));
m_actions.reverseDirectionAction->setIconVisibleInMenu(false);
m_actions.frameDownAction =
......
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