Пример #1
0
void
GeoImageList::clear()
{
  setAutoDelete(TRUE);
  QDict < GeoImage >::clear();
  list_.clear();
  setAutoDelete(FALSE);
  minMaxResUptodate_ = false;
}
Пример #2
0
void TreeLeaf::setInitialSettings(int i_parent_id, const QString &str_name, int i_tree_id)
{
    setAutoDelete(false); //do not delete instance of the object after the "run" execution
    setItemColor();
    //
    m_iParentID = i_parent_id;  // id of the parent node (id_parent_node). For the trop-levels node it is 0
    //
    m_iDBTreeID = i_tree_id;
    //
    this->setText(0, str_name);
    //
    m_strDatabaseNodeName = str_name;
    //
    //if (0 == m_iParentID)
        this->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable|Qt::ItemIsEditable);
    //else
    //    this->setFlags(Qt::ItemIsEnabled|Qt::ItemIsSelectable|Qt::ItemIsEditable/*|Qt::ItemIsDropEnabled|Qt::ItemIsDragEnabled*/);
    //
    //no attachments requested yet.
    //
    m_bIsAttachmentRequestedAlready = false;
    //
    //force delete is disabled
    //
    m_bForceDelete = false;
}
Пример #3
0
//=============================================================================
//=============================================================================
KMFolderDir::KMFolderDir( KMFolder * owner, KMFolderDir* parent,
                          const QString& name, KMFolderDirType dirType )
  : KMFolderNode( parent, name ), KMFolderNodeList(),
    mOwner( owner ), mDirType( dirType )
{
  setAutoDelete( true );
}
Пример #4
0
TreeDiagram::TreeDiagram(ClassDef *root,bool doBases)
{
  setAutoDelete(TRUE); 
  DiagramRow *row=new DiagramRow(this,0);
  append(row);
  row->insertClass(0,root,doBases,Public,Normal,0);
}
Пример #5
0
bool qtractorInsertPluginCommand::undo (void)
{
	qtractorPlugin *pPlugin = plugins().first();
	if (pPlugin == NULL)
		return false;

	qtractorSession *pSession = qtractorSession::getInstance();
	if (pSession == NULL)
		return false;

	// Save the previous track alright...
	qtractorPluginList *pPluginList = pPlugin->list();
	if (pPluginList == NULL)
		return false;

//	pSession->lock();

	qtractorPlugin *pNextPlugin = pPlugin->next();

	// Insert it...
	pPluginList->removePlugin(pPlugin);

	// Swap it nice, finally.
	m_pNextPlugin = pNextPlugin;

	// Whether to allow the disposal of the plugin reference.
	setAutoDelete(true);

//	pSession->unlock();

	return true;
}
Пример #6
0
ScatterPlot::ScatterPlot(Context *context) : context(context)
{
    setAutoDelete(false); // no don't delete on detach !
    curve = NULL;
    curve2 = NULL;
    hover = NULL;
    hover2 = NULL;
    grid = NULL;
    ride = NULL;
    static_cast<QwtPlotCanvas*>(canvas())->setFrameStyle(QFrame::NoFrame);

    setAxisMaxMinor(xBottom, 0);
    setAxisMaxMinor(yLeft, 0);

    QwtScaleDraw *sd = new QwtScaleDraw;
    sd->setTickLength(QwtScaleDiv::MajorTick, 3);
    setAxisScaleDraw(QwtPlot::xBottom, sd);

    sd = new QwtScaleDraw;
    sd->setTickLength(QwtScaleDiv::MajorTick, 3);
    sd->enableComponent(QwtScaleDraw::Ticks, false);
    sd->enableComponent(QwtScaleDraw::Backbone, false);
    setAxisScaleDraw(QwtPlot::yLeft, sd);

    connect(context, SIGNAL(configChanged(qint32)), this, SLOT(configChanged(qint32)));
    connect(context, SIGNAL(intervalHover(IntervalItem*)), this, SLOT(intervalHover(IntervalItem*)));

    // lets watch the mouse move...
    new mouseTracker(this);

    configChanged(CONFIG_APPEARANCE | CONFIG_GENERAL); // use latest wheelsize/cranklength and colors
}
Generic_Extractor::Generic_Extractor(void* z_context, const std::string& z_output_uri, const QString& file_path) : QRunnable()
{
	error.calling_method = "Generic_Extractor::Generic_Extractor";

	if ( z_context == NULL ) {
		error.msg = "z_context is NULL";

		throw error;;
	}

	if ( z_output_uri.empty() == true) {
		error.msg = "z_output_uri is empty";
		throw error;
	}

	if ( file_path.isEmpty() == true ) {
		error.msg = "file_path is empty";
		throw error;
	}

	zmq_context	= (zmq::context_t*) z_context;
	zmq_output_uri = z_output_uri;
	file = file_path;

	setAutoDelete(true);

	if ( autoDelete() == false ) {
		error.msg = "Cannot set autoDelete option";
		throw error;
	}
}
CoreAttributesList::~CoreAttributesList()
{
    if (autoDelete())
    {
        /* We need to make sure that the CoreAttributes are first removed from
         * the list and then deleted. */
        setAutoDelete(false);
        while (!isEmpty())
        {
            CoreAttributes* tp = getFirst();
            removeRef(tp);
            delete tp;
        }
        setAutoDelete(true);
    }
}
void DUChainControlFlowJob::init(const QString &jobName)
{
    setObjectName(i18n("Generating control flow graph for %1", jobName));
    setCapabilities(Killable);    
    setAutoDelete(false);
    ICore::self()->uiController()->registerStatus(this);
}
/*!
 * \brief SimulationManager::SimulationManager
 */
SimulationManager::SimulationManager() :
    masterRef( Master::getInstance() ),
    slaveRef( Slave::getInstance() ),
    environmentRef( Environment::getInstance() )
{
    setAutoDelete( false );
}
Пример #11
0
TPtrList::TPtrList(){
	setAutoDelete(true);
	first = 0;
	last = 0;
	current = 0;
	count = 0;
}
Пример #12
0
TPtrList::TPtrList(bool autodelete){
	setAutoDelete(autodelete);
	first = 0;
	last = 0;
	current = 0;
	count = 0;
}
Пример #13
0
EQPacketOPCode::EQPacketOPCode(uint16_t opcode, const QString& name)
  : m_opcode(opcode),
    m_implicitLen(0),
    m_name(name)
{
  setAutoDelete(true);
}
Пример #14
0
ScannerTask::ScannerTask(LibraryScanner* pScanner,
                         const ScannerGlobalPointer scannerGlobal)
        : m_pScanner(pScanner),
          m_scannerGlobal(scannerGlobal),
          m_success(false) {
    setAutoDelete(true);
}
Пример #15
0
Feed::Feed(RootItem *parent)
  : RootItem(parent), m_url(QString()), m_status(Normal), m_autoUpdateType(DefaultAutoUpdate),
    m_autoUpdateInitialInterval(DEFAULT_AUTO_UPDATE_INTERVAL), m_autoUpdateRemainingInterval(DEFAULT_AUTO_UPDATE_INTERVAL),
    m_totalCount(0), m_unreadCount(0) {
  setKind(RootItemKind::Feed);
  setAutoDelete(false);
}
Пример #16
0
/*!
  The constructor registers the QmvClass parent class, and populates itself
  with relevant QmvTupleAttribute objects.

  \param parent The parent class.
*/
QmvTuple::QmvTuple( QmvTuple * t )
{
    parent_class = t->parent_class;
    QDictIterator<QmvTupleAttribute> it_attribute(*t);
    while (it_attribute.current() )
    {
        QmvTupleAttribute * old_ta = it_attribute.current();
        QmvTupleAttribute * new_ta = new QmvTupleAttribute( this, old_ta->metaAttribute() );
            // do not copy unique indexes or system attributes
        if ( old_ta->accessMethod() != QmvAttribute::SystemAccess )
        {
                // Text primary keys can be munged, otherwise clear them
                // Non-key attributes are copied.
            if ( old_ta->attributeName() == parent_class->primaryKey() ||
                 old_ta->attributeName() == parent_class->userKey() )
                if ( old_ta->attributeType() == "text" )
                    new_ta->update( QString( "%1_COPY" ).arg(old_ta->currentValue()) );
                else
                    new_ta->update( QString( "" ) );
            else
                new_ta->update( old_ta->currentValue() );
        }
        insert( it_attribute.currentKey(), (QmvTupleAttribute *) new_ta);
        ++it_attribute;
    }
    setAutoDelete( TRUE );
    
}
Пример #17
0
bool KJob::exec()
{
    Q_D(KJob);
    // Usually this job would delete itself, via deleteLater() just after
    // emitting result() (unless configured otherwise). Since we use an event
    // loop below, that event loop will process the deletion event and we'll
    // have been deleted when exec() returns. This crashes, so temporarily
    // suspend autodeletion and manually do it afterwards.
    const bool wasAutoDelete = isAutoDelete();
    setAutoDelete( false );

    Q_ASSERT( ! d->eventLoop );

    QEventLoop loop( this );
    d->eventLoop = &loop;

    start();
    if( !d->isFinished ) {
        d->eventLoop->exec(QEventLoop::ExcludeUserInputEvents);
    }
    d->eventLoop = 0;

    if ( wasAutoDelete ) {
        deleteLater();
    }
    return ( d->error == NoError );
}
Пример #18
0
AsyncTask::AsyncTask()
    : QObject(nullptr),
      QRunnable()
{
    setAutoDelete(false);
    running = false;
}
Пример #19
0
// Track command methods.
bool qtractorTrackCommand::addTrack ( qtractorTrack *pAfterTrack )
{
#ifdef CONFIG_DEBUG
	qDebug("qtractorTrackCommand::addTrack(%p, %p)", m_pTrack, pAfterTrack);
#endif

	if (m_pTrack == NULL)
		return false;

	qtractorSession *pSession = m_pTrack->session();
	if (pSession == NULL)
		return false;

	qtractorMainForm *pMainForm = qtractorMainForm::getInstance();
	if (pMainForm == NULL)
		return false;

	qtractorTracks *pTracks = pMainForm->tracks();
	if (pTracks == NULL)
		return false;

	// Guess which item we're adding after...
	if (pAfterTrack == NULL)
		pAfterTrack = m_pTrack->prev();
	if (pAfterTrack == NULL)
		pAfterTrack = pSession->tracks().last();
	int iTrack = pSession->tracks().find(pAfterTrack) + 1;
	// Link the track into session...
	pSession->insertTrack(m_pTrack, pAfterTrack);
	// And the new track list view item too...
	qtractorTrackList *pTrackList = pTracks->trackList();
	iTrack = pTrackList->insertTrack(iTrack, m_pTrack);
	// Special MIDI track cases...
	if (m_pTrack->trackType() == qtractorTrack::Midi)
	    pTracks->updateMidiTrack(m_pTrack);

	// (Re)open all clips...
	qtractorClip *pClip = m_pTrack->clips().first();
	for ( ; pClip; pClip = pClip->next())
		pClip->open();

	// Mixer turn...
	qtractorMixer *pMixer = pMainForm->mixer();
	if (pMixer)
		pMixer->updateTracks(true);

	// Let the change get visible.
	pTrackList->setCurrentTrackRow(iTrack);

	// ATTN: MIDI controller map feedback.
	qtractorMidiControl *pMidiControl = qtractorMidiControl::getInstance();
	if (pMidiControl)
		pMidiControl->sendAllControllers(iTrack);

	// Avoid disposal of the track reference.
	setAutoDelete(false);

	return true;
}
Пример #20
0
SaveRunnable::SaveRunnable(Plasma::DataEngine *dataEngine, const QString &provider, const QString &path)
    : m_dataEngine(dataEngine),
      m_path(path)
{
    dataEngine->connectSource(provider, this);
    kDebug() << "saving to" << m_path;
    setAutoDelete(true);
}
Пример #21
0
EQPacketOPCode::EQPacketOPCode(const EQPacketOPCode& opcode)
  : m_opcode(opcode.m_opcode),
    m_implicitLen(opcode.m_implicitLen),
    m_name(opcode.m_name),
    m_updated(opcode.m_updated)
{
  setAutoDelete(true);
}
Пример #22
0
RenderThread::RenderThread(const QByteArray &contents, VectorShape::VectorType type,
                           const QSizeF &size, const QSize &boundingSize, qreal zoomX, qreal zoomY)
    : QObject(), QRunnable(),
      m_contents(contents), m_type(type),
      m_size(size), m_boundingSize(boundingSize), m_zoomX(zoomX), m_zoomY(zoomY)
{
    setAutoDelete(true);
}
Пример #23
0
NZMQT_INLINE PollingZMQContext::PollingZMQContext(QObject* parent_, int io_threads_)
    : super(parent_, io_threads_)
    , m_pollItemsMutex(QMutex::Recursive)
    , m_interval(NZMQT_POLLINGZMQCONTEXT_DEFAULT_POLLINTERVAL)
    , m_stopped(false)
{
    setAutoDelete(false);
}
Пример #24
0
ThreadTask::ThreadTask(QObject *caller, const char *callback)
	: taskCaller(caller), taskCallback(callback), cancelFlag(false)
{
	/* This restriction could be removed by making the courier thread-local */
	Q_ASSERT(caller->thread() == qApp->thread());

	setAutoDelete(false);
	ThreadTaskCourier::addTask(caller);
}
Пример #25
0
AS_NAMESPACE_START

Runnable::Runnable(QObject *p)
    : QObject(p)
{
    _connections << connect(this, SIGNAL(runnableStarted()), p, SLOT(onRunnableStarted()), Qt::QueuedConnection);
    _connections << connect(this, SIGNAL(runnableStopped()), p, SLOT(onRunnableStopped()), Qt::QueuedConnection);
    setAutoDelete(false);
}
Пример #26
0
 CaptureTask(VideoCapture* c)
     : cap(c)
     , save(true)
     , original_fmt(false)
     , quality(-1)
     , format(QStringLiteral("PNG"))
     , qfmt(QImage::Format_ARGB32)
 {
     setAutoDelete(true);
 }
Пример #27
0
UdpWorkerThread::UdpWorkerThread(UdpWorkerThreadPool *threadPool) :
    ownPool_(threadPool),
    timeoutChecker_(this)
{
    setAutoDelete(true);
    // 启用超时检测
    timeoutChecker_.setTimeoutSecs(iseApp().iseOptions().getUdpWorkerThreadTimeout());

    ownPool_->registerThread(this);
}
Пример #28
0
bool qtractorTrackCommand::removeTrack (void)
{
#ifdef CONFIG_DEBUG
	qDebug("qtractorTrackCommand::removeTrack(%p)", m_pTrack);
#endif

	if (m_pTrack == NULL)
		return false;

	qtractorSession *pSession = m_pTrack->session();
	if (pSession == NULL)
		return false;

	qtractorMainForm *pMainForm = qtractorMainForm::getInstance();
	if (pMainForm == NULL)
		return false;

	qtractorTracks *pTracks = pMainForm->tracks();
	if (pTracks == NULL)
		return false;

	// Get the list view item reference of the intended track...
	int iTrack = pSession->tracks().find(m_pTrack);
	if (iTrack < 0)
		return false;

	// Close all clips...
	qtractorClip *pClip = m_pTrack->clips().last();
	for ( ; pClip; pClip = pClip->prev())
		pClip->close();

	// Second, remove from session...
	pSession->unlinkTrack(m_pTrack);

	// Third, remove track from list view...
	qtractorTrackList *pTrackList = pTracks->trackList();
	iTrack = pTrackList->removeTrack(iTrack);
	if (iTrack >= 0)
		pTrackList->setCurrentTrackRow(iTrack);

	// Mixer turn...
	qtractorMixer *pMixer = pMainForm->mixer();
	if (pMixer)
		pMixer->updateTracks();

	// ATTN: MIDI controller map feedback.
	qtractorMidiControl *pMidiControl = qtractorMidiControl::getInstance();
	if (pMidiControl)
		pMidiControl->sendAllControllers(iTrack);

	// Make ths track reference disposable.
	setAutoDelete(true);

	return true;
}
Пример #29
0
/*!
 * \brief Processor::Processor
 * \param parent
 */
VideoProcessor::VideoProcessor(QObject* parent) : 
    QObject(parent), 
    range(-1, -1),
    stop(false),
    autodetection(false)
{
    lightDetector = new LightDetector(this);
    readSettings();
    setAutoDelete(false);
    connect(lightDetector, SIGNAL(progress(int)), this, SIGNAL(progress(int)));
}
Пример #30
0
ColorSchemaList::ColorSchemaList() :
  QPtrList<ColorSchema> ()
{
//  KONSOLEDEBUG << "Got new color list" << endl;

  defaultSchema = new ColorSchema();
  append(defaultSchema);
  setAutoDelete(true);

  ColorSchema::serial=1;   // Needed for detached sessions
}