forked from qt-creator/qt-creator
Merge branch 'master' of git@scm.dev.nokia.troll.no:creator/mainline
This commit is contained in:
@@ -49,4 +49,4 @@ public:
|
|||||||
} // namespace Internal
|
} // namespace Internal
|
||||||
} // namespace ExtensionSystem
|
} // namespace ExtensionSystem
|
||||||
|
|
||||||
#endif PLUGINVIEW_P_H
|
#endif // PLUGINVIEW_P_H
|
||||||
|
@@ -1153,7 +1153,7 @@ void EditorManager::updateActions()
|
|||||||
|
|
||||||
m_d->m_duplicateAction->setEnabled(curEditor != 0 && curEditor->duplicateSupported());
|
m_d->m_duplicateAction->setEnabled(curEditor != 0 && curEditor->duplicateSupported());
|
||||||
|
|
||||||
m_d->m_openInExternalEditorAction->setEnabled(curEditor != 0);
|
m_d->m_openInExternalEditorAction->setEnabled(curEditor != 0 && !m_d->m_externalEditor.isEmpty());
|
||||||
}
|
}
|
||||||
|
|
||||||
QList<IEditor*> EditorManager::openedEditors() const
|
QList<IEditor*> EditorManager::openedEditors() const
|
||||||
@@ -1489,6 +1489,9 @@ QString EditorManager::externalEditorHelpText() const
|
|||||||
|
|
||||||
void EditorManager::openInExternalEditor()
|
void EditorManager::openInExternalEditor()
|
||||||
{
|
{
|
||||||
|
if (m_d->m_externalEditor.isEmpty())
|
||||||
|
return;
|
||||||
|
|
||||||
IEditor *editor = currentEditor();
|
IEditor *editor = currentEditor();
|
||||||
if (!editor)
|
if (!editor)
|
||||||
return;
|
return;
|
||||||
@@ -1500,7 +1503,6 @@ void EditorManager::openInExternalEditor()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QRect rect = editor->widget()->rect();
|
QRect rect = editor->widget()->rect();
|
||||||
QFont font = editor->widget()->font();
|
QFont font = editor->widget()->font();
|
||||||
QFontMetrics fm(font);
|
QFontMetrics fm(font);
|
||||||
|
@@ -515,8 +515,7 @@ void pp::operator()(const QByteArray &source, QByteArray *result)
|
|||||||
while (true) {
|
while (true) {
|
||||||
if (env.currentLine != _dot->lineno) {
|
if (env.currentLine != _dot->lineno) {
|
||||||
if (env.currentLine > _dot->lineno) {
|
if (env.currentLine > _dot->lineno) {
|
||||||
result->append('\n');
|
result->append("\n# ");
|
||||||
result->append('#');
|
|
||||||
result->append(QByteArray::number(_dot->lineno));
|
result->append(QByteArray::number(_dot->lineno));
|
||||||
result->append(' ');
|
result->append(' ');
|
||||||
result->append('"');
|
result->append('"');
|
||||||
@@ -564,16 +563,6 @@ void pp::operator()(const QByteArray &source, QByteArray *result)
|
|||||||
} else {
|
} else {
|
||||||
if (_dot->joined)
|
if (_dot->joined)
|
||||||
result->append("\\\n");
|
result->append("\\\n");
|
||||||
else if (_dot->newline) {
|
|
||||||
result->append('\n');
|
|
||||||
result->append('#');
|
|
||||||
result->append(QByteArray::number(_dot->lineno));
|
|
||||||
result->append(' ');
|
|
||||||
result->append('"');
|
|
||||||
result->append(env.current_file);
|
|
||||||
result->append('"');
|
|
||||||
result->append('\n');
|
|
||||||
}
|
|
||||||
else if (_dot->whitespace)
|
else if (_dot->whitespace)
|
||||||
result->append(' ');
|
result->append(' ');
|
||||||
|
|
||||||
@@ -861,11 +850,14 @@ void pp::processDefine(TokenIterator firstToken, TokenIterator lastToken)
|
|||||||
if (isQtWord)
|
if (isQtWord)
|
||||||
macro.definition = macroId;
|
macro.definition = macroId;
|
||||||
else {
|
else {
|
||||||
|
// ### make me fast!
|
||||||
const char *startOfDefinition = startOfToken(*tk);
|
const char *startOfDefinition = startOfToken(*tk);
|
||||||
const char *endOfDefinition = startOfToken(*lastToken);
|
const char *endOfDefinition = startOfToken(*lastToken);
|
||||||
macro.definition.append(startOfDefinition,
|
macro.definition.append(startOfDefinition,
|
||||||
endOfDefinition - startOfDefinition);
|
endOfDefinition - startOfDefinition);
|
||||||
macro.definition.replace("\\\n", " ");
|
macro.definition.replace("\\\n", " ");
|
||||||
|
macro.definition.replace('\n', ' ');
|
||||||
|
macro.definition = macro.definition.trimmed();
|
||||||
}
|
}
|
||||||
|
|
||||||
env.bind(macro);
|
env.bind(macro);
|
||||||
|
@@ -69,8 +69,7 @@ const char *MacroExpander::operator () (const char *__first, const char *__last,
|
|||||||
{
|
{
|
||||||
if (*__first == '\n')
|
if (*__first == '\n')
|
||||||
{
|
{
|
||||||
__result->append('\n');
|
__result->append("\n# ");
|
||||||
__result->append('#');
|
|
||||||
__result->append(QByteArray::number(env.currentLine));
|
__result->append(QByteArray::number(env.currentLine));
|
||||||
__result->append(' ');
|
__result->append(' ');
|
||||||
__result->append('"');
|
__result->append('"');
|
||||||
|
Reference in New Issue
Block a user