Ejemplo n.º 1
0
	Q_FOREACH( MixerInfo* mi, m_mixers )
	{
		if ( removeSources )
			removeSource( mi->id );
		delete mi->iface;
		delete mi;
	}
Ejemplo n.º 2
0
void MediaStreamPrivate::removeRemoteSource(MediaStreamSource* source)
{
    if (m_client)
        m_client->removeRemoteSource(source);
    else
        removeSource(source);
}
Ejemplo n.º 3
0
	Q_FOREACH( ControlInfo* ci, m_controls )
	{
		if ( removeSources )
			removeSource( ci->mixerId + '/' + ci->id );
		delete ci->iface;
		delete ci;
	}
Ejemplo n.º 4
0
void PrintersEngine::getPrintersFinished()
{
    KCupsRequest *request = qobject_cast<KCupsRequest*>(sender());
    if (!request || request->hasError()) {
        // in case of an error probe the server again in 1.5 seconds
        QTimer::singleShot(1500, this, SLOT(getPrinters()));
        request->deleteLater();;
        return;
    }

    QStringList printersStrList;
    foreach (const KCupsPrinter &printer, request->printers()) {
        updatePrinterSource(printer);
        printersStrList << printer.name();
    }

    // Remove the printers that are not available anymore
    foreach (const QString &source, sources()) {
        if (!printersStrList.contains(source)) {
            removeSource(source);
        }
    }

    request->deleteLater();
}
Ejemplo n.º 5
0
void MediaStreamDescriptor::removeRemoteSource(MediaStreamSource* source)
{
    if (m_client)
        m_client->removeRemoteSource(source);
    else
        removeSource(source);
}
Ejemplo n.º 6
0
void PlacesEngine::placesRemoved(const QModelIndex&, int start, int end)
{
    qDebug() << "Places" << start << "through" << end << "removed";
    for (int index = start; index <= end; index++) {
        removeSource(QString::number(index));
    }
}
InputPort::InputPort(Port& parent, bool isList) :
    mParent(parent)
{
    parent.portData->in = this;
    parent.setDefaultValueRaw(parent.portData->info.defaultValue);
    parent.portData->info.isArray = isList;
    removeSource();
}
Ejemplo n.º 8
0
void NotificationsEngine::userClosedNotification(uint id)
{
    const QString source = QString("notification %1").arg(id);
    // if we don't have that notification in our list,
    // it was already closed, so don't emit
    if (m_activeNotifications.remove(source) > 0) {
        removeSource(source);
        emit NotificationClosed(id, 2);
    }
}
Ejemplo n.º 9
0
SoundEngine::~SoundEngine()
{
	for (int i = 0; i < MAX_SOUND_SOURCE_COUNT; i++)
	{
		if (soundSources[i] != NULL)
		{
			removeSource(soundSources[i]);
		}
	}
	delete soundSourceIndexer;
}
void NowReadingEngine::update()
{
    QFileInfoList okularFiles = getOkularXMLFiles();
    QFileInfoList::const_iterator it = okularFiles.constBegin();
    uint limit = MaxDataModelSize;

    for ( ; it != okularFiles.constEnd() && limit--; ++it) {
        QString okularFileName = it->absoluteFilePath();
        DataModel::iterator itDm = _dataModel.find(okularFileName);

        if ((itDm != _dataModel.end()) && /* We have an entry for this element */
            (itDm.value().accessTime >= it->lastModified())) { /* And it's up to date */
                /* No need to update */
                continue;
        }

        NowReadingEntry entry;
        if (convertOkularXMLFileToEntry(okularFileName, entry)) {
            setData(entry.path, "currentPage", entry.currentPage);
            setData(entry.path, "totalPages", entry.totalPages);
            setData(entry.path, "accessTime", entry.accessTime);
            _dataModel[okularFileName] = entry;
        }
    }

    /* Cleanup */
    if (_dataModel.size() > MaxDataModelSize) {
        // Find elements to evict
        // First - what is the modification time of the last element we want to preserve?

        QDateTime oldestElementDate;
        QList<DataModel::mapped_type> values = _dataModel.values();
        nth_element(values.begin(), values.begin()+MaxDataModelSize-1, values.end());
        oldestElementDate = (values.begin()+MaxDataModelSize-1)->accessTime;

        // Now find all elements older than the oldest allowable
        DataModel::iterator it = _dataModel.begin();

        while (it != _dataModel.end()) {
            if (it.value().accessTime <  oldestElementDate) {
                removeSource(it.value().path);
                it = _dataModel.erase(it);
            }
            else {
                ++it;
            }
        }

    }

    /* Single shot timer used as in case the update takes very long
       we can get overflow of timer events to handle */
    QTimer::singleShot(PollingInterval, this, SLOT(update()));
}
Ejemplo n.º 11
0
void SoundEngine::update()
{
	for (int i = 0; i < MAX_SOUND_SOURCE_COUNT; i++)
	{
		if (soundSources[i] != NULL)
		{
			if (!soundSources[i]->isPlaying())
			{
				removeSource(soundSources[i]);
			}
		}
	}
}
Ejemplo n.º 12
0
	void VFS::removeSource(const std::string& path) {
		type_providers::iterator end = m_providers.end();
		for (type_providers::iterator i = m_providers.begin(); i != end; ++i) {
			VFSSourceProvider* provider = *i;
			if (provider->hasSource(path)) {
				VFSSource* source = provider->getSource(path);
				type_sources::iterator i = std::find(m_sources.begin(), m_sources.end(), source);
				if (i == m_sources.end()) {
					removeSource(*i);
					return;
				}
			}
		}
	}
Ejemplo n.º 13
0
void NotificationsEngine::timerEvent(QTimerEvent *event)
{
    const QString source = m_timeouts.value(event->timerId());
    if (!source.isEmpty()) {
        killTimer(event->timerId());
        m_sourceTimers.remove(source);
        m_timeouts.remove(event->timerId());
        removeSource(source);
        emit NotificationClosed(source.split(" ").last().toInt(), 1);
        return;
    }

    Plasma::DataEngine::timerEvent(event);
}
Ejemplo n.º 14
0
QDBusObjectPath KuiserverEngine::requestView(const QString &appName,
                                             const QString &appIconName, int capabilities)
{
    JobView *jobView = new JobView(this);
    jobView->setAppName(appName);
    jobView->setAppIconName(appIconName);
    jobView->setCapabilities(capabilities);
    connect(jobView, SIGNAL(becameUnused(QString)), this, SLOT(removeSource(QString)));

    m_pendingJobs << jobView;
    m_pendingJobsTimer.start();

    return jobView->objectPath();
}
Ejemplo n.º 15
0
void Server::incomingConnection( const qintptr socketHandle )
{
    QThread* workerThread = new QThread( this );
    ServerWorker* worker = new ServerWorker( socketHandle );

    worker->moveToThread( workerThread );

    connect( workerThread, SIGNAL( started( )),
             worker, SLOT( initConnection( )));
    connect( worker, SIGNAL( connectionClosed( )),
             workerThread, SLOT( quit( )));

    // Make sure the thread will be deleted
    connect( workerThread, SIGNAL( finished( )), worker, SLOT( deleteLater( )));
    connect( workerThread, SIGNAL( finished( )),
             workerThread, SLOT( deleteLater( )));

    // public signals/slots, forwarding from/to worker
    connect( worker, SIGNAL( registerToEvents( QString, bool,
                                               deflect::EventReceiver* )),
             this, SIGNAL( registerToEvents( QString, bool,
                                             deflect::EventReceiver* )));
    connect( this, SIGNAL( _pixelStreamerClosed( QString )),
             worker, SLOT( closeConnection( QString )));
    connect( this, SIGNAL( _eventRegistrationReply( QString, bool )),
             worker, SLOT( replyToEventRegistration( QString, bool )));

    // Commands
    connect( worker, SIGNAL( receivedCommand( QString, QString )),
             &_impl->commandHandler, SLOT( process( QString, QString )));

    // PixelStreamDispatcher
    connect( worker, SIGNAL( addStreamSource( QString, size_t )),
             &_impl->pixelStreamDispatcher, SLOT(addSource( QString, size_t )));
    connect( worker,
             SIGNAL( receivedSegement( QString, size_t, deflect::Segment )),
             &_impl->pixelStreamDispatcher,
             SLOT( processSegment( QString, size_t, deflect::Segment )));
    connect( worker,
             SIGNAL( receivedFrameFinished( QString, size_t )),
             &_impl->pixelStreamDispatcher,
             SLOT( processFrameFinished( QString, size_t )));
    connect( worker,
             SIGNAL( removeStreamSource( QString, size_t )),
             &_impl->pixelStreamDispatcher,
             SLOT( removeSource( QString, size_t )));

    workerThread->start();
}
Ejemplo n.º 16
0
 void Reader::close()
 {
   if(! m_is_initialised)
     return ;
   stopSourceAndUnQueueBuffers(m_source) ;
   alDeleteSources(1,&m_source) ;
   removeSource() ;
   m_source = 0 ;
   ALenum error = alGetError() ; 
   if (error != AL_NO_ERROR)
   {
     ErrorMessage("[OpenAL::OggReader] " + getErrorString(error)) ;
   }
   m_is_initialised = false ;
 }
Ejemplo n.º 17
0
/////////////////////////////////////////////////////////////////////////////////////////
// DefaultUnfoundedCheck - Finding & propagating unfounded sets
/////////////////////////////////////////////////////////////////////////////////////////
bool DefaultUnfoundedCheck::findUnfoundedSet() {
    // first: remove all sources that were recently falsified
    VarVec::size_type unpick = invalid_.size();
    for (VarVec::size_type i = 0; i != invalidExt_.size(); ++i) {
        uint32        id = invalidExt_[i] >> 1;
        ExtWatch::Type t = static_cast<ExtWatch::Type>(invalidExt_[i] & 1u);
        if (t == ExtWatch::watch_choice_false) {
            if (atoms_[id].hasSource() && !solver_->isFalse(graph_->getBodyNode(atoms_[id].watch()).lit)) {
                atoms_[id].markSourceInvalid();
                sourceQ_.push_back(id);
                propagateSource(true);
            }
        }
        else if (t == ExtWatch::watch_body_goal_false) {
            typedef DependencyGraph::BodyNode BodyNode;
            const ExtWatch& w = watches_[id];
            BodyData&       b = bodies_[w.bodyId];
            ExtData*      ext = extended_[b.lower_or_ext];
            const BodyNode& B = graph_->getBodyNode(w.bodyId);
            NodeId       pred = w.data >> 1;
            ext->removeFromWs(pred, B.pred_weight(pred, test_bit(w.data, 0) != 0));
            if (ext->lower > 0 && b.watches && b.picked == 0 && !solver_->isFalse(B.lit)) {
                invalid_.push_back(w.bodyId);
                b.picked = 1;
            }
        }
    }
    for (VarVec::size_type i = 0; i != invalid_.size(); ++i) {
        removeSource(invalid_[i]);
    }
    for (VarVec::size_type i = unpick; i != invalid_.size(); ++i) {
        bodies_[invalid_[i]].picked = 0;
    }
    invalid_.clear();
    invalidExt_.clear();
    assert(sourceQ_.empty() && unfounded_.empty());
    // second: try to re-establish sources.
    while (!todo_.empty()) {
        NodeId head = dequeueTodo();
        if (!atoms_[head].hasSource() && !solver_->isFalse(graph_->getAtomNode(head).lit) && !findSource(head)) {
            return true;  // found an unfounded set - contained in unfounded_
        }
        assert(sourceQ_.empty());
    }
    todo_.clear();
    return false;     // no unfounded sets
}
Ejemplo n.º 18
0
void PrintersEngine::printerRemoved(const QString &text,
                                    const QString &printerUri,
                                    const QString &printerName,
                                    uint printerState,
                                    const QString &printerStateReasons,
                                    bool printerIsAcceptingJobs)
{
    // REALLY? all these parameters just to say foo was deleted??
    Q_UNUSED(text)
    Q_UNUSED(printerUri)
    Q_UNUSED(printerState)
    Q_UNUSED(printerStateReasons)
    Q_UNUSED(printerIsAcceptingJobs)

    // Remove the printer source
    removeSource(printerName);
}
Ejemplo n.º 19
0
/*!
    Adjusts specific to \a specific.
 */
void QMofGeneralization::setSpecific(QMofClassifier *specific)
{
    // This is a read-write association end

    if (_specific != specific) {
        // Adjust subsetted properties
        removeSource(_specific);

        _specific = specific;
        if (specific && specific->asQModelingObject() && this->asQModelingObject())
            QObject::connect(specific->asQModelingObject(), SIGNAL(destroyed()), this->asQModelingObject(), SLOT(setSpecific()));

        // Adjust subsetted properties
        setOwner(specific);
        if (specific) {
            addSource(specific);
        }
    }
}
Ejemplo n.º 20
0
PrefWidget * KDBSearchEngine2::preferencesWidget(QWidget *parent)
{
    
    pw =  new KDB2PreferencesWidget(parent);
    kdDebug(0) << "new KDB2 preferences widget" << endl;
    setSettings();
    connect(pw,SIGNAL(restoreNow()),this,SLOT(setSettings()));
    connect(pw,SIGNAL(applyNow()),this,SLOT(updateSettings()));
    connect(pw,SIGNAL(destroyed()),this,SLOT(prefDestr()));

    
    connect(pw->dbpw->scanAll,SIGNAL(clicked()),this,SLOT(scanAllPressed()));
    connect(pw->dbpw->scanSource,SIGNAL(clicked()),this,SLOT(scanNowPressed()));
    connect(pw->dbpw->addSource,SIGNAL(clicked()),this,SLOT(addSource()));
    connect(pw->dbpw->editSource,SIGNAL(clicked()),this,SLOT(editSource()));
    connect(pw->dbpw->removeSource,SIGNAL(clicked()),this,SLOT(removeSource()));
    
    
    return pw;
}
Ejemplo n.º 21
0
void NotificationsEngine::userClosedNotification(uint id)
{
    removeSource(QString("notification %1").arg(id));
    emit NotificationClosed(id, 2);
}
OGRGDALImportExtension::OGRGDALImportExtension() :
  openfluid::builderext::PluggableModalExtension(), ui(new Ui::OGRGDALDialog),
  m_CurrentSrcIndex(-1), mp_PrecheckImportDlg(NULL)
{
  ui->setupUi(this);

  setWindowTitle(tr("Spatial data import (OGR/GDAL)"));

  ui->AddFileButton->setIcon(QIcon(":/ui/common/icons/add.png"));
  ui->AddFileButton->setIconSize(QSize(16,16));

  ui->AddWFSButton->setIcon(QIcon(":/ui/common/icons/add.png"));
  ui->AddWFSButton->setIconSize(QSize(16,16));

  ui->RemoveButton->setIcon(QIcon(":/ui/common/icons/remove.png"));
  ui->RemoveButton->setIconSize(QSize(16,16));

  ui->PrecheckButton->setEnabled(false);

  ui->ConfigTabWidget->setEnabled(false);
  ui->ConfigTabWidget->setCurrentIndex(0);

#if QT_VERSION < QT_VERSION_CHECK(5,0,0)
  ui->SourcesTableWidget->horizontalHeader()->setResizeMode(QHeaderView::ResizeToContents);
#else
  ui->SourcesTableWidget->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
#endif

  connect(ui->AddFileButton,SIGNAL(clicked()),this,SLOT(addFileSource()));
  connect(ui->AddWFSButton,SIGNAL(clicked()),this,SLOT(addWFSSource()));
  connect(ui->RemoveButton,SIGNAL(clicked()),this,SLOT(removeSource()));

  connect(ui->PrecheckButton,SIGNAL(clicked()),this,SLOT(runPrecheck()));

  connect(ui->SourcesTableWidget,SIGNAL(itemSelectionChanged()),this,SLOT(updateUI()));


  connect(ui->UnitsClassLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateUnitsClassInfos()));

  connect(ui->PcsOrdComboBox,SIGNAL(activated(int)),this,SLOT(updateUnitsPcsOrdInfos()));

  connect(ui->ToConnectComboBox,SIGNAL(activated(int)),this,SLOT(updateUnitsToConnInfos()));
  connect(ui->ChildofConnectComboBox,SIGNAL(activated(int)),this,SLOT(updateUnitsChildofConnInfos()));

  connect(ui->AttributesListWidget,SIGNAL(itemChanged(QListWidgetItem*)),
          this,SLOT(updateImportedFieldsInfos(QListWidgetItem*)));

  connect(ui->ComputeAreaCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsAreaComputeInfos()));
  connect(ui->ComputeAreaLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateAreaComputeAttrInfos()));

  connect(ui->ComputeLengthCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsLengthComputeInfos()));
  connect(ui->ComputeLengthLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateLengthComputeAttrInfos()));

  connect(ui->ComputeXCentroidCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsXCentroidComputeInfos()));
  connect(ui->ComputeXCentroidLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateXCentroidComputeAttrInfos()));

  connect(ui->ComputeYCentroidCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsYCentroidComputeInfos()));
  connect(ui->ComputeYCentroidLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateYCentroidComputeAttrInfos()));

  connect(ui->ComputeZCentroidCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsZCentroidComputeInfos()));
  connect(ui->ComputeZCentroidLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateZCentroidComputeAttrInfos()));

  connect(ui->DatasetImportCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsDatasetImportInfos()));
  connect(ui->DatasetImportLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateIsDatasetImportInfos()));
  connect(ui->DatastoreIDCheckBox,SIGNAL(toggled(bool)),this,SLOT(updateIsDatasetImportInfos()));
  connect(ui->DatastoreIDLineEdit,SIGNAL(textEdited(const QString&)),this,SLOT(updateIsDatasetImportInfos()));

  ui->ButtonBox->button(QDialogButtonBox::Apply)->setEnabled(false);
  connect(ui->ButtonBox,SIGNAL(clicked(QAbstractButton*)),this,SLOT(processButtonBoxClicked(QAbstractButton*)));

  ui->SourcesTableWidget->setFocus();
}
Ejemplo n.º 23
0
 void LocationModel::removeAllSources()
 {
     while(hasAnySource())
         removeSource(*mSources.begin());
 }
Ejemplo n.º 24
0
void Pool::stop(Source *source)
{
	thread::Lock lock(mutex);
	removeSource(source);
}
Ejemplo n.º 25
0
	void Pool::stop(Source * source)
	{
		LOCK(mutex);
		removeSource(source);
		UNLOCK(mutex);
	}
void XournalScheduler::removeSidebar(SidebarPreviewBaseEntry* preview)
{
	XOJ_CHECK_TYPE(XournalScheduler);

	removeSource(preview, JOB_TYPE_PREVIEW, JOB_PRIORITY_HIGH);
}
void XournalScheduler::removePage(PageView* view)
{
	XOJ_CHECK_TYPE(XournalScheduler);

	removeSource(view, JOB_TYPE_RENDER, JOB_PRIORITY_URGENT);
}