コード例 #1
0
void MailingList::setPostURLS ( const KUrl::List& lst )
{
  mFeatures |= Post;
  if ( lst.empty() ) {
    mFeatures ^= Post;
  }
  mPostURLS = lst;
}
コード例 #2
0
void MailingList::setUnsubscribeURLS( const KUrl::List& lst )
{
  mFeatures |= Unsubscribe;
  if ( lst.empty() ) {
    mFeatures ^= Unsubscribe;
  }

  mUnsubscribeURLS = lst;
}
コード例 #3
0
void MailingList::setArchiveURLS( const KUrl::List& lst )
{
  mFeatures |= Archive;
  if ( lst.empty() ) {
    mFeatures ^= Archive;
  }

  mArchiveURLS = lst;
}
コード例 #4
0
void MailingList::setHelpURLS( const KUrl::List& lst )
{
  mFeatures |= Help;
  if ( lst.empty() ) {
    mFeatures ^= Help;
  }

  mHelpURLS = lst;
}
コード例 #5
0
void MailingList::setOwnerURLS( const KUrl::List& lst )
{
  mFeatures |= Owner;
  if ( lst.empty() ) {
    mFeatures ^= Owner;
  }

  mOwnerURLS = lst;
}
コード例 #6
0
void ExpoBlendingDlg::slotAddItems(const KUrl::List& urls)
{
    if (!urls.empty())
    {
        d->mngr->thread()->identifyFiles(urls);
        if (!d->mngr->thread()->isRunning())
            d->mngr->thread()->start();
    }
}
コード例 #7
0
void
MailingList::setSubscribeURLS( const KURL::List& lst )
{
  mFeatures |= Subscribe;
  if ( lst.empty() ) {
    mFeatures ^= Subscribe;
  }

  mSubscribeURLS = lst;
}
コード例 #8
0
ファイル: itemspage.cpp プロジェクト: rickysarraf/digikam
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();
}
コード例 #9
0
ファイル: kgpglibrary.cpp プロジェクト: serghei/kde3-kdeutils
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
コード例 #10
0
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();
    }
}
コード例 #11
0
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;
}
コード例 #12
0
ファイル: gitrunner.cpp プロジェクト: deiv/plasmate-pkg
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);
}
コード例 #13
0
ファイル: gitrunner.cpp プロジェクト: deiv/plasmate-pkg
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();
}
コード例 #14
0
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;
}
コード例 #15
0
 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)));
 }
コード例 #16
0
ファイル: k3bexporter.cpp プロジェクト: delight/Pana
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 );
    }
}
コード例 #17
0
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;
  }
}
コード例 #18
0
static QString urls2string( const KUrl::List & urls ) {
    return urls.empty() ? QString() : urls.front().url() ;
}
コード例 #19
0
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)));
}
コード例 #20
0
ファイル: batchdialog.cpp プロジェクト: rickysarraf/digikam
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();
    }
}