Generic highlighter: Notify editors when mime type registration is done.

Now it is no longer necessary to close the editor for the highlighting to take effect.
This commit is contained in:
Leandro Melo
2010-08-18 15:33:52 +02:00
parent 368d982691
commit 1fc7151909
4 changed files with 9 additions and 3 deletions

View File

@@ -236,6 +236,8 @@ void Manager::registerMimeTypesFinished()
if (m_queuedMimeTypeRegistrations > 0) {
--m_queuedMimeTypeRegistrations;
registerMimeTypes();
} else {
emit mimeTypesRegistered();
}
}

View File

@@ -88,6 +88,9 @@ private slots:
void downloadAvailableDefinitionsListFinished();
void downloadDefinitionsFinished();
signals:
void mimeTypesRegistered();
private:
Manager();
Q_DISABLE_COPY(Manager)

View File

@@ -74,7 +74,8 @@ PlainTextEditor::PlainTextEditor(QWidget *parent)
m_commentDefinition.clearCommentStyles();
connect(file(), SIGNAL(changed()), this, SLOT(fileChanged()));
connect(file(), SIGNAL(changed()), this, SLOT(configure()));
connect(Manager::instance(), SIGNAL(mimeTypesRegistered()), this, SLOT(configure()));
}
PlainTextEditor::~PlainTextEditor()
@@ -161,7 +162,7 @@ void PlainTextEditor::setTabSettings(const TextEditor::TabSettings &ts)
}
}
void PlainTextEditor::fileChanged()
void PlainTextEditor::configure()
{
configure(Core::ICore::instance()->mimeDatabase()->findByFile(file()->fileName()));
}

View File

@@ -79,7 +79,7 @@ public slots:
virtual void setTabSettings(const TextEditor::TabSettings &);
private slots:
void fileChanged();
void configure();
protected:
virtual BaseTextEditorEditable *createEditableInterface() { return new PlainTextEditorEditable(this); }