本文整理汇总了C++中kurl::List::count方法的典型用法代码示例。如果您正苦于以下问题:C++ List::count方法的具体用法?C++ List::count怎么用?C++ List::count使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kurl::List
的用法示例。
在下文中一共展示了List::count方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotInsertFolderAfterCopying
void ProjectNewLocal::slotInsertFolderAfterCopying(const KURL::List& a_urlList)
{
KURL::List::ConstIterator it;
KURL dirURL;
for (it = a_urlList.begin(); it != a_urlList.end(); ++it)
{
dirURL = *it;
// dirURL.adjustPath(1);
KURL::List files = QExtFileInfo::allFilesRelative(dirURL, "*", this, false);
progressBar->setTotalSteps(files.count() - 1);
progressBar->setTextEnabled(true);
KURL u;
for (uint i = 0; i < files.count(); i++)
{
u = files[i];
if ( !fileList.contains(u) && u.path() != "." && u.path() != ".." )
{
fileList.append(u);
listView->addItem(u, KFileItem(KFileItem::Unknown, KFileItem::Unknown, KURL()));
QListViewItem *it = listView->itemByUrl(u);
if (it)
{
it->setSelected(true);
listView->slotSelectFile(it);
}
progressBar->setValue(i);
}
}
//listView->selectAll(false);
progressBar->setTotalSteps(1);
progressBar->setValue(0);
progressBar->setTextEnabled(false);
}
}
示例2: slotAddFiles
/** No descriptions */
void ProjectNewLocal::slotAddFiles()
{
QExtFileInfo::createDir(baseURL, this);
KURL::List list = KFileDialog::getOpenURLs(
baseURL.url(), i18n("*"), this, i18n("Insert Files in Project"));
if ( !list.isEmpty() )
{
KURL u = list.first();
u = QExtFileInfo::toRelative( u, baseURL, false );
if ( u.path().startsWith("..") || u.path().startsWith("/"))
{
KURLRequesterDlg *urlRequesterDlg = new KURLRequesterDlg( baseURL.prettyURL(), this, "");
urlRequesterDlg->setCaption(i18n("Files: Copy to Project"));
urlRequesterDlg->urlRequester()->setMode( KFile::Directory | KFile::ExistingOnly);
urlRequesterDlg->exec();
KURL destination = urlRequesterDlg->selectedURL();
delete urlRequesterDlg;
if ( !destination.isEmpty())
{
CopyTo *dlg = new CopyTo( baseURL);
connect(dlg, SIGNAL(addFilesToProject(const KURL::List&)),
SLOT (slotInsertFilesAfterCopying(const KURL::List&)));
connect(dlg, SIGNAL(deleteDialog(CopyTo *)),
SLOT (slotDeleteCopyToDialog(CopyTo *)));
list = dlg->copy( list, destination );
return;
} else
{
return;
}
}
progressBar->setTotalSteps(list.count() - 1);
progressBar->setTextEnabled(true);
for (uint i = 0; i < list.count(); i++)
{
list[i] = QExtFileInfo::toRelative(list[i], baseURL, false);
if (!fileList.contains(list[i]))
{
fileList.append(list[i]);
QListViewItem *it = listView->addItem(list[i], KFileItem(KFileItem::Unknown, KFileItem::Unknown, KURL()));
if (it) it->setSelected(true);
progressBar->setValue(i);
}
}
progressBar->setTotalSteps(1);
progressBar->setValue(0);
progressBar->setTextEnabled(false);
}
}
示例3: dump
void URLUtil::dump( const KURL::List &urls, const QString &aMessage )
{
if (!aMessage.isNull())
{
kdDebug(9000) << aMessage << endl;
}
kdDebug(9000) << " List has " << urls.count() << " elements." << endl;
for (size_t i = 0; i<urls.count(); ++i)
{
KURL url = urls[ i ];
// kdDebug(9000) << " * Element = " << url.path() << endl;
}
}
示例4: selectedItems
TQDragObject * KfindWindow::dragObject()
{
KURL::List uris;
TQPtrList<TQListViewItem> selected = selectedItems();
// create a list of URIs from selection
for ( uint i = 0; i < selected.count(); i++ )
{
KfFileLVI *item = (KfFileLVI *) selected.at( i );
if (item)
{
uris.append( item->fileitem.url() );
}
}
if ( uris.count() <= 0 )
return 0;
TQUriDrag *ud = new KURLDrag( uris, (TQWidget *) this, "kfind uridrag" );
const TQPixmap *pix = currentItem()->pixmap(0);
if ( pix && !pix->isNull() )
ud->setPixmap( *pix );
return ud;
}
示例5: add
void SaverConfig::add()
{
KURL::List files = KFileDialog::getOpenURLs( TQString(), TQString(),
this, i18n("Select Media Files") );
for( unsigned int n=0; n<files.count(); n++ )
m_files->insertItem( files[n].prettyURL(), -1 );
}
示例6: slotInsertFilesAfterCopying
void ProjectNewLocal::slotInsertFilesAfterCopying(const KURL::List& a_urlList)
{
KURL::List::ConstIterator it;
KURL u;
progressBar->setTotalSteps(a_urlList.count() - 1);
progressBar->setTextEnabled(true);
for (it = a_urlList.begin(); it != a_urlList.end(); ++it)
{
u = QExtFileInfo::toRelative(*it, baseURL, false);
if ( !fileList.contains(u))
{
fileList.append(u);
QListViewItem *it = listView->addItem(u, KFileItem(KFileItem::Unknown, KFileItem::Unknown, KURL()));
if (it)
{
it->setSelected(true);
listView->slotSelectFile(it);
}
progressBar->advance(1);
}
}
progressBar->setTotalSteps(1);
progressBar->setValue(0);
progressBar->setTextEnabled(false);
}
示例7: KURL
KURL *decodeImgDrop(QDropEvent *e, QWidget *wdg)
{
KURL::List uris;
if (KURLDrag::decode(e, uris) && (uris.count() > 0)) {
KURL *url = new KURL(uris.first());
KImageIO::registerFormats();
if( KImageIO::canRead(KImageIO::type(url->fileName())) )
return url;
QStringList qs = QStringList::split('\n', KImageIO::pattern());
qs.remove(qs.begin());
QString msg = i18n( "%1 "
"does not appear to be an image file.\n"
"Please use files with these extensions:\n"
"%2")
.arg(url->fileName())
.arg(qs.join("\n"));
KMessageBox::sorry( wdg, msg);
delete url;
}
return 0;
}
示例8: giveMeTreeFor
void
RadialMap::Widget::dropEvent( QDropEvent *e )
{
DEBUG_ANNOUNCE
KURL::List urls;
if (KURLDrag::decode( e, urls ) && urls.count())
emit giveMeTreeFor( urls.first() );
}
示例9: dlg
int K3bDataUrlAddingDialog::addUrls( const KURL::List& urls,
K3bDirItem* dir,
QWidget* parent )
{
if( urls.isEmpty() )
return 0;
//
// A common mistake by beginners is to try to burn an iso image
// with a data project. Let's warn them
//
if( urls.count() == 1 ) {
K3bIso9660 isoF( urls.first().path() );
if( isoF.open() ) {
if( KMessageBox::warningYesNo( parent,
i18n("<p>The file you are about to add to the project is an ISO9660 image. As such "
"it can be burned to a medium directly since it already contains a file "
"system.<br>"
"Are you sure you want to add this file to the project?"),
i18n("Adding image file to project"),
i18n("Add the file to the project"),
i18n("Burn the image directly") ) == KMessageBox::No ) {
// very rough dvd image size test
if( K3b::filesize( urls.first() ) > 1000*1024*1024 )
k3bappcore->k3bMainWindow()->slotWriteDvdIsoImage( urls.first() );
else
k3bappcore->k3bMainWindow()->slotWriteCdImage( urls.first() );
return 0;
}
}
}
K3bDataUrlAddingDialog dlg( dir->doc(), parent );
dlg.m_urls = urls;
for( KURL::List::ConstIterator it = urls.begin(); it != urls.end(); ++it )
dlg.m_urlQueue.append( qMakePair( K3b::convertToLocalUrl(*it), dir ) );
dlg.slotAddUrls();
int ret = QDialog::Accepted;
if( !dlg.m_urlQueue.isEmpty() ) {
dlg.m_dirSizeJob->setUrls( urls );
dlg.m_dirSizeJob->setFollowSymlinks( dir->doc()->isoOptions().followSymbolicLinks() );
dlg.m_dirSizeJob->start();
ret = dlg.exec();
}
// make sure the dir size job is finished
dlg.m_dirSizeJob->cancel();
K3bSignalWaiter::waitForJob( dlg.m_dirSizeJob );
QString message = dlg.resultMessage();
if( !message.isEmpty() )
KMessageBox::detailedSorry( parent, i18n("Problems while adding files to the project."), message );
return ret;
}
示例10: switch
inline void
FSBrowser::contextMenuActivated( int id )
{
switch( id )
{
case MakePlaylist:
Playlist::instance()->insertMedia( selectedItems(), Playlist::Replace );
break;
case SavePlaylist:
playlistFromURLs( selectedItems() );
break;
case AppendToPlaylist:
Playlist::instance()->insertMedia( selectedItems() );
break;
case EditTags:
{
KURL::List list = selectedItems();
TagDialog *dialog = NULL;
if( list.count() == 1 )
{
dialog = new TagDialog( list.first(), this );
}
else
{
dialog = new TagDialog( list, this );
}
dialog->show();
}
break;
case CopyToCollection:
CollectionView::instance()->organizeFiles( selectedItems(), i18n( "Copy Files To Collection" ), true );
break;
case MoveToCollection:
CollectionView::instance()->organizeFiles( selectedItems(), i18n( "Move Files To Collection" ), false );
break;
case CopyMediaDevice:
MediaBrowser::queue()->addURLs( selectedItems() );
break;
case SelectAllFiles:
selectAll();
break;
case BurnCd:
K3bExporter::instance()->exportTracks( selectedItems() );
break;
}
}
示例11: toRelativePaths
QStringList URLUtil::toRelativePaths( const QString &baseDir, const KURL::List &urls)
{
QStringList paths;
for (size_t i=0; i<urls.count(); ++i)
{
paths << extractPathNameRelative( baseDir, urls[i] );
}
return paths;
}
示例12: dropEvent
void BGMonitor::dropEvent(QDropEvent *e)
{
if (!KURLDrag::canDecode(e))
return;
KURL::List uris;
if (KURLDrag::decode(e, uris) && (uris.count() > 0)) {
// TODO: Download remote file
if (uris.first().isLocalFile())
emit imageDropped(uris.first().path());
}
}
示例13: TagDialogBase
TagDialog::TagDialog( const KURL::List list, QWidget* parent )
: TagDialogBase( parent )
, m_bundle()
, m_score ( 0 )
, m_firstPlay ( QDateTime() )
, m_lastPlay ( QDateTime() )
, m_playlistItem( 0 )
, m_urlList( list )
, m_currentCover( 0 )
{
setCaption( kapp->makeStdCaption( i18n("1 Track", "Information for %n Tracks", list.count()) ) );
init();
}
示例14: pasteActionText
KIO_EXPORT QString KIO::pasteActionText()
{
QMimeSource *data = QApplication::clipboard()->data();
KURL::List urls;
if(KURLDrag::canDecode(data) && KURLDrag::decode(data, urls))
{
if(urls.isEmpty())
return QString::null; // nothing to paste
else if(urls.first().isLocalFile())
return i18n("&Paste File", "&Paste %n Files", urls.count());
else
return i18n("&Paste URL", "&Paste %n URLs", urls.count());
}
else if(data->format(0) != 0)
{
return i18n("&Paste Clipboard Contents");
}
else
{
return QString::null;
}
}
示例15: setFiles
void DeleteWidget::setFiles(const KURL::List &files)
{
ddFileList->clear();
// ddFileList->insertStringList(files);
for( KURL::List::ConstIterator it = files.begin(); it != files.end(); it++)
{
if( (*it).isLocalFile() ) //path is nil for non-local
ddFileList->insertItem( (*it).path() );
else
ddFileList->insertItem( (*it).url() );
}
ddNumFiles->setText(i18n("<b>1</b> file selected.", "<b>%n</b> files selected.", files.count()));
}