PJ_DEF(pj_status_t) pj_grp_lock_t::pj_grp_lock_replace(pj_grp_lock_t *old_lock) { destroy_list = old_lock->destroy_list; for (QList<QPair<QObject*,QByteArray> >::ConstIterator it=destroy_list.constBegin(); it!=destroy_list.constEnd(); ++it) { connect(this,SIGNAL(aboutToDestroy()),(*it).first,(*it).second.data()); disconnect(old_lock,SIGNAL(aboutToDestroy()),(*it).first,(*it).second.data()); } old_lock->destroy_list.clear(); old_lock->deleteLater(); return PJ_SUCCESS; }
LipstickCompositor::LipstickCompositor() : QWaylandCompositor(this), m_totalWindowCount(0), m_nextWindowId(1), m_homeActive(true), m_shaderEffect(0), m_fullscreenSurface(0), m_directRenderingActive(false), m_topmostWindowId(0), m_screenOrientation(Qt::PrimaryOrientation), m_displayState(new MeeGo::QmDisplayState(this)), m_retainedSelection(0) { setColor(Qt::black); setRetainedSelectionEnabled(true); if (m_instance) qFatal("LipstickCompositor: Only one compositor instance per process is supported"); m_instance = this; QObject::connect(this, SIGNAL(frameSwapped()), this, SLOT(windowSwapped())); QObject::connect(this, SIGNAL(beforeSynchronizing()), this, SLOT(clearUpdateRequest())); connect(m_displayState, SIGNAL(displayStateChanged(MeeGo::QmDisplayState::DisplayState)), this, SLOT(reactOnDisplayStateChanges(MeeGo::QmDisplayState::DisplayState))); QObject::connect(HomeApplication::instance(), SIGNAL(aboutToDestroy()), this, SLOT(homeApplicationAboutToDestroy())); m_orientationSensor = new QOrientationSensor(this); QObject::connect(m_orientationSensor, SIGNAL(readingChanged()), this, SLOT(setScreenOrientationFromSensor())); if (!m_orientationSensor->connectToBackend()) { qWarning() << "Could not connect to the orientation sensor backend"; } else { if (!m_orientationSensor->start()) qWarning() << "Could not start the orientation sensor"; } emit HomeApplication::instance()->homeActiveChanged(); QDesktopServices::setUrlHandler("http", this, "openUrl"); QDesktopServices::setUrlHandler("https", this, "openUrl"); QDesktopServices::setUrlHandler("mailto", this, "openUrl"); connect(QGuiApplication::clipboard(), SIGNAL(dataChanged()), SLOT(clipboardDataChanged())); }
DataManager::~DataManager() { emit aboutToDestroy(); Q_FOREACH(SeafileApiRequest *req, reqs_) { req->deleteLater(); } }
HomeApplication::~HomeApplication() { emit aboutToDestroy(); delete volumeControl; delete screenLock; delete _mainWindowInstance; delete qmlEngine; }
PJ_DEF() pj_grp_lock_t::~pj_grp_lock_t() { for (QMap<int, pj_lock_t*>::ConstIterator it = lock_list.constBegin(); it!=lock_list.constEnd(); ++it) if (*it != own_lock) for (int i=0; i<owner_cnt; ++i) (*it)->pj_lock_release(); emit aboutToDestroy(); }
QGObject::~QGObject() { Q_D(QGObject); emit aboutToDestroy(this); if( d->own_gobj && d->gobject ) if( G_IS_OBJECT(d->gobject) ) g_object_unref( d->gobject ); delete d; }
PJ_DEF(pj_status_t) pj_grp_lock_t::pj_grp_lock_add_handler(QObject *handler, const char *member) { if (handler && member) { QPair<QObject *,QByteArray> pair(handler, member); if (destroy_list.contains(pair)) return PJ_EEXISTS; if (connect(this, SIGNAL(aboutToDestroy()), handler, member)) { destroy_list.append(pair); return PJ_SUCCESS; } else return PJ_EUNKNOWN; } else return PJ_EINVAL; }
LipstickCompositor::LipstickCompositor() : QWaylandQuickCompositor(this, 0, (QWaylandCompositor::ExtensionFlags)QWaylandCompositor::DefaultExtensions & ~QWaylandCompositor::QtKeyExtension) , m_totalWindowCount(0) , m_nextWindowId(1) , m_homeActive(true) , m_shaderEffect(0) , m_fullscreenSurface(0) , m_directRenderingActive(false) , m_topmostWindowId(0) , m_topmostWindowProcessId(0) , m_screenOrientation(Qt::PrimaryOrientation) , m_sensorOrientation(Qt::PrimaryOrientation) , m_displayState(0) , m_retainedSelection(0) , m_currentDisplayState(MeeGo::QmDisplayState::Unknown) , m_updatesEnabled(true) , m_completed(false) , m_onUpdatesDisabledUnfocusedWindowId(0) , m_keymap(0) , m_fakeRepaintTriggered(false) { setColor(Qt::black); setRetainedSelectionEnabled(true); addDefaultShell(); if (m_instance) qFatal("LipstickCompositor: Only one compositor instance per process is supported"); m_instance = this; m_orientationLock = new MGConfItem("/lipstick/orientationLock", this); connect(m_orientationLock, SIGNAL(valueChanged()), SIGNAL(orientationLockChanged())); // Load legacy settings from the config file and delete it from there QSettings legacySettings("nemomobile", "lipstick"); QString legacyOrientationKey("Compositor/orientationLock"); if (legacySettings.contains(legacyOrientationKey)) { m_orientationLock->set(legacySettings.value(legacyOrientationKey)); legacySettings.remove(legacyOrientationKey); } connect(this, SIGNAL(visibleChanged(bool)), this, SLOT(onVisibleChanged(bool))); QObject::connect(this, SIGNAL(afterRendering()), this, SLOT(windowSwapped())); QObject::connect(HomeApplication::instance(), SIGNAL(aboutToDestroy()), this, SLOT(homeApplicationAboutToDestroy())); connect(this, &QQuickWindow::afterRendering, this, &LipstickCompositor::readContent, Qt::DirectConnection); m_orientationSensor = new QOrientationSensor(this); QObject::connect(m_orientationSensor, SIGNAL(readingChanged()), this, SLOT(setScreenOrientationFromSensor())); if (!m_orientationSensor->connectToBackend()) { qWarning() << "Could not connect to the orientation sensor backend"; } else { if (!m_orientationSensor->start()) qWarning() << "Could not start the orientation sensor"; } emit HomeApplication::instance()->homeActiveChanged(); QDesktopServices::setUrlHandler("http", this, "openUrl"); QDesktopServices::setUrlHandler("https", this, "openUrl"); QDesktopServices::setUrlHandler("mailto", this, "openUrl"); connect(QGuiApplication::clipboard(), SIGNAL(dataChanged()), SLOT(clipboardDataChanged())); m_recorder = new LipstickRecorderManager; addGlobalInterface(m_recorder); addGlobalInterface(new AlienManagerGlobal); HwcRenderStage::initialize(this); setUpdatesEnabled(false); QTimer::singleShot(0, this, SLOT(initialize())); }
void DataManager::setupTaskCleanup(FileNetworkTask *task) { connect(this, SIGNAL(aboutToDestroy()), task, SLOT(cancel())); }