CppEditor: Compile with QT_NO_CAST_FROM_ASCII.

- Avoid unnecessary conversions
- Add missing tr().

Change-Id: I3c0dd627a3621929c9c6fc71db6924fa513e34a7
Reviewed-by: Leandro Melo <leandro.melo@nokia.com>
This commit is contained in:
Friedemann Kleint
2012-01-11 14:26:09 +01:00
parent 9e8f935a03
commit 9128fc2ab0
9 changed files with 129 additions and 89 deletions

View File

@@ -586,7 +586,7 @@ CppModelManagerInterface *CPPEditorWidget::modelManager() const
void CPPEditorWidget::setMimeType(const QString &mt)
{
BaseTextEditorWidget::setMimeType(mt);
setObjCEnabled(mt == CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE);
setObjCEnabled(mt == QLatin1String(CppTools::Constants::OBJECTIVE_CPP_SOURCE_MIMETYPE));
}
void CPPEditorWidget::setObjCEnabled(bool onoff)
@@ -1546,7 +1546,7 @@ void CPPEditorWidget::contextMenuEvent(QContextMenuEvent *e)
foreach (QAction *action, contextMenu->actions()) {
menu->addAction(action);
if (action->objectName() == Constants::M_REFACTORING_MENU_INSERTION_POINT)
if (action->objectName() == QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT))
menu->addMenu(quickFixMenu);
}
@@ -2271,10 +2271,10 @@ bool CPPEditorWidget::handleDocumentationComment(QKeyEvent *e)
if (m_commentsSettings.m_enableDoxygen
&& cursor.positionInBlock() >= 3) {
const int pos = cursor.position();
if (characterAt(pos - 3) == QChar('/')
&& characterAt(pos - 2) == QChar('*')
&& (characterAt(pos - 1) == QChar('*')
|| characterAt(pos - 1) == QChar('!'))) {
if (characterAt(pos - 3) == QLatin1Char('/')
&& characterAt(pos - 2) == QLatin1Char('*')
&& (characterAt(pos - 1) == QLatin1Char('*')
|| characterAt(pos - 1) == QLatin1Char('!'))) {
CppTools::DoxygenGenerator doxygen;
doxygen.setAddLeadingAsterisks(m_commentsSettings.m_leadingAsterisks);
doxygen.setGenerateBrief(m_commentsSettings.m_generateBrief);