QQ登录

只需一步,快速开始

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 1073|回复: 1

帮忙看下这段代码

[复制链接]
发表于 2006-9-28 09:00:05 | 显示全部楼层 |阅读模式
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文件,但是不知道怎么判断,请大家帮帮我,谢谢
发表于 2006-9-29 12:55:42 | 显示全部楼层
[code:1] KFileItem * item = m_lstItems.first(); [/code:1]
里的m_lstItems,应该是一个成员变量,你可以看看,它应该提供了一些信息可以让你操作每一个菜单项,当然也包括当前菜单,之后再得到菜单项对应的.desktop文件,应该没问题。一切只是猜测,因为没看到过其他代码。
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

GMT+8, 2024-5-2 00:11 , Processed in 0.067791 second(s), 15 queries .

© 2021 Powered by Discuz! X3.5.

快速回复 返回顶部 返回列表