forked from qt-creator/qt-creator
Merge remote-tracking branch 'origin/4.6'
Conflicts: qtcreator.pri Change-Id: I7dcd8e067b7597144eb3b27d917cb7fe0279aad4
This commit is contained in:
@@ -61,7 +61,7 @@ namespace Internal {
|
||||
// CMakeEditor
|
||||
//
|
||||
|
||||
QString CMakeEditor::contextHelpId() const
|
||||
void CMakeEditor::contextHelpId(const HelpIdCallback &callback) const
|
||||
{
|
||||
int pos = position();
|
||||
|
||||
@@ -71,8 +71,10 @@ QString CMakeEditor::contextHelpId() const
|
||||
if (pos < 0)
|
||||
break;
|
||||
chr = characterAt(pos);
|
||||
if (chr == QLatin1Char('('))
|
||||
return QString();
|
||||
if (chr == QLatin1Char('(')) {
|
||||
callback(QString());
|
||||
return;
|
||||
}
|
||||
} while (chr.unicode() != QChar::ParagraphSeparator);
|
||||
|
||||
++pos;
|
||||
@@ -95,11 +97,13 @@ QString CMakeEditor::contextHelpId() const
|
||||
}
|
||||
|
||||
// Not a command
|
||||
if (chr != QLatin1Char('('))
|
||||
return QString();
|
||||
if (chr != QLatin1Char('(')) {
|
||||
callback(QString());
|
||||
return;
|
||||
}
|
||||
|
||||
QString command = textAt(begin, end - begin).toLower();
|
||||
return QLatin1String("command/") + command;
|
||||
callback(QLatin1String("command/") + command);
|
||||
}
|
||||
|
||||
//
|
||||
|
||||
@@ -38,7 +38,7 @@ class CMakeEditor : public TextEditor::BaseTextEditor
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
QString contextHelpId() const override;
|
||||
void contextHelpId(const HelpIdCallback &callback) const override;
|
||||
|
||||
friend class CMakeEditorWidget;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user