[Ktechlab-devel] kdevplatform and document types

Zoltan Padrah zoltan.padrah at gmail.com
Sun Jul 18 16:53:16 UTC 2010


  Hello,

There is more "fun" with kdevplatform:

The following code:

KDevelop::IDocumentFactory * fact =
m_core->documentController()->factory("application/x-circuit");
qDebug() << "factory = " << fact ;

 KUrl emptyDoc( i18n("Untitled") );
 KDevelop::IDocument *mydoc = fact->create( emptyDoc, m_core);
qDebug() << "document: " << mydoc ;

  qDebug() << "document mime comment: " << mydoc->mimeType()->patterns() ;

IComponentDocument *doc = dynamic_cast<IComponentDocument*>( mydoc );
ISimulator *sim = m_simManager->simulatorForDocument(doc, "transient");

produces the following output:

QDEBUG : KTechLab::AddComponentsTest::addResistor() factory = 0x88d6ba8
QDEBUG : KTechLab::AddComponentsTest::addResistor() document: 0x8ac5298
QDEBUG : KTechLab::AddComponentsTest::addResistor() document mime comment:
("*.bin")
QDEBUG : KTechLab::AddComponentsTest::addResistor() qttest(14918)
KTechLab::SimulationManager::simulatorForDocument: no factory found for
docoument type "application/octet-stream" and simulation type: "transient"

So an empty document created by the circuit factory has the mime-type of
application/octet-stream. This is very bad.

How should we create new circuit documents? Have to check temporary file
with .circuit extension.

  Zoltan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/ktechlab-devel/attachments/20100718/36f2ad6a/attachment.html>


More information about the Ktechlab-devel mailing list