void DiskLocation::fetchItems(QDir::Filter dirFilter, bool recursive) { DirListWorker *dlw = new DirListWorker(m_info->absoluteFilePath(), dirFilter, recursive); connect(dlw, SIGNAL(itemsAdded(DirItemInfoList)), this, SIGNAL(itemsAdded(DirItemInfoList))); connect(dlw, SIGNAL(workerFinished()), this, SLOT(onItemsFetched())); workerThread()->addRequest(dlw); }
/*! * Adds the items specified by \a items to the end of the array. * * Returns the index of the first added item. */ int QScatterDataProxy::addItems(const QScatterDataArray &items) { int addIndex = dptr()->addItems(items); emit itemsAdded(addIndex, items.size()); emit itemCountChanged(itemCount()); return addIndex; }
/*! * Adds the item \a item to the end of the array. * * Returns the index of the added item. */ int QScatterDataProxy::addItem(const QScatterDataItem &item) { int addIndex = dptr()->addItem(item); emit itemsAdded(addIndex, 1); emit itemCountChanged(itemCount()); return addIndex; }
void QOrganizerManager::createEngine(const QString& managerName, const QMap<QString, QString>& parameters) { d->createEngine(managerName, parameters); connect(d->m_engine, SIGNAL(dataChanged()), this, SIGNAL(dataChanged())); connect(d->m_engine, SIGNAL(itemsAdded(QList<QOrganizerItemId>)), this, SIGNAL(itemsAdded(QList<QOrganizerItemId>))); connect(d->m_engine, SIGNAL(itemsChanged(QList<QOrganizerItemId>)), this, SIGNAL(itemsChanged(QList<QOrganizerItemId>))); connect(d->m_engine, SIGNAL(itemsRemoved(QList<QOrganizerItemId>)), this, SIGNAL(itemsRemoved(QList<QOrganizerItemId>))); connect(d->m_engine, SIGNAL(collectionsAdded(QList<QOrganizerCollectionId>)), this, SIGNAL(collectionsAdded(QList<QOrganizerCollectionId>))); connect(d->m_engine, SIGNAL(collectionsChanged(QList<QOrganizerCollectionId>)), this, SIGNAL(collectionsChanged(QList<QOrganizerCollectionId>))); connect(d->m_engine, SIGNAL(collectionsRemoved(QList<QOrganizerCollectionId>)), this, SIGNAL(collectionsRemoved(QList<QOrganizerCollectionId>))); connect(d->m_engine, SIGNAL(itemsChanged(QList<QOrganizerItemId>)), this, SLOT(_q_itemsUpdated(QList<QOrganizerItemId>))); connect(d->m_engine, SIGNAL(itemsRemoved(QList<QOrganizerItemId>)), this, SLOT(_q_itemsDeleted(QList<QOrganizerItemId>))); }
DirModel::DirModel(QObject *parent) : DirItemAbstractListModel(parent) , mFilterDirectories(false) , mShowDirectories(true) , mAwaitingResults(false) , mIsRecursive(false) , mReadsMediaMetadata(false) , mShowHiddenFiles(false) , mOnlyAllowedPaths(false) , mSortBy(SortByName) , mSortOrder(SortAscending) , mCompareFunction(0) , mExtFSWatcher(false) , mClipboard(new Clipboard(this)) , mLocationFactory(new LocationsFactory(this)) , mCurLocation(0) , m_fsAction(new FileSystemAction(this) ) { mNameFilters = QStringList() << "*"; mSelection = new DirSelection(this, &mDirectoryContents); connect(m_fsAction, SIGNAL(progress(int,int,int)), this, SIGNAL(progress(int,int,int))); connect(m_fsAction, SIGNAL(added(DirItemInfo)), this, SLOT(onItemAdded(DirItemInfo))); connect(m_fsAction, SIGNAL(added(QString)), this, SLOT(onItemAdded(QString))); connect(m_fsAction, SIGNAL(removed(DirItemInfo)), this, SLOT(onItemRemoved(DirItemInfo))); connect(m_fsAction, SIGNAL(removed(QString)), this, SLOT(onItemRemoved(QString))); connect(m_fsAction, SIGNAL(error(QString,QString)), this, SIGNAL(error(QString,QString))); connect(this, SIGNAL(pathChanged(QString)), m_fsAction, SLOT(pathChanged(QString))); connect(mClipboard, SIGNAL(clipboardChanged()), this, SIGNAL(clipboardChanged())); connect(m_fsAction, SIGNAL(changed(DirItemInfo)), this, SLOT(onItemChanged(DirItemInfo))); connect(mClipboard, SIGNAL(clipboardChanged()), m_fsAction, SLOT(onClipboardChanged())); connect(m_fsAction, SIGNAL(recopy(QStringList,QString)), mClipboard, SLOT(copy(QStringList,QString))); setCompareAndReorder(); if (QIcon::themeName().isEmpty() && !FMUtil::hasTriedThemeName()) { FMUtil::setThemeName(); } foreach (const Location* l, mLocationFactory->availableLocations()) { connect(l, SIGNAL(itemsAdded(DirItemInfoList)), this, SLOT(onItemsAdded(DirItemInfoList))); connect(l, SIGNAL(itemsFetched()), this, SLOT(onItemsFetched())); connect(l, SIGNAL(extWatcherItemAdded(DirItemInfo)), this, SLOT(onItemAddedOutsideFm(DirItemInfo))); connect(l, SIGNAL(extWatcherItemRemoved(DirItemInfo)), this, SLOT(onItemRemovedOutSideFm(DirItemInfo))); connect(l, SIGNAL(extWatcherItemChanged(DirItemInfo)), this, SLOT(onItemChangedOutSideFm(DirItemInfo))); connect(l, SIGNAL(extWatcherChangesFetched(int)), this, SLOT(onExternalFsWorkerFinished(int))); connect(l, SIGNAL(extWatcherPathChanged(QString)), this, SLOT(onThereAreExternalChanges(QString))); connect(this, SIGNAL(enabledExternalFSWatcherChanged(bool)), l, SLOT(setUsingExternalWatcher(bool))); } }