本文整理汇总了C++中kurl::List::size方法的典型用法代码示例。如果您正苦于以下问题:C++ List::size方法的具体用法?C++ List::size怎么用?C++ List::size使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类kurl::List
的用法示例。
在下文中一共展示了List::size方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: slotAlbumDelete
void AlbumModificationHelper::slotAlbumDelete(PAlbum* album)
{
if (!album || album->isRoot() || album->isAlbumRoot())
{
return;
}
// find subalbums
KUrl::List childrenList;
addAlbumChildrenToList(childrenList, album);
DeleteDialog dialog(d->dialogParent);
// All subalbums will be presented in the list as well
if (!dialog.confirmDeleteList(childrenList,
childrenList.size() == 1 ?
DeleteDialogMode::Albums : DeleteDialogMode::Subalbums,
DeleteDialogMode::UserPreference))
{
return;
}
bool useTrash = !dialog.shouldDelete();
// Currently trash kioslave can handle only full paths.
// pass full folder path to the trashing job
DIO::del(album, useTrash);
}
示例2: 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());
}
}
示例3: slotApplyTitle
void WmWidget::slotApplyTitle()
{
kDebug() << "ApplyTitle";
QString givenTitle = title();
QString imageTitle;
QString number;
QString originalExtension;
QString currentExtension;
KUrl::List urls;
QMap<QString, QString> imageMetaData;
QList<QTreeWidgetItem*> selectedItems = d->imgList->listView()->selectedItems();
QStringList parts;
const int minLength = givenTitle.count("#");
// Build the list of items to rename
for (int i = 0; i < selectedItems.size(); ++i)
{
KPImagesListViewItem* l_item = dynamic_cast<KPImagesListViewItem*>(selectedItems.at(i));
urls.append(l_item->url());
}
for (int i = 0; i < urls.size(); ++i)
{
imageMetaData = d->imagesDescInfo[urls.at(i).path()];
imageTitle = givenTitle;
// If there is at least one #, replace it the correct number
if(minLength > 0)
{
parts = imageTitle.split("#", QString::KeepEmptyParts);
imageTitle = parts.first().append("#").append(parts.last());
number = QString::number(i + 1);
while (number.length() < minLength)
{
number.prepend("0");
}
imageTitle.replace(imageTitle.indexOf("#"), 1, number);
}
// Add original extension if removed
currentExtension = imageTitle.split('.').last();
originalExtension = urls.at(i).path().split('.').last();
if(QString::compare(currentExtension, originalExtension, Qt::CaseInsensitive) != 0)
{
imageTitle.append(".").append(originalExtension);
d->titleEdit->setText(imageTitle);
}
kDebug() << urls.at(i).path() << "renamed to" << imageTitle;
imageMetaData["title"] = imageTitle;
d->imagesDescInfo[urls.at(i).path()] = imageMetaData;
}
}
示例4: addDarkFile
void ImageReductionDlg::addDarkFile()
{
KURL::List fileURLs = KFileDialog::getOpenURLs( QString::null, "*.fits *.fit *.fts|Flexible Image Transport System", 0, i18n("Dark Frames"));
const int limit = (int) fileURLs.size();
for (int i=0; i < limit ; ++i)
new QListViewItem( darkListView, fileURLs[i].path());
darkRemoveB->setEnabled(true);
darkDetailsB->setEnabled(true);
}
示例5: loadImageInfoFirstLoad
void WmWidget::loadImageInfoFirstLoad()
{
KUrl::List urls = d->imgList->imageUrls(false);
QString title;
QString date;
QString description;
QString currentCategories;
QString latitude;
QString longitude;
for(int j = 0; j < urls.size(); j++)
{
KPImageInfo info(urls.at(j).path());
QStringList keywar = info.keywords();
date = info.date().toString(Qt::ISODate);
date = date.replace("T", " ", Qt::CaseSensitive);
title = info.name();
description = info.title();
currentCategories = "";
for( int i = 0; i < keywar.size(); i++)
{
if(i == keywar.size()-1)
{
currentCategories.append(keywar.at(i));
}
else
{
currentCategories.append(keywar.at(i)).append("\n");
}
}
if(info.hasLatitude())
{
latitude = QString::number(info.latitude());
}
if(info.hasLongitude())
{
longitude = QString::number(info.longitude());
}
QMap<QString, QString> imageMetaData;
imageMetaData["title"] = title;
imageMetaData["date"] = date;
imageMetaData["categories"] = currentCategories;
imageMetaData["description"] = description;
imageMetaData["latitude"] = latitude;
imageMetaData["longitude"] = longitude;
d->imagesDescInfo.insert(urls.at(j).path(), imageMetaData);
}
}
示例6: dragEnterEvent
void QuickLauncher::dragEnterEvent(TQDragEnterEvent *e)
{
DEBUGSTR << "QuickLauncher::dragEnterEvent(pos=" << e->pos() <<
" type=" << e->type() << ")" << endl << flush;
m_dragAccepted=false;
KURL::List kurlList;
if (!isDragEnabled() || !KURLDrag::decode(e, kurlList))
{
e->accept(false);
return;
}
if (kurlList.size()<=0)
{
e->accept(false);
return;
}
m_dragButtons=new ButtonGroup;
m_oldButtons=new ButtonGroup(*m_buttons);
TQString url;
KURL::List::ConstIterator it = kurlList.begin();
for ( ; it != kurlList.end(); ++it )
{
url = QuickURL((*it).url()).url();
kdDebug() << " Drag Object='"<<url<<"' " << (*it).url() << endl;
int pos = m_buttons->findDescriptor(url);
if (pos != NotFound)
{
// if it's already in m_buttons, take it out
m_dragButtons->push_back(m_buttons->takeFrom(pos));
}
else
{
// otherwise, create a new one
QuickButton* button = createButton(url);
button->setSticky(true);
m_dragButtons->push_back(button);
}
}
if (m_dragButtons->size() > 0)
{
//make sure we can drag at least one button.
m_dragAccepted=true;
m_newButtons=new ButtonGroup(*m_buttons);
m_dropPos=NotFound;
e->accept(true);
return;
}
e->accept(false);
clearTempButtons();
}
示例7: author
QMap <QString,QMap <QString,QString> > WmWidget::allImagesDesc()
{
KUrl::List urls = d->imgList->imageUrls(false);
for (int i = 0; i < urls.size(); ++i)
{
QMap<QString, QString> imageMetaData = d->imagesDescInfo[urls.at(i).path()];
imageMetaData["author"] = author();
imageMetaData["source"] = source();
imageMetaData["license"] = license();
imageMetaData["genCategories"] = genCategories();
imageMetaData["genText"] = genText();
d->imagesDescInfo[urls.at(i).path()] = imageMetaData;
}
return d->imagesDescInfo;
}
示例8: slotApplyImagesDesc
void WmWidget::slotApplyImagesDesc(){
//-- enregistrement des edit dans la map
KUrl::List urls;
QList<QTreeWidgetItem *> selectedItems=m_imgList->listView()->selectedItems();
for (int i = 0; i < selectedItems.size(); ++i){
KPImagesListViewItem* l_item = dynamic_cast<KPImagesListViewItem*>(selectedItems.at(i));
urls.append(l_item->url());
}
for (int i = 0; i < urls.size(); ++i)
{
QMap<QString, QString> imageMetaData;
imageMetaData = m_imagesDescInfo[urls.at(i).path()];
if(m_titleCheck->isChecked()){
QString url = urls.at(i).path().split('/').last();
url = title();
if(url.split('.').last().isEmpty()){
url = url +"."+urls.at(i).path().split('.').last();
m_titleEdit->setText(url);
}
kDebug()<<" Url in the if "<<url;
imageMetaData["title"] = url;
kDebug()<<" Url after if "<<url;
}
if(m_dateCheck->isChecked()){
imageMetaData["time"] = date();
}
if(m_categoryCheck->isChecked()){
imageMetaData["categories"] = categories();
}
if(m_descCheck->isChecked()){
imageMetaData["description"] = description();
}
m_imagesDescInfo[urls.at(i).path()]=imageMetaData;
}
}
示例9: slotApplyLongitude
void WmWidget::slotApplyLongitude()
{
KUrl::List urls;
QList<QTreeWidgetItem*> selectedItems = d->imgList->listView()->selectedItems();
for (int i = 0; i < selectedItems.size(); ++i)
{
KPImagesListViewItem* l_item = dynamic_cast<KPImagesListViewItem*>(selectedItems.at(i));
urls.append(l_item->url());
}
for (int i = 0; i < urls.size(); ++i)
{
QMap<QString, QString> imageMetaData;
imageMetaData = d->imagesDescInfo[urls.at(i).path()];
imageMetaData["longitude"] = longitude();
d->imagesDescInfo[urls.at(i).path()] = imageMetaData;
}
}
示例10: author
QMap <QString,QMap <QString,QString> > WmWidget::allImagesDesc()
{
KUrl::List urls = m_imgList->imageUrls(false);
for (int i = 0; i < urls.size(); ++i)
{
QMap<QString, QString> imageMetaData = m_imagesDescInfo[urls.at(i).path()];
imageMetaData["author"] = author();
imageMetaData["license"] = license();
m_imagesDescInfo[urls.at(i).path()]=imageMetaData;
}
return m_imagesDescInfo;
}
示例11: slotStartTransfer
void WMWindow::slotStartTransfer()
{
saveSettings();
KUrl::List urls = iface()->currentSelection().images();
QMap <QString,QMap <QString,QString> > imagesDesc=m_widget->allImagesDesc();
for (int i = 0; i < urls.size(); ++i)
{
QString caption;
QString url;
if(m_widget->resize()){
prepareImageForUpload(urls.at(i).path(), caption);
;
imagesDesc.insert(m_tmpPath, imagesDesc.take(urls.at(i).path()));
}
}
m_uploadJob->setImageMap(imagesDesc);
m_widget->progressBar()->setRange(0, 100);
m_widget->progressBar()->setValue(0);
connect(m_uploadJob, SIGNAL(uploadProgress(int)),
m_widget->progressBar(), SLOT(setValue(int)));
connect(m_uploadJob, SIGNAL(endUpload()),
this, SLOT(slotEndUpload()));
m_widget->progressBar()->show();
m_widget->progressBar()->progressScheduled(i18n("Wiki Export"), true, true);
m_widget->progressBar()->progressThumbnailChanged(KIcon("kipi").pixmap(22, 22));
m_uploadJob->begin();
}