打印

帮忙看下这段代码

帮忙看下这段代码

KPropertiesDialog* KonqPopupMenu::showPropertiesDialog()
{
    // It may be that the kfileitem was created by hand
    // (see KonqKfmIconView::slotMouseButtonPressed)
    // In that case, we can get more precise info in the properties
    // (like permissions) if we stat the URL.
    if ( m_lstItems.count() == 1 )
    {
        KFileItem * item = m_lstItems.first();
        if (item->entry().count() == 0) // this item wasn't listed by a slave
        {
            // KPropertiesDialog will use stat to get more info on the file
            return new KPropertiesDialog( item->url(), d->m_parentWidget );
        }
    }
    return new KPropertiesDialog( m_lstItems, d->m_parentWidget );
这段代码是fc5kdebase里的,功能就右键菜单的“属性”,现在我想改下,就是把我指定的桌面.desktop文件的“属性”功能改成其他的,
KPropertiesDialog* KonqPopupMenu::showPropertiesDialog()

        if (        )
   {
     system ("/usr/bin/sysinfo");
   }
   else eturn new KPropertiesDialog( m_lstItems, d->m_parentWidget );

我想在if中判断是否是我指定的.desktop文件,但是不知道怎么判断,请大家帮帮我,谢谢
天堂就在地狱的对岸

TOP

[code:1] KFileItem * item = m_lstItems.first(); [/code:1]
里的m_lstItems,应该是一个成员变量,你可以看看,它应该提供了一些信息可以让你操作每一个菜单项,当然也包括当前菜单,之后再得到菜单项对应的.desktop文件,应该没问题。一切只是猜测,因为没看到过其他代码。
因为我是程序员,所以不能容忍任何严重的BUG! 很好看的韩剧:《你来自哪颗星》,《去海边吧》,《最后的舞请与我一起》 看贴的能不能给留个言啊!~~~~

TOP