aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/texteditor/colorschemeedit.cpp
diff options
context:
space:
mode:
authorhjk <qtc-committer@nokia.com>2012-04-26 14:17:42 +0200
committerhjk <qthjk@ovi.com>2012-05-03 13:11:25 +0200
commitd006ca80a62ba94fbde3d992cf0565fa44f5b8ba (patch)
tree7e35fa19be7d7847fbcae6152bda0776bb589fbd /src/plugins/texteditor/colorschemeedit.cpp
parenta872c91c64893c739ae842fdba1d755e780ad4a5 (diff)
texteditor: use an enum instead of QString as color ids
Change-Id: I658412c18d5ccfe978ec444451c6417ffb18d71c Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
Diffstat (limited to 'src/plugins/texteditor/colorschemeedit.cpp')
-rw-r--r--src/plugins/texteditor/colorschemeedit.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/src/plugins/texteditor/colorschemeedit.cpp b/src/plugins/texteditor/colorschemeedit.cpp
index 695949fc64..45b2839225 100644
--- a/src/plugins/texteditor/colorschemeedit.cpp
+++ b/src/plugins/texteditor/colorschemeedit.cpp
@@ -33,8 +33,6 @@
#include "colorschemeedit.h"
#include "ui_colorschemeedit.h"
-#include "texteditorconstants.h"
-
#include <QAbstractListModel>
#include <QColorDialog>
@@ -104,7 +102,7 @@ public:
if (foreground.isValid())
return foreground;
else
- return m_scheme->formatFor(QLatin1String(TextEditor::Constants::C_TEXT)).foreground();
+ return m_scheme->formatFor(C_TEXT).foreground();
}
case Qt::BackgroundRole: {
QColor background = m_scheme->formatFor(description.id()).background();
@@ -205,7 +203,7 @@ void ColorSchemeEdit::setColorScheme(const ColorScheme &colorScheme)
{
m_scheme = colorScheme;
m_formatsModel->setColorScheme(&m_scheme);
- setItemListBackground(m_scheme.formatFor(QLatin1String(TextEditor::Constants::C_TEXT)).background());
+ setItemListBackground(m_scheme.formatFor(C_TEXT).background());
updateControls();
}
@@ -258,7 +256,7 @@ void ColorSchemeEdit::changeForeColor()
m_ui->eraseForegroundToolButton->setEnabled(true);
foreach (const QModelIndex &index, m_ui->itemList->selectionModel()->selectedRows()) {
- const QString category = m_descriptions[index.row()].id();
+ const TextStyle category = m_descriptions[index.row()].id();
m_scheme.formatFor(category).setForeground(newColor);
m_formatsModel->emitDataChanged(index);
}
@@ -276,7 +274,7 @@ void ColorSchemeEdit::changeBackColor()
m_ui->eraseBackgroundToolButton->setEnabled(true);
foreach (const QModelIndex &index, m_ui->itemList->selectionModel()->selectedRows()) {
- const QString category = m_descriptions[index.row()].id();
+ const TextStyle category = m_descriptions[index.row()].id();
m_scheme.formatFor(category).setBackground(newColor);
m_formatsModel->emitDataChanged(index);
// Synchronize item list background with text background
@@ -294,7 +292,7 @@ void ColorSchemeEdit::eraseBackColor()
m_ui->eraseBackgroundToolButton->setEnabled(false);
foreach (const QModelIndex &index, m_ui->itemList->selectionModel()->selectedRows()) {
- const QString category = m_descriptions[index.row()].id();
+ const TextStyle category = m_descriptions[index.row()].id();
m_scheme.formatFor(category).setBackground(newColor);
m_formatsModel->emitDataChanged(index);
}
@@ -309,7 +307,7 @@ void ColorSchemeEdit::eraseForeColor()
m_ui->eraseForegroundToolButton->setEnabled(false);
foreach (const QModelIndex &index, m_ui->itemList->selectionModel()->selectedRows()) {
- const QString category = m_descriptions[index.row()].id();
+ const TextStyle category = m_descriptions[index.row()].id();
m_scheme.formatFor(category).setForeground(newColor);
m_formatsModel->emitDataChanged(index);
}
@@ -321,7 +319,7 @@ void ColorSchemeEdit::checkCheckBoxes()
return;
foreach (const QModelIndex &index, m_ui->itemList->selectionModel()->selectedRows()) {
- const QString category = m_descriptions[index.row()].id();
+ const TextStyle category = m_descriptions[index.row()].id();
m_scheme.formatFor(category).setBold(m_ui->boldCheckBox->isChecked());
m_scheme.formatFor(category).setItalic(m_ui->italicCheckBox->isChecked());
m_formatsModel->emitDataChanged(index);