本文整理汇总了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;
}
}
}
示例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);
}