[Kde-bindings] KFileTreeView and Korundum

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Dec 16 14:37:01 UTC 2005


On Friday 16 December 2005 13:36, Diego 'Flameeyes' Pettenò wrote:
> On Thursday 15 December 2005 22:29, Richard Dale wrote:
> > Ah wow, a KDevelop Korundum ruby project out there in the wild! I updated
> > my playground/utils, opened the project, hit the run button and whack!
> > there the app was. No messing around compiling or whatever.
>
> Yep, makes way quicker to test things ;)
> This makes Korundum suitable also to prepare semi-working mockups for more
> complex projects, before implementing the final ui.
Or you can build the top level C++ stub and install it as a normal KDE app. 
Just a shame it doesn't actually work with your app yet :(..

> > But the animation doesn't stop, and it does crash for me with the same
> > error - so I'll have a look at it...
>
> I've rebuilt ruby, qt, smoke, qtruby and korundum with debug info (long
> life split debug :P) and have a more interesting backtrace (while it does
> not carry all the locals as it's still optimized).
> It's at http://dev.gentoo.org/~flameeyes/kdigest-crash-backtrace.bz2 (11K
> compressed).
I've been looking at it. What seems to happen is the KFileTreeBranch emits the 
signal 'populateFinished(KFileTreeViewItem*)' which is supposed to be 
connected to 'slotPopulateFinished(KFileTreeViewItem*)', but the slot is 
never called.

In kfiletreebranch.cpp:

void KFileTreeBranch::slCompleted( const KURL& url )
{
    kdDebug(250) << "SlotCompleted hit for " << url.prettyURL() << endl;
    KFileTreeViewItem *currParent = findTVIByURL( url );
    if( ! currParent ) return;

    kdDebug(250) << "current parent " << currParent << " is already listed: "
                 << currParent->alreadyListed() << endl;

    emit( populateFinished(currParent));
    emit( directoryChildCount(currParent, currParent->childCount()));

In kfiletreeview.cpp:

KFileTreeBranch *KFileTreeView::addBranch(KFileTreeBranch *newBranch)
{
   connect( newBranch, SIGNAL(populateFinished( KFileTreeViewItem* )),
            this, SLOT( slotPopulateFinished( KFileTreeViewItem* )));

   connect( newBranch, SIGNAL( newTreeViewItems( KFileTreeBranch*,
                               const KFileTreeViewItemList& )),
            this, SLOT( slotNewTreeViewItems( KFileTreeBranch*,
                        const KFileTreeViewItemList& )));

   m_branches.append( newBranch );
   return( newBranch );
}

...

void KFileTreeView::slotPopulateFinished( KFileTreeViewItem *it )
{
   kdDebug(250) << "KFileTreeView::slotPopulateFinished" << endl;
   if( it && it->isDir())
    stopAnimation( it );
}

So the stopAnimation() method is never called. When I try and run it under the 
KDevelop debugger it crashes pretty much straight away, and so I haven't been 
able to examine the state of the slot/signal connections.

I've improved the qt_invoke code in qtruby Qt.cpp source anyway, so at least 
it will be more efficient - I'll check that change in. But for the 
'slotPopulateFinished()' in never gets called in qt_invoke() in Kdigest.

-- Richard



More information about the Kde-bindings mailing list