[KDev4] VCS interfaces draft

dukju ahn dukjuahn at gmail.com
Fri Mar 23 12:52:56 UTC 2007


>>> One question is that I don't know to which directory this file should
>>> go. Other than that, everything seems to be straightforward.
>> I'd say lib/interfaces

>Uhm, you sure? Until now it doesn't contain any extension interfaces, so
>I guess its rather plugins/vcs/interfaces (and later have vcs/cvs and
>vcs/svn with the 2 default implementations).

But that's strange. To my understanding so far, extention interface
header files(*.h) should be included at some other components.
For example, ioutputview.h is included in qmakebuilder.cpp
Then the build system should keep track of every dispersed
directories where extention interfaces reside.
Why don't we consolidate every extentions into one directory?
lib/interfaces or lib/extentions seem to be good

Also for Alexander's comment

>From more major modifications, I'd say that the interface is not enough.
>What if we have more methods in IVersionControl? Something
>along these lines:

>bool commit(KUrl::List &);
>bool add(KUrl::List &);
>bool remove(KUrl::List &);
>....
>etc.

I don't feel the need of these user-invoked action interfaces.
The only case these commit/add actions start is via menubar or context
menu. I personaly think that these context menu should be filled out
by each plugin. So other component can forget about other actions.
Rather, IVersionControl::fillContextMenu(KUrl&, QMenu&) seems
to be appropriate.

for example, in my working copy

void ProjectTreeView::popupContextMenu( const QPoint &pos )

{
    QModelIndex index = indexAt( pos );

    if ( ProjectBaseItem *item = projectModel()->item( index ) )
    {
        KMenu menu( this );

        IPlugin* vcsIface = d->m_part->core()->pluginController()->
            pluginForExtension("IVersionControl");
        KDevelop::IVersionControl* vctrl;
        if( vcsIface )
            vctrl= vcsIface->extension<KDevelop::IVersionControl>();

        if ( ProjectFolderItem *folder = item->folder() )
        {
            menu.addTitle( i18n( "Folder: %1", folder->url().directory() ) );
            if( vctrl )
                vctrl->fillContextMenu( folder->url(), menu );
        }
        else if ( ProjectFileItem *file = item->file() )
        {
            menu.addTitle( i18n( "File: %1", file->url().fileName() ) );
            if( vctrl )
                vctrl->fillContextMenu( file->url(), menu );
        }
        else if ( ProjectTargetItem *target = item->target() )
        {
            menu.addTitle( i18n( "Target: %1", target->text() ) );
        }
        menu.exec( mapToGlobal( pos ) );
    }
}

so let's clearify it!
Other than these, I applied all the member's comments.




More information about the KDevelop-devel mailing list