QStringList * zEmotIcons::getSmilePackList() { QStringList * list = new QStringList(); QDir dir ( ProgDir+"smile/", "", QDir::Name | QDir::DirsFirst | QDir::IgnoreCase ); #ifdef OLD_SDK dir.setMatchAllDirs ( true ); #endif dir.setFilter ( QDir::Dirs ); if ( !dir.isReadable() ) return list; QStringList entries = dir.entryList(); for ( QStringList::ConstIterator it = entries.begin(); it != entries.end(); it++ ) if ( (*it)[0] != "." ) list->append(*it); return list; }
static void lookForDefinitions( const QString& dir, const QString& filter, MetaTranslator* tor, fetchFunctor fetchtr ) { QDir d ( dir ); d.setFilter( QDir::Dirs | QDir::Files | QDir::Hidden | QDir::NoSymLinks ); d.setNameFilter( filter ); d.setSorting( QDir::Name ); d.setMatchAllDirs( true ); const QFileInfoList *list = d.entryInfoList(); QFileInfoListIterator it( *list ); QFileInfo *fi; for ( ; ( fi = it.current() ) != 0; ++it ) { // skip "." and ".." dir if ( fi->isDir() && ( fi->fileName() == "." || fi->fileName() == ".." ) ) continue; else if ( fi->isDir() ) lookForDefinitions( d.absPath() + "/" + fi->fileName(), filter, tor, fetchtr ); else { fetchtr( dir + "/" + fi->fileName(), tor, 0, true ); } } }
void ZFileOpenDialog::CargarBrowser(QString direccion) { browser->clear(); QDir dir ( direccion, "*" ); sPath = direccion; dir.setMatchAllDirs ( true ); dir.setFilter ( QDir::Dirs | QDir::Hidden ); if ( !dir.isReadable() ) return; QStringList entries = dir.entryList(); entries.sort(); QStringList::ConstIterator it = entries.begin(); QPixmap pixmap; if ( (sPath != "") && (sPath != "/") && (sPath != "//") ) { pixmap=QPixmap( iconReader2.getIcon("gen_back_to_arrw_thb", false) ); if ( pixmap.height() > 19 ) { QImage image; image = pixmap.convertToImage(); image = image.smoothScale( 19, 19 ); pixmap.convertFromImage(image); } ZListBoxItem* Item; Item = new ZListBoxItem ( browser, QString ( "%I%M" ) ); Item->setPixmap ( 0, pixmap ); Item->appendSubItem ( 1, "..", false, NULL ); browser->insertItem ( Item,-1,true ); } while ( it != entries.end() ) { if ( ( *it != "." ) && ( *it != ".." ) ) { pixmap=QPixmap( iconReader2.getIcon("fm_folder_small", false) ); if ( pixmap.height() > 19 ) { QImage image; image = pixmap.convertToImage(); image = image.smoothScale( 19, 19 ); pixmap.convertFromImage(image); } ZListBoxItem* Item; Item = new ZListBoxItem ( browser, QString ( "%I%M" ) ); Item->setPixmap ( 0, pixmap ); Item->appendSubItem ( 1, *it, false, NULL ); browser->insertItem ( Item,-1,true ); } ++it; } dir.setFilter ( QDir::Files | QDir::Hidden ); entries = dir.entryList(); entries.sort(); it = entries.begin(); while ( it != entries.end() ) { pixmap=QPixmap( iconReader2.getIcon("msg_receipt_request_small", false) ); if ( pixmap.height() > 19 ) { QImage image; image = pixmap.convertToImage(); image = image.smoothScale( 19, 19 ); pixmap.convertFromImage(image); } ZListBoxItem* Item; Item = new ZListBoxItem ( browser, QString ( "%I%M" ) ); Item->setPixmap ( 0, pixmap ); Item->appendSubItem ( 1, *it, false, NULL ); browser->insertItem ( Item,-1,true ); ++it; } }