当前位置: 首页>>代码示例>>C++>>正文


C++ XdgDesktopFile::isShow方法代码示例

本文整理汇总了C++中XdgDesktopFile::isShow方法的典型用法代码示例。如果您正苦于以下问题:C++ XdgDesktopFile::isShow方法的具体用法?C++ XdgDesktopFile::isShow怎么用?C++ XdgDesktopFile::isShow使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XdgDesktopFile的用法示例。


在下文中一共展示了XdgDesktopFile::isShow方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: addDirtoList

/**
 * @brief adds a given dir to the autostartlist
 * @param[in] _dir the directory to search for files
 **/
void XdgAutoStart::addDirtoList(const QString & _dir)
{
    qDebug() << "XdgAutoStart: adding "<<_dir << " to list!";
    //this is probably small so no dir-iterator.. just list them and work the list!
    QDir directory(_dir);

    directory.setNameFilters(QStringList() << "*.desktop"); //filter the .desktop files only
    QStringList filelist = directory.entryList();
    for (int i =0; i < filelist.count(); i++)
    {
        XdgDesktopFile * f = new XdgDesktopFile(_dir+filelist.at(i));
        if (f->isShow())
            m_list.append(f);
        else
        {
            badNames.push_back(f->value("Name").toString()); //this is needed as std says all with the same name get removed by one entry with these flags too
            delete f;
        }
    }
}
开发者ID:Alexandr-Galko,项目名称:razor-qt,代码行数:24,代码来源:xdgautostart.cpp

示例2: updateIconList

void RazorDeskManager::updateIconList()
{
    m_fsw->blockSignals(true);

    qDebug() << "updateIconList";
    QDirIterator dirIter(QDesktopServices::storageLocation(QDesktopServices::DesktopLocation));

    QStringList tmpList;

    while (dirIter.hasNext())
    {
        dirIter.next();
        QString df(dirIter.filePath());

        // HACK: QDir::NoDotAndDotDot does not work so this fixes it...
        if (df.endsWith("/..") || df.endsWith("/."))
            continue;

        qDebug() << df;
        tmpList.append(df);

        // only non existing icons are created
        if (m_iconList.contains(df))
        {
            qDebug() << "updateIconList REREAD. Skip:" << df;
            continue;
        }

        QPoint pos(0, 0);
        RazorDeskIconBase * idata;

        if (dirIter.filePath().endsWith(".desktop")) //only use .desktop files!
        {
            XdgDesktopFile* tmp = new XdgDesktopFile();
            tmp->load(df);

            if (tmp->isShow())
            {
                idata = new RazorDeskIconDesktop(tmp, pos);
            }
            else
            {
                delete tmp;
                qDebug() << "Desktop file" << df << "isShow==false";
                continue;
            }
        }
        else
        {
            idata = new RazorDeskIconFile(df, pos);
        }
        
        idata->setLaunchMode(m_launchMode);

        connect(idata, SIGNAL(moved(QPoint)), this, SLOT(saveIconState()));
        m_iconList[df] = idata;
    }

    // now remove potentialy deleted icons
    IconMapIterator iter(m_iconList);
    while (iter.hasNext())
    {
        iter.next();
        if (tmpList.contains(iter.key()))
            continue;
        delete m_iconList.take(iter.key());
    }

    qDebug() << "Razordeskmanl: found " << m_iconList.count() << " usable desktop-entries";

    restoreIconState();
    m_fsw->blockSignals(false);
}
开发者ID:B-Rich,项目名称:razor-qt,代码行数:73,代码来源:razordeskman.cpp


注:本文中的XdgDesktopFile::isShow方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。