void MailingList::setPostURLS ( const KUrl::List& lst ) { mFeatures |= Post; if ( lst.empty() ) { mFeatures ^= Post; } mPostURLS = lst; }
void MailingList::setUnsubscribeURLS( const KUrl::List& lst ) { mFeatures |= Unsubscribe; if ( lst.empty() ) { mFeatures ^= Unsubscribe; } mUnsubscribeURLS = lst; }
void MailingList::setArchiveURLS( const KUrl::List& lst ) { mFeatures |= Archive; if ( lst.empty() ) { mFeatures ^= Archive; } mArchiveURLS = lst; }
void MailingList::setHelpURLS( const KUrl::List& lst ) { mFeatures |= Help; if ( lst.empty() ) { mFeatures ^= Help; } mHelpURLS = lst; }
void MailingList::setOwnerURLS( const KUrl::List& lst ) { mFeatures |= Owner; if ( lst.empty() ) { mFeatures ^= Owner; } mOwnerURLS = lst; }
void ExpoBlendingDlg::slotAddItems(const KUrl::List& urls) { if (!urls.empty()) { d->mngr->thread()->identifyFiles(urls); if (!d->mngr->thread()->isRunning()) d->mngr->thread()->start(); } }
void MailingList::setSubscribeURLS( const KURL::List& lst ) { mFeatures |= Subscribe; if ( lst.empty() ) { mFeatures ^= Subscribe; } mSubscribeURLS = lst; }
void ItemsPage::slotAddItems(const KUrl::List& urls) { if (!urls.empty()) { d->mngr->thread()->identifyFiles(urls); if (!d->mngr->thread()->isRunning()) d->mngr->thread()->start(); } slotImageListChanged(); }
void KgpgLibrary::slotFileEnc(KURL::List urls,QStringList opts,QStringList defaultKey,KShortcut goDefaultKey) { ///////////////////////////////////////////////////////////////////////// encode file file if (!urls.empty()) { urlselecteds=urls; if (defaultKey.isEmpty()) { QString fileNames=urls.first().fileName(); if (urls.count()>1) fileNames+=",..."; popupPublic *dialogue=new popupPublic(0,"Public keys",fileNames,true,goDefaultKey); connect(dialogue,SIGNAL(selectedKey(QStringList,QStringList,bool,bool)),this,SLOT(startencode(QStringList,QStringList,bool,bool))); dialogue->exec(); delete dialogue; } else
void BatchDialog::addItems(const KUrl::List& itemList) { QString ext; switch(d->saveSettingsBox->fileFormat()) { case SaveSettingsWidget::OUTPUT_JPEG: ext = "jpg"; break; case SaveSettingsWidget::OUTPUT_TIFF: ext = "tif"; break; case SaveSettingsWidget::OUTPUT_PPM: ext = "ppm"; break; case SaveSettingsWidget::OUTPUT_PNG: ext = "png"; break; } KUrl::List urlList; QPixmap pix(SmallIcon("image-x-generic", KIconLoader::SizeLarge, KIconLoader::DisabledState)); for (KUrl::List::const_iterator it = itemList.begin(); it != itemList.end(); ++it) { KUrl url = *it; QFileInfo fi(url.path()); if (fi.exists() && !findItem(url)) { QString dest = fi.baseName() + QString(".") + ext; new CListViewItem(d->listView, pix, url, dest); urlList.append(url); } } if (!urlList.empty()) { if (!d->iface->hasFeature(KIPI::HostSupportsThumbnails)) d->thread->thumbRawFiles(urlList); else d->iface->thumbnails(urlList, 256); d->thread->identifyRawFiles(urlList); if (!d->thread->isRunning()) d->thread->start(); } }
DvcsJob::JobStatus GitRunner::remove(const KUrl::List &files) { if (files.empty()) return m_jobStatus = DvcsJob::JobCancelled; DvcsJob *job = new DvcsJob(); initJob(*job); *job << "rm"; QStringList stringFiles = files.toStringList(); while (!stringFiles.isEmpty()) { *job << m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0); } startJob(*job); return m_jobStatus; }
void GitRunner::add(const KUrl::List &localLocations) { if (localLocations.empty()) { return; } QStringList command; command << "add"; // Adding files to the runner. QStringList stringFiles = localLocations.toStringList(); while (!stringFiles.isEmpty()) { command.append(m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0)); } execSynchronously(command); }
void GitRunner::remove(const KUrl::List &files) { if (files.empty()) { return; } QStringList command; command << "rm "; QStringList stringFiles = files.toStringList(); while (!stringFiles.isEmpty()) { command.append(m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0)); } KJob *job = initJob(command); connect(job, SIGNAL(result(KJob*)), this, SLOT(handleRemove(KJob*))); job->start(); }
DvcsJob::JobStatus GitRunner::add(const KUrl::List &localLocations) { if (localLocations.empty()) return m_jobStatus = DvcsJob::JobCancelled; DvcsJob *job = new DvcsJob(); initJob(*job); *job << "add"; // Adding files to the runner. QStringList stringFiles = localLocations.toStringList(); while (!stringFiles.isEmpty()) { *job << m_lastRepoRoot->pathOrUrl() + '/' + stringFiles.takeAt(0); } startJob(*job); return m_jobStatus; }
void importNext() { if (mUrlList.empty()) { q->finalizeImport(); return; } mCurrentUrl = mUrlList.takeFirst(); KUrl dst = mTempImportDir; dst.addPath(mCurrentUrl.fileName()); KIO::Job* job = KIO::copy(mCurrentUrl, dst, KIO::HideProgressInfo); if (job->ui()) { job->ui()->setWindow(mAuthWindow); } QObject::connect(job, SIGNAL(result(KJob*)), q, SLOT(slotCopyDone(KJob*))); QObject::connect(job, SIGNAL(percent(KJob*,ulong)), q, SLOT(slotPercent(KJob*,ulong))); }
void K3bExporter::exportTracks( const KURL::List &urls, int openmode ) { if( urls.empty() ) return; DCOPClient *client = DCOPClient::mainClient(); QCString appId, appObj; QByteArray data; if( openmode == -1 ) //ask to open a data or an audio cd project openmode = openMode(); if( !client->findObject( "k3b-*", "K3bInterface", "", data, appId, appObj) ) exportViaCmdLine( urls, openmode ); else { DCOPRef ref( appId, appObj ); exportViaDCOP( urls, ref, openmode ); } }
bool KMail::Util::mailingListsHandleURL( const KUrl::List& lst,const QSharedPointer<MailCommon::FolderCollection> &folder ) { const QString handler = ( folder->mailingList().handler() == MailingList::KMail ) ? QLatin1String( "mailto" ) : QLatin1String( "https" ); KUrl urlToHandle; KUrl::List::ConstIterator end( lst.constEnd() ); for ( KUrl::List::ConstIterator itr = lst.constBegin(); itr != end; ++itr ) { if ( handler == (*itr).protocol() ) { urlToHandle = *itr; break; } } if ( urlToHandle.isEmpty() && !lst.empty() ) { urlToHandle = lst.first(); } if ( !urlToHandle.isEmpty() ) { return KMail::Util::handleClickedURL( urlToHandle, folder ); } else { kWarning()<< "Can't handle url"; return false; } }
static QString urls2string( const KUrl::List & urls ) { return urls.empty() ? QString() : urls.front().url() ; }
void BaseTreeView::slotDropped (QWidget *, QDropEvent * /*e*/, KURL::List& fileList, KURL& dest) { if(fileList.empty()) return; // Check what the destination can do if (!KProtocolInfo::supportsWriting(dest)) return; bool sLinking = KProtocolInfo::supportsLinking(dest); // Check what the source can do KURL url = fileList.first(); // we'll assume it's the same for all URLs (hack) bool sReading = KProtocolInfo::supportsReading(url); bool sDeleting = KProtocolInfo::supportsDeleting(url); bool sMoving = KProtocolInfo::supportsMoving(url); // Check the state of the modifiers key at the time of the drop Window root; Window child; int root_x, root_y, win_x, win_y; uint keybstate; XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child, &root_x, &root_y, &win_x, &win_y, &keybstate ); int result; if (keybstate & ControlMask) { result = 1; // copy } else { if (keybstate & ShiftMask) { result = 2; // move } else { // create the popup menu QPopupMenu popup; if (sMoving || (sReading && sDeleting)) popup.insertItem(SmallIconSet("goto"), i18n("&Move Here"), 2 ); if (sReading) popup.insertItem(SmallIconSet("editcopy"), i18n("&Copy Here"), 1 ); if (sLinking) popup.insertItem(SmallIconSet("www"), i18n("&Link Here"), 3 ); popup.insertSeparator(); popup.insertItem(SmallIconSet("cancel"), i18n("C&ancel"), 5); result = popup.exec( QCursor::pos() ); } } bool tooltip = showToolTips(); KIO::Job *job; switch ( result ) { case 1 : setShowToolTips(false); setDragEnabled(false); QuantaNetAccess::dircopy(fileList, dest, m_parent, true); setDragEnabled(true); setShowToolTips(tooltip); return; case 2 : setShowToolTips(false); setDragEnabled(false); QuantaNetAccess::move(fileList, dest, m_parent, true); setDragEnabled(true); setShowToolTips(tooltip); return; case 3 : job = KIO::link(fileList, dest); break; default : return ; } if (!job) return; connect(job, SIGNAL( result(KIO::Job *) ), this, SLOT( slotJobFinished(KIO::Job *) ) ); progressBar->setTotalSteps(100); connect(job, SIGNAL(percent( KIO::Job *, unsigned long)), this, SLOT(slotPercent( KIO::Job *, unsigned long))); }
void BatchDialog::slotIdentify() // Set Identity and Target file { QString ext; switch(d->saveSettingsBox->fileFormat()) { case KPSaveSettingsWidget::OUTPUT_JPEG: ext = ".jpg"; break; case KPSaveSettingsWidget::OUTPUT_TIFF: ext = ".tif"; break; case KPSaveSettingsWidget::OUTPUT_PPM: ext = ".ppm"; break; case KPSaveSettingsWidget::OUTPUT_PNG: ext = ".png"; break; } KUrl::List urlList = d->listView->imageUrls(true); for (KUrl::List::const_iterator it = urlList.constBegin(); it != urlList.constEnd(); ++it) { QFileInfo fi((*it).path()); if(d->saveSettingsBox->conflictRule() == KPSaveSettingsWidget::OVERWRITE) { QString dest = fi.completeBaseName() + ext; MyImageListViewItem* item = dynamic_cast<MyImageListViewItem*>(d->listView->listView()->findItem(*it)); if (item) item->setDestFileName(dest); } else { QString dest = fi.absolutePath() + QString("/") + fi.completeBaseName() + ext; QFileInfo a(dest); bool fileNotFound = (a.exists()); if (!fileNotFound) { dest = fi.completeBaseName() + ext; } else { int i = 0; while(fileNotFound) { a = QFileInfo(dest); if (!a.exists()) { fileNotFound = false; } else { i++; dest = fi.absolutePath() + QString("/") + fi.completeBaseName() + QString("_") + QString::number(i) + ext; } } dest = fi.completeBaseName() + QString("_") + QString::number(i) + ext; } MyImageListViewItem* const item = dynamic_cast<MyImageListViewItem*>(d->listView->listView()->findItem(*it)); if (item) { item->setDestFileName(dest); } } } if (!urlList.empty()) { d->thread->identifyRawFiles(urlList); if (!d->thread->isRunning()) d->thread->start(); } }