本文整理汇总了C++中kurl::List::constEnd方法的典型用法代码示例。如果您正苦于以下问题:C++ List::constEnd方法的具体用法?C++ List::constEnd怎么用?C++ List::constEnd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kurl::List
的用法示例。
在下文中一共展示了List::constEnd方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotAddImages
/** Replaces the ImagesList::slotAddImages method, so that
* MyImageListViewItems can be added instead of ImagesListViewItems
*/
void MyImageList::slotAddImages(const KUrl::List& list)
{
// Figure out which of the supplied URL's should actually be added and which
// of them already exist.
bool found = false;
for (KUrl::List::ConstIterator it = list.constBegin(); it != list.constEnd(); ++it)
{
KUrl imageUrl = *it;
found = false;
for (int i = 0; i < listView()->topLevelItemCount(); ++i)
{
MyImageListViewItem* const currItem = dynamic_cast<MyImageListViewItem*>(listView()->topLevelItem(i));
if (currItem && currItem->url() == imageUrl)
{
found = true;
break;
}
}
if (!found && KPMetadata::isRawFile(imageUrl))
{
new MyImageListViewItem(listView(), imageUrl);
}
}
// Duplicate the signalImageListChanged of the ImageWindow, to enable the
// upload button again.
emit signalImageListChanged();
}
示例2: slotAddPhoto
void GalleryWindow::slotAddPhoto()
{
QTreeWidgetItem* item = d->albumView->currentItem();
int column = d->albumView->currentColumn();
if (!item)
return; // NO album selected: FIXME: do something
// albumName
QString albumTitle = item->text(column);
if(!d->albumDict.contains(albumTitle))
return; // NO album name found: FIXME: do something
// photoPath
KUrl::List urls = KPImageDialog::getImageUrls(this, m_interface);
if (urls.isEmpty())
return; // NO photo selected: FIXME: do something
for (KUrl::List::ConstIterator it = urls.constBegin(); it != urls.constEnd(); ++it)
{
mpUploadList->append( (*it).path() );
}
m_uploadTotal = mpUploadList->count();
m_progressDlg->reset();
m_progressDlg->setMaximum(m_uploadTotal);
m_uploadCount = 0;
slotAddPhotoNext();
}
示例3: addSelectedAlbums
void KipiInterface::addSelectedAlbums(const KUrl::List& albums)
{
for (KUrl::List::const_iterator it = albums.constBegin(); it!=albums.constEnd(); ++it)
{
addSelectedAlbum(*it);
}
}
示例4: servURL
SvnHelper::SvnHelper():KApplication() {
KCmdLineArgs *args = KCmdLineArgs::parsedArgs();
#ifdef Q_WS_X11
m_id=KWindowSystem::activeWindow();
KWindowSystem::activateWindow(m_id);
#else
m_id = 0;
#endif
KUrl::List list;
for ( int i = 0 ; i < args->count() ; i++ )
list << args->url(i);
if (args->isSet("u")) {
kDebug(7128) << "update " << list;
const KUrl servURL("svn+http://this_is_a_fake_URL_and_this_is_normal/");
//FIXME when 1.2 is out (move the loop inside kio_svn's ::update)
for ( QList<KUrl>::const_iterator it = list.constBegin(); it != list.constEnd() ; ++it ) {
QByteArray parms;
QDataStream s( &parms, QIODevice::WriteOnly );
int cmd = 2;
int rev = -1;
kDebug(7128) << "updating : " << (*it).prettyUrl();
s << cmd << *it << rev << QString( "HEAD" );
KIO::SimpleJob * job = KIO::special(servURL, parms);
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
KIO::NetAccess::synchronousRun( job, 0 );
}
} else if (args->isSet("c")) {
示例5: contentsDropEvent
void KonqSidebarTree::contentsDropEvent( QDropEvent *ev )
{
if (d->m_dropMode == SidebarTreeMode) {
m_autoOpenTimer->stop();
if ( !selectedItem() )
{
// KonqOperations::doDrop( 0L, m_dirtreeDir.dir, ev, this );
KUrl::List urls;
if ( K3URLDrag::decode( ev, urls ) )
{
for(KUrl::List::ConstIterator it = urls.constBegin();
it != urls.constEnd(); ++it)
{
addUrl(0, *it);
}
}
}
else
{
KonqSidebarTreeItem *selection = static_cast<KonqSidebarTreeItem *>( selectedItem() );
selection->drop( ev );
}
} else {
K3ListView::contentsDropEvent(ev);
}
}
示例6: convertToLocalUrl
KURL::List K3b::convertToLocalUrls( const KURL::List& urls )
{
KURL::List r;
for( KURL::List::const_iterator it = urls.constBegin(); it != urls.constEnd(); ++it )
r.append( convertToLocalUrl( *it ) );
return r;
}
示例7: imagesFilesButtonAdd
void UploadDialog::imagesFilesButtonAdd()
{
QStringList fileList;
KUrl::List urls;
#if KIPI_PLUGIN
urls = KPImageDialog::getImageUrls(this);
#else
const QString filter = QString( "*.jpg *.jpeg *.jpe *.tiff *.gif *.png *.bmp|" + i18n("Image files") );
QPointer<KFileDialog> dlg = new KFileDialog( QString(), filter, this );
// QPointer<KFileDialog> dlg = new KFileDialog( QString::null, filter, this, "addImagesDlg", true );
dlg->setCaption( i18n("Add Images") );
dlg->setMode( KFile::Files | KFile::Directory );
dlg->exec();
urls = dlg->selectedUrls();
delete dlg;
#endif
if ( urls.isEmpty() ) return;
for( KUrl::List::ConstIterator it = urls.constBegin() ; it != urls.constEnd() ; ++it )
fileList << (*it).path();
addDropItems( fileList );
}
示例8: executeOtherDesktopFile
void KNewFileMenuPrivate::executeOtherDesktopFile(const KNewFileMenuSingleton::Entry& entry)
{
if (!checkSourceExists(entry.templatePath)) {
return;
}
KUrl::List::const_iterator it = m_popupFiles.constBegin();
for (; it != m_popupFiles.constEnd(); ++it)
{
QString text = entry.text;
text.remove("..."); // the ... is fine for the menu item but not for the default filename
text = text.trimmed(); // In some languages, there is a space in front of "...", see bug 268895
// KDE5 TODO: remove the "..." from link*.desktop files and use i18n("%1...") when making
// the action.
KUrl defaultFile(*it);
defaultFile.addPath(KIO::encodeFileName(text));
if (defaultFile.isLocalFile() && QFile::exists(defaultFile.toLocalFile()))
text = KIO::RenameDialog::suggestName(*it, text);
const KUrl templateUrl(entry.templatePath);
KDialog* dlg = new KPropertiesDialog(templateUrl, *it, text, m_parentWidget);
dlg->setModal(q->isModal());
dlg->setAttribute(Qt::WA_DeleteOnClose);
QObject::connect(dlg, SIGNAL(applied()), q, SLOT(_k_slotOtherDesktopFile()));
dlg->show();
}
// We don't set m_src here -> there will be no copy, we are done.
}
示例9: addItems
void SoundtrackDialog::addItems(const KUrl::List& fileList)
{
if (fileList.isEmpty())
return;
KUrl::List Files = fileList;
for (KUrl::List::ConstIterator it = Files.constBegin(); it != Files.constEnd(); ++it)
{
KUrl currentFile = *it;
KUrl path = KUrl(currentFile.path().section('/', 0, -1));
m_sharedData->soundtrackPath = path;
SoundItem *item = new SoundItem(m_SoundFilesListBox, path);
item->setName(currentFile.path().section('/', -1));
m_SoundFilesListBox->insertItem(m_SoundFilesListBox->count() - 1, item);
m_soundItems->insert(path, item);
connect(m_soundItems->value(path), SIGNAL(signalTotalTimeReady(const KUrl&, const QTime&)),
this, SLOT(slotAddNewTime(const KUrl&, const QTime&)));
m_urlList.append(path);
}
m_SoundFilesListBox->setCurrentItem(m_SoundFilesListBox->item(m_SoundFilesListBox->count() - 1)) ;
slotSoundFilesSelected(m_SoundFilesListBox->currentRow());
m_SoundFilesListBox->scrollToItem(m_SoundFilesListBox->currentItem());
m_previewButton->setEnabled(true);
}
示例10: refreshImages
void KipiInterface::refreshImages(const KUrl::List& urls)
{
kipiDebug(QString( "Plugin asks to refresh %1 images:").arg( urls.size() ));
for (KUrl::List::ConstIterator it = urls.constBegin(); it!=urls.constEnd(); ++it)
{
kipiDebug(" " + (*it).url());
}
}
示例11: executeStrategy
void KNewFileMenuPrivate::executeStrategy()
{
m_tempFileToDelete = m_copyData.tempFileToDelete();
const QString src = m_copyData.sourceFileToCopy();
QString chosenFileName = expandTilde(m_copyData.chosenFileName(), true);
if (src.isEmpty())
return;
KUrl uSrc(src);
if (uSrc.isLocalFile()) {
// In case the templates/.source directory contains symlinks, resolve
// them to the target files. Fixes bug #149628.
KFileItem item(uSrc, QString(), KFileItem::Unknown);
if (item.isLink())
uSrc.setPath(item.linkDest());
if (!m_copyData.m_isSymlink) {
// If the file is not going to be detected as a desktop file, due to a
// known extension (e.g. ".pl"), append ".desktop". #224142.
QFile srcFile(uSrc.toLocalFile());
if (srcFile.open(QIODevice::ReadOnly)) {
KMimeType::Ptr wantedMime = KMimeType::findByUrl(uSrc);
KMimeType::Ptr mime = KMimeType::findByNameAndContent(m_copyData.m_chosenFileName, srcFile.read(1024));
//kDebug() << "mime=" << mime->name() << "wantedMime=" << wantedMime->name();
if (!mime->is(wantedMime->name()))
chosenFileName += wantedMime->mainExtension();
}
}
}
// The template is not a desktop file [or it's a URL one]
// Copy it.
KUrl::List::const_iterator it = m_popupFiles.constBegin();
for (; it != m_popupFiles.constEnd(); ++it)
{
KUrl dest(*it);
dest.addPath(KIO::encodeFileName(chosenFileName));
KUrl::List lstSrc;
lstSrc.append(uSrc);
KIO::Job* kjob;
if (m_copyData.m_isSymlink) {
kjob = KIO::symlink(src, dest);
// This doesn't work, FileUndoManager registers new links in copyingLinkDone,
// which KIO::symlink obviously doesn't emit... Needs code in FileUndoManager.
//KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Link, lstSrc, dest, kjob);
} else {
//kDebug(1203) << "KIO::copyAs(" << uSrc.url() << "," << dest.url() << ")";
KIO::CopyJob * job = KIO::copyAs(uSrc, dest);
job->setDefaultPermissions(true);
kjob = job;
KIO::FileUndoManager::self()->recordJob(KIO::FileUndoManager::Copy, lstSrc, dest, job);
}
kjob->ui()->setWindow(m_parentWidget);
QObject::connect(kjob, SIGNAL(result(KJob*)), q, SLOT(slotResult(KJob*)));
}
}
示例12: setFiles
void DeleteWidget::setFiles(const KUrl::List &files)
{
ddFileList->clear();
// ddFileList->insertStringList(files);
for( KUrl::List::ConstIterator it = files.constBegin(), end = files.constEnd(); it != end; ++it)
{
if( (*it).isLocalFile() ) //path is nil for non-local
ddFileList->insertItem( (*it).path() );
else
ddFileList->insertItem( (*it).url() );
}
ddNumFiles->setText(i18np("<b>1</b> file selected.", "<b>%1</b> files selected.", files.count()));
}
示例13: setURLValueList
void QGpgMECryptoConfigEntry::setURLValueList( const KUrl::List& urls )
{
QStringList lst;
for( KUrl::List::const_iterator it = urls.constBegin(); it != urls.constEnd(); ++it ) {
lst << splitURL( mRealArgType, *it );
}
mValue = lst;
if ( lst.isEmpty() && !isOptional() )
mSet = false;
else
mSet = true;
mDirty = true;
}
示例14: identifyRawFiles
void ActionThread::identifyRawFiles(const KUrl::List& urlList, bool full)
{
for (KUrl::List::const_iterator it = urlList.constBegin();
it != urlList.constEnd(); ++it )
{
ActionThreadPriv::Task* t = new ActionThreadPriv::Task;
t->fileUrl = *it;
t->action = full ? IDENTIFY_FULL : IDENTIFY;
QMutexLocker lock(&d->mutex);
d->todo << t;
d->condVar.wakeAll();
}
}
示例15: mailingListPostAddress
//--------------------------------------------------------------------------
QString KMFolder::mailingListPostAddress() const
{
if ( mMailingList.features() & MailingList::Post ) {
KUrl::List::const_iterator it;
KUrl::List post = mMailingList.postURLS();
for( it = post.constBegin(); it != post.constEnd(); ++it ) {
// We check for isEmpty because before 3.3 postAddress was just an
// [email protected] and that leaves protocol() field in the kurl class
if ( (*it).protocol() == "mailto" || (*it).protocol().isEmpty() )
return (*it).path();
}
}
return QString();
}