Plugins depending on the standardoutputview with no Ui
Laszlo Papp
djszapi at archlinux.us
Tue Mar 22 13:36:38 UTC 2011
Hi,
I have tackling an issue to get the VCS plugins in my standalone.
pluginManager->allPluginsForExtension(
"org.kdevelop.IBasicVersionControl" ).count() returns zero in case a
KDevelop::Core::NoUi, but 3 (git,svn,cvs) in case
KDevelop::Core::Default.
You might need a different way to provide output in the NoUi case. The
problem is that I do not really need Ui in my application, thus it
would be nice to have it fixed. :)
Thank you in advance!
Best Regards,
Laszlo Papp
-----------
[pseudocode]
....
"Includes"
...
class ConsoleIDEExtension : public KDevelop::ShellExtension
{
public:
static void init() { s_instance = new ConsoleIDEExtension(); }
virtual QString xmlFile() { return QString(); }
virtual QString binaryPath() { return QString(); };
virtual QString defaultProfile() { return QString(); }
virtual KDevelop::AreaParams defaultArea(){
KDevelop::AreaParams params = {"code", i18n("Code")};
return params;
}
virtual QString projectFileExtension() { return QString(); }
virtual QString projectFileDescription() { return QString(); }
virtual QStringList defaultPlugins() { return QStringList(); }
protected:
ConsoleIDEExtension() {}
};
...
void VcsTool::loadVersionControlPlugin(KConfigGroup& projectGroup)
{
ConsoleIDEExtension::init();
KDevelop::Core::initialize(0, KDevelop::Core::NoUi);
KDevelop::IPluginController* pluginManager =
KDevelop::Core::self()->pluginController();
qDebug() << "TESTPOINT1:" << pluginManager->allPluginsForExtension(
"org.kdevelop.IBasicVersionControl" ).count();
foreach( KDevelop::IPlugin* p,
pluginManager->allPluginsForExtension(
"org.kdevelop.IBasicVersionControl" ) )
{
KDevelop::IBasicVersionControl* iface =
p->extension<KDevelop::IBasicVersionControl>();
if( iface && iface->isVersionControlled(
GluonEngine::Game::instance()->gameProject()->dirname().toLocalFile()
) )
{
m_vcsPlugin = p;
projectGroup.writeEntry("VersionControlSupport",
pluginManager->pluginInfo( p ).pluginName() );
projectGroup.sync();
}
}
}
[/pseudocode]
More information about the KDevelop-devel
mailing list