void VideosWindow::onSourceReady() { disconnect(mafwTrackerSource, SIGNAL(containerChanged(QString)), this, SLOT(onSourceReady())); connect(mafwTrackerSource, SIGNAL(containerChanged(QString)), this, SLOT(onContainerChanged(QString))); connect(mafwTrackerSource, SIGNAL(metadataChanged(QString)), this, SLOT(onMetadataChanged(QString))); selectView(); }
void MafwSourceAdapter::bind(MafwSource *source) { // Check if there is anything to do if (source == this->source) return; if (source) { // Unbind current source, if set, before proceeding if (this->source) bind(NULL); // Bind g_object_ref(source); g_signal_connect(source, "container-changed", G_CALLBACK(&onContainerChanged), static_cast<void*>(this)); g_signal_connect(source, "metadata-changed" , G_CALLBACK(&onMetadataChanged) , static_cast<void*>(this)); g_signal_connect(source, "updating" , G_CALLBACK(&onUpdating) , static_cast<void*>(this)); this->source = source; m_uuid = mafw_extension_get_uuid(MAFW_EXTENSION(source)); // Watch only for removals disconnect(MafwRegistryAdapter::get(), SIGNAL(sourceAdded(MafwSource*)), this, SLOT(onSourceAdded(MafwSource*))); connect(MafwRegistryAdapter::get(), SIGNAL(sourceRemoved(MafwSource*)), this, SLOT(onSourceRemoved(MafwSource*))); // Emit the signal in case something changed before the adapter got // reconnected after losing its source or to notify listeners about // readiness if this is the first time. emit containerChanged(uuid() + "::"); } else {
void SingleGenreView::browseGenre(QString objectId) { currentObjectId = objectId; connect(mafwTrackerSource, SIGNAL(containerChanged(QString)), this, SLOT(onContainerChanged(QString)), Qt::UniqueConnection); if (mafwTrackerSource->isReady()) listArtists(); }
VideosWindow::VideosWindow(QWidget *parent, MafwRegistryAdapter *mafwRegistry) : BrowserWindow(parent, mafwRegistry), mafwRegistry(mafwRegistry), mafwRenderer(mafwRegistry->renderer()), mafwTrackerSource(mafwRegistry->source(MafwRegistryAdapter::Tracker)), playlist(mafwRegistry->playlist()) { ui->objectList->setIconSize(QSize(64, 64)); ui->objectList->setDragDropMode(QAbstractItemView::NoDragDrop); ui->objectList->setMovement(QListView::Static); ui->objectList->setItemDelegate(new ThumbnailItemDelegate(ui->objectList)); objectProxyModel->setDynamicSortFilter(true); objectProxyModel->setFilterRole(UserRoleTitle); QActionGroup *sortByActionGroup = new QActionGroup(this); sortByDate = new QAction(tr("Date"), sortByActionGroup); sortByDate->setCheckable(true); sortByCategory = new QAction(tr("Category"), sortByActionGroup); sortByCategory->setCheckable(true); ui->windowMenu->addActions(sortByActionGroup->actions()); connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Enter), this), SIGNAL(activated()), this, SLOT(onContextMenuRequested())); connect(ui->windowMenu, SIGNAL(triggered(QAction*)), this, SLOT(onSortingChanged(QAction*))); connect(ui->objectList, SIGNAL(activated(QModelIndex)), this, SLOT(onVideoSelected(QModelIndex))); connect(ui->objectList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onContextMenuRequested(QPoint))); if (mafwTrackerSource->isReady()) { onSourceReady(); } else { connect(mafwTrackerSource, SIGNAL(containerChanged(QString)), this, SLOT(onSourceReady())); } }
void ShrinkToFitShapeContainerModel::finishedLayout() { m_maybeUpdate = true; containerChanged(q, KoShape::SizeChanged); m_maybeUpdate = false; }