Plugins depending on the standardoutputview with no Ui

Andreas Pakulat apaku at gmx.de
Wed Mar 23 01:52:02 UTC 2011


On 22.03.11 23:07:55, Aleix Pol wrote:
> On Tue, Mar 22, 2011 at 2:36 PM, Laszlo Papp <djszapi at archlinux.us> wrote:
> > 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]
> >
> > --
> > KDevelop-devel mailing list
> > KDevelop-devel at kdevelop.org
> > https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-devel
> >
> 
> Hi!
> As I've said at some point in IRC, the problem here is that the
> StandardOutputView plugin requires Ui. I think that we should be able to
> provide some alternative to our current plugin in case we don't have UI. We
> don't have the logic to decide that yet, but I think that shouldn't be very
> hard to make it possible to provide NoUi-only plugins.
> 
> I'm interested in it for my static analysis system (buildtools also require
> StandardOutputView through makebuilder) and I think I can do it quite
> simply.
> Also, having Gluon creator as a kdevplatform user opens the possibility to
> have it used outside KDevelop which is something good I think, mainly
> because their needs will be very close to Plasmate's, which may also benefit
> from this feature.
> 
> Any thoughts against it?

The outputview is not the only problem - at least for the svn plugin.
There are various code-paths that can lead to GUI code being executed so
its _not_ safe, possible or wanted to use those plugins in a non-gui
application. At least for svn, people should simply use the svn C
library or a C++ wrapper on top for their non-gui apps. For other
plugins it might be useful to extract the non-gui code into separate
libs that people can use.

Andreas





More information about the KDevelop-devel mailing list