Fix FileManager to correctly handle multiple IFile's for the same file

And port the Qt4ProjectManager to use that API for synchronization
between editors and the .pro file tree.

Reviewed-By: con
This commit is contained in:
dt
2010-01-22 16:49:57 +01:00
parent 508173b872
commit 75545a2bf0
12 changed files with 265 additions and 195 deletions

View File

@@ -84,8 +84,7 @@ QString ProFileEditorEditable::id() const
ProFileEditor::ProFileEditor(QWidget *parent, ProFileEditorFactory *factory, TextEditor::TextEditorActionHandler *ah)
: BaseTextEditor(parent), m_factory(factory), m_ah(ah)
{
Qt4Manager *manager = factory->qt4ProjectManager();
ProFileDocument *doc = new ProFileDocument(manager);
ProFileDocument *doc = new ProFileDocument();
doc->setMimeType(QLatin1String(Qt4ProjectManager::Constants::PROFILE_MIMETYPE));
setBaseTextDocument(doc);
@@ -126,20 +125,11 @@ void ProFileEditor::setFontSettings(const TextEditor::FontSettings &fs)
// ProFileDocument
//
ProFileDocument::ProFileDocument(Qt4Manager *manager)
: TextEditor::BaseTextDocument(), m_manager(manager)
ProFileDocument::ProFileDocument()
: TextEditor::BaseTextDocument()
{
}
bool ProFileDocument::save(const QString &name)
{
if (BaseTextDocument::save(name)) {
m_manager->notifyChanged(name);
return true;
}
return false;
}
QString ProFileDocument::defaultPath() const
{
QFileInfo fi(fileName());