Adding additional IOutputViewModel

Andreas Pakulat apaku at gmx.de
Mon Jun 11 19:59:05 UTC 2007


On 11.06.07 15:21:14, dukju ahn wrote:
> You are right. We use IOutputViewModel. We don't need OutputViewModel.

Would you please put the IOutputViewModel into a separate header and
implementation. Its not obvious that the interface that is needed is
inside the outputmodel header. Also not all plugins may want to use the
standard outputmodel...

> I attatched real working code patch. I didn't commit yet because it assumes
> that there's only one view, and current tab is an active one, the temporary
> assumptions that will be addressed eventually.

I think you can commit this (unless it doesn't compile), after fixing
the following things (the move mentioned above). I'll add the toolbutton
for now to make the activation thing work afterwards.

> -void OutputWidget::slotCurrentChanged( int /*index*/ )
> +void OutputWidget::selectNextItem()
>  {
> +    // TODO tab selection !!
>      QWidget* widget = currentWidget();
>      if( !widget )
>          return;
> -    if( m_widgetMap.contains( widget ) )
> +    QListView *listview = dynamic_cast<QListView*>(widget);

Do you actually need a QListView here? If a QAbstractItemView* is
sufficient please use that, then its easier to change from QListView to
something different if need arises.

> +    action = actionCollection()->addAction("next_error");
> +    action->setText("Next Error");
> +    action->setShortcut( QKeySequence(Qt::Key_F4) );
> +    connect(action, SIGNAL(triggered(bool)), this, SIGNAL(selectNextItem()));

Hmm, this is not good at all. Its not always an "error", for example in
grepview, its rather result. Maybe we only have "Next" here for now and
then see if that works.

Andreas

-- 
Beware the one behind you.




More information about the KDevelop-devel mailing list