mirror of
https://invent.kde.org/system/dolphin
synced 2024-08-22 09:50:12 +00:00
dolphin: convert kitemviews/ to qt5 signal slot syntax
This conversion was performed automatically using convert2qt5signalslot. The only manual changes required were changing the overloaded signal KDirLister::redirection and KDirLister::completed from KUrl to QUrl. All other cases were no problem since these signals are not overloaded and a static_cast for disambiguation is not necessary. Code inside HAVE_BALOO is not converted yet, will do that once I can build a version with Baloo.
This commit is contained in:
parent
1ee5cd6488
commit
bb642c92d3
|
@ -64,12 +64,12 @@ KFileItemListView::KFileItemListView(QGraphicsWidget* parent) :
|
|||
m_updateVisibleIndexRangeTimer = new QTimer(this);
|
||||
m_updateVisibleIndexRangeTimer->setSingleShot(true);
|
||||
m_updateVisibleIndexRangeTimer->setInterval(ShortInterval);
|
||||
connect(m_updateVisibleIndexRangeTimer, SIGNAL(timeout()), this, SLOT(updateVisibleIndexRange()));
|
||||
connect(m_updateVisibleIndexRangeTimer, &QTimer::timeout, this, &KFileItemListView::updateVisibleIndexRange);
|
||||
|
||||
m_updateIconSizeTimer = new QTimer(this);
|
||||
m_updateIconSizeTimer->setSingleShot(true);
|
||||
m_updateIconSizeTimer->setInterval(LongInterval);
|
||||
connect(m_updateIconSizeTimer, SIGNAL(timeout()), this, SLOT(updateIconSize()));
|
||||
connect(m_updateIconSizeTimer, &QTimer::timeout, this, &KFileItemListView::updateIconSize);
|
||||
|
||||
setVisibleRoles(QList<QByteArray>() << "text");
|
||||
}
|
||||
|
|
|
@ -69,17 +69,17 @@ KFileItemModel::KFileItemModel(QObject* parent) :
|
|||
m_dirLister->setMainWindow(parentWidget->window());
|
||||
}
|
||||
|
||||
connect(m_dirLister, SIGNAL(started(KUrl)), this, SIGNAL(directoryLoadingStarted()));
|
||||
connect(m_dirLister, SIGNAL(canceled()), this, SLOT(slotCanceled()));
|
||||
connect(m_dirLister, SIGNAL(completed(KUrl)), this, SLOT(slotCompleted()));
|
||||
connect(m_dirLister, SIGNAL(itemsAdded(KUrl,KFileItemList)), this, SLOT(slotItemsAdded(KUrl,KFileItemList)));
|
||||
connect(m_dirLister, SIGNAL(itemsDeleted(KFileItemList)), this, SLOT(slotItemsDeleted(KFileItemList)));
|
||||
connect(m_dirLister, SIGNAL(refreshItems(QList<QPair<KFileItem,KFileItem> >)), this, SLOT(slotRefreshItems(QList<QPair<KFileItem,KFileItem> >)));
|
||||
connect(m_dirLister, SIGNAL(clear()), this, SLOT(slotClear()));
|
||||
connect(m_dirLister, SIGNAL(infoMessage(QString)), this, SIGNAL(infoMessage(QString)));
|
||||
connect(m_dirLister, SIGNAL(errorMessage(QString)), this, SIGNAL(errorMessage(QString)));
|
||||
connect(m_dirLister, SIGNAL(redirection(KUrl,KUrl)), this, SIGNAL(directoryRedirection(KUrl,KUrl)));
|
||||
connect(m_dirLister, SIGNAL(urlIsFileError(KUrl)), this, SIGNAL(urlIsFileError(KUrl)));
|
||||
connect(m_dirLister, &KFileItemModelDirLister::started, this, &KFileItemModel::directoryLoadingStarted);
|
||||
connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)()>(&KFileItemModelDirLister::canceled), this, &KFileItemModel::slotCanceled);
|
||||
connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)(const QUrl&)>(&KFileItemModelDirLister::completed), this, &KFileItemModel::slotCompleted);
|
||||
connect(m_dirLister, &KFileItemModelDirLister::itemsAdded, this, &KFileItemModel::slotItemsAdded);
|
||||
connect(m_dirLister, &KFileItemModelDirLister::itemsDeleted, this, &KFileItemModel::slotItemsDeleted);
|
||||
connect(m_dirLister, &KFileItemModelDirLister::refreshItems, this, &KFileItemModel::slotRefreshItems);
|
||||
connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)()>(&KFileItemModelDirLister::clear), this, &KFileItemModel::slotClear);
|
||||
connect(m_dirLister, &KFileItemModelDirLister::infoMessage, this, &KFileItemModel::infoMessage);
|
||||
connect(m_dirLister, &KFileItemModelDirLister::errorMessage, this, &KFileItemModel::errorMessage);
|
||||
connect(m_dirLister, static_cast<void(KFileItemModelDirLister::*)(const QUrl&, const QUrl&)>(&KFileItemModelDirLister::redirection), this, &KFileItemModel::directoryRedirection);
|
||||
connect(m_dirLister, &KFileItemModelDirLister::urlIsFileError, this, &KFileItemModel::urlIsFileError);
|
||||
|
||||
// Apply default roles that should be determined
|
||||
resetRoles();
|
||||
|
@ -95,7 +95,7 @@ KFileItemModel::KFileItemModel(QObject* parent) :
|
|||
m_maximumUpdateIntervalTimer = new QTimer(this);
|
||||
m_maximumUpdateIntervalTimer->setInterval(2000);
|
||||
m_maximumUpdateIntervalTimer->setSingleShot(true);
|
||||
connect(m_maximumUpdateIntervalTimer, SIGNAL(timeout()), this, SLOT(dispatchPendingItemsToInsert()));
|
||||
connect(m_maximumUpdateIntervalTimer, &QTimer::timeout, this, &KFileItemModel::dispatchPendingItemsToInsert);
|
||||
|
||||
// When changing the value of an item which represents the sort-role a resorting must be
|
||||
// triggered. Especially in combination with KFileItemModelRolesUpdater this might be done
|
||||
|
@ -104,9 +104,10 @@ KFileItemModel::KFileItemModel(QObject* parent) :
|
|||
m_resortAllItemsTimer = new QTimer(this);
|
||||
m_resortAllItemsTimer->setInterval(500);
|
||||
m_resortAllItemsTimer->setSingleShot(true);
|
||||
connect(m_resortAllItemsTimer, SIGNAL(timeout()), this, SLOT(resortAllItems()));
|
||||
connect(m_resortAllItemsTimer, &QTimer::timeout, this, &KFileItemModel::resortAllItems);
|
||||
|
||||
connect(KGlobalSettings::self(), SIGNAL(naturalSortingChanged()), this, SLOT(slotNaturalSortingChanged()));
|
||||
connect(KGlobalSettings::self(), &KGlobalSettings::naturalSortingChanged,
|
||||
this, &KFileItemModel::slotNaturalSortingChanged);
|
||||
}
|
||||
|
||||
KFileItemModel::~KFileItemModel()
|
||||
|
|
|
@ -103,23 +103,23 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
|
|||
<< "imagethumbnail"
|
||||
<< "jpegthumbnail");
|
||||
|
||||
connect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
|
||||
this, SLOT(slotItemsInserted(KItemRangeList)));
|
||||
connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
|
||||
this, SLOT(slotItemsRemoved(KItemRangeList)));
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
|
||||
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
|
||||
connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
|
||||
connect(m_model, &KFileItemModel::itemsInserted,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsInserted);
|
||||
connect(m_model, &KFileItemModel::itemsRemoved,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsRemoved);
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
connect(m_model, &KFileItemModel::itemsMoved,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsMoved);
|
||||
connect(m_model, &KFileItemModel::sortRoleChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotSortRoleChanged);
|
||||
|
||||
// Use a timer to prevent that each call of slotItemsChanged() results in a synchronous
|
||||
// resolving of the roles. Postpone the resolving until no update has been done for 1 second.
|
||||
m_recentlyChangedItemsTimer = new QTimer(this);
|
||||
m_recentlyChangedItemsTimer->setInterval(1000);
|
||||
m_recentlyChangedItemsTimer->setSingleShot(true);
|
||||
connect(m_recentlyChangedItemsTimer, SIGNAL(timeout()), this, SLOT(resolveRecentlyChangedItems()));
|
||||
connect(m_recentlyChangedItemsTimer, &QTimer::timeout, this, &KFileItemModelRolesUpdater::resolveRecentlyChangedItems);
|
||||
|
||||
m_resolvableRoles.insert("size");
|
||||
m_resolvableRoles.insert("type");
|
||||
|
@ -129,8 +129,8 @@ KFileItemModelRolesUpdater::KFileItemModelRolesUpdater(KFileItemModel* model, QO
|
|||
#endif
|
||||
|
||||
m_directoryContentsCounter = new KDirectoryContentsCounter(m_model, this);
|
||||
connect(m_directoryContentsCounter, SIGNAL(result(QString,int)),
|
||||
this, SLOT(slotDirectoryContentsCountReceived(QString,int)));
|
||||
connect(m_directoryContentsCounter, &KDirectoryContentsCounter::result,
|
||||
this, &KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived);
|
||||
}
|
||||
|
||||
KFileItemModelRolesUpdater::~KFileItemModelRolesUpdater()
|
||||
|
@ -545,11 +545,11 @@ void KFileItemModelRolesUpdater::slotGotPreview(const KFileItem& item, const QPi
|
|||
|
||||
data.insert("iconPixmap", scaledPixmap);
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
m_model->setData(index, data);
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
|
||||
m_finishedItems.insert(item);
|
||||
}
|
||||
|
@ -567,11 +567,11 @@ void KFileItemModelRolesUpdater::slotPreviewFailed(const KFileItem& item)
|
|||
QHash<QByteArray, QVariant> data;
|
||||
data.insert("iconPixmap", QPixmap());
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
m_model->setData(index, data);
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
|
||||
applyResolvedRoles(index, ResolveAll);
|
||||
m_finishedItems.insert(item);
|
||||
|
@ -627,11 +627,11 @@ void KFileItemModelRolesUpdater::resolveNextSortRole()
|
|||
m_state = Idle;
|
||||
|
||||
// Prevent that we try to update the items twice.
|
||||
disconnect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
|
||||
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsMoved,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsMoved);
|
||||
applySortProgressToModel();
|
||||
connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
|
||||
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
|
||||
connect(m_model, &KFileItemModel::itemsMoved,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsMoved);
|
||||
startUpdating();
|
||||
}
|
||||
}
|
||||
|
@ -667,15 +667,15 @@ void KFileItemModelRolesUpdater::resolveNextPendingRoles()
|
|||
QHash<QByteArray, QVariant> data;
|
||||
data.insert("iconPixmap", QPixmap());
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
for (int index = 0; index <= m_model->count(); ++index) {
|
||||
if (m_model->data(index).contains("iconPixmap")) {
|
||||
m_model->setData(index, data);
|
||||
}
|
||||
}
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
|
||||
}
|
||||
m_clearPreviews = false;
|
||||
|
@ -764,11 +764,11 @@ void KFileItemModelRolesUpdater::slotDirectoryContentsCountReceived(const QStrin
|
|||
data.insert("isExpandable", count > 0);
|
||||
}
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
m_model->setData(index, data);
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -902,12 +902,12 @@ void KFileItemModelRolesUpdater::startPreviewJob()
|
|||
KJobWidgets::setWindow(job, qApp->activeWindow());
|
||||
}
|
||||
|
||||
connect(job, SIGNAL(gotPreview(KFileItem,QPixmap)),
|
||||
this, SLOT(slotGotPreview(KFileItem,QPixmap)));
|
||||
connect(job, SIGNAL(failed(KFileItem)),
|
||||
this, SLOT(slotPreviewFailed(KFileItem)));
|
||||
connect(job, SIGNAL(finished(KJob*)),
|
||||
this, SLOT(slotPreviewJobFinished()));
|
||||
connect(job, &KIO::PreviewJob::gotPreview,
|
||||
this, &KFileItemModelRolesUpdater::slotGotPreview);
|
||||
connect(job, &KIO::PreviewJob::failed,
|
||||
this, &KFileItemModelRolesUpdater::slotPreviewFailed);
|
||||
connect(job, &KIO::PreviewJob::finished,
|
||||
this, &KFileItemModelRolesUpdater::slotPreviewJobFinished);
|
||||
|
||||
m_previewJob = job;
|
||||
}
|
||||
|
@ -1000,11 +1000,11 @@ void KFileItemModelRolesUpdater::applySortRole(int index)
|
|||
data = rolesData(item);
|
||||
}
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
m_model->setData(index, data);
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
}
|
||||
|
||||
void KFileItemModelRolesUpdater::applySortProgressToModel()
|
||||
|
@ -1044,11 +1044,11 @@ bool KFileItemModelRolesUpdater::applyResolvedRoles(int index, ResolveHint hint)
|
|||
data.insert("iconPixmap", QPixmap());
|
||||
}
|
||||
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
m_model->setData(index, data);
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, &KFileItemModel::itemsChanged,
|
||||
this, &KFileItemModelRolesUpdater::slotItemsChanged);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -1101,12 +1101,12 @@ void KFileItemModelRolesUpdater::updateAllPreviews()
|
|||
void KFileItemModelRolesUpdater::killPreviewJob()
|
||||
{
|
||||
if (m_previewJob) {
|
||||
disconnect(m_previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
|
||||
this, SLOT(slotGotPreview(KFileItem,QPixmap)));
|
||||
disconnect(m_previewJob, SIGNAL(failed(KFileItem)),
|
||||
this, SLOT(slotPreviewFailed(KFileItem)));
|
||||
disconnect(m_previewJob, SIGNAL(finished(KJob*)),
|
||||
this, SLOT(slotPreviewJobFinished()));
|
||||
disconnect(m_previewJob, &KIO::PreviewJob::gotPreview,
|
||||
this, &KFileItemModelRolesUpdater::slotGotPreview);
|
||||
disconnect(m_previewJob, &KIO::PreviewJob::failed,
|
||||
this, &KFileItemModelRolesUpdater::slotPreviewFailed);
|
||||
disconnect(m_previewJob, &KIO::PreviewJob::finished,
|
||||
this, &KFileItemModelRolesUpdater::slotPreviewJobFinished);
|
||||
m_previewJob->kill();
|
||||
m_previewJob = 0;
|
||||
m_pendingPreviewItems.clear();
|
||||
|
|
|
@ -38,6 +38,10 @@ class KJob;
|
|||
class QPixmap;
|
||||
class QTimer;
|
||||
|
||||
namespace KIO {
|
||||
class PreviewJob;
|
||||
}
|
||||
|
||||
#ifdef HAVE_BALOO
|
||||
namespace Baloo
|
||||
{
|
||||
|
@ -316,7 +320,7 @@ private:
|
|||
// A new preview job will be started from them once the first one finishes.
|
||||
KFileItemList m_pendingPreviewItems;
|
||||
|
||||
KJob* m_previewJob;
|
||||
KIO::PreviewJob* m_previewJob;
|
||||
|
||||
// When downloading or copying large files, the slot slotItemsChanged()
|
||||
// will be called periodically within a quite short delay. To prevent
|
||||
|
|
|
@ -89,10 +89,10 @@ KItemListContainer::KItemListContainer(KItemListController* controller, QWidget*
|
|||
slotViewChanged(controller->view(), 0);
|
||||
}
|
||||
|
||||
connect(controller, SIGNAL(modelChanged(KItemModelBase*,KItemModelBase*)),
|
||||
this, SLOT(slotModelChanged(KItemModelBase*,KItemModelBase*)));
|
||||
connect(controller, SIGNAL(viewChanged(KItemListView*,KItemListView*)),
|
||||
this, SLOT(slotViewChanged(KItemListView*,KItemListView*)));
|
||||
connect(controller, &KItemListController::modelChanged,
|
||||
this, &KItemListContainer::slotModelChanged);
|
||||
connect(controller, &KItemListController::viewChanged,
|
||||
this, &KItemListContainer::slotViewChanged);
|
||||
}
|
||||
|
||||
KItemListContainer::~KItemListContainer()
|
||||
|
@ -211,23 +211,33 @@ void KItemListContainer::slotViewChanged(KItemListView* current, KItemListView*
|
|||
QGraphicsScene* scene = static_cast<QGraphicsView*>(viewport())->scene();
|
||||
if (previous) {
|
||||
scene->removeItem(previous);
|
||||
disconnect(previous, SIGNAL(scrollOrientationChanged(Qt::Orientation,Qt::Orientation)), this, SLOT(slotScrollOrientationChanged(Qt::Orientation,Qt::Orientation)));
|
||||
disconnect(previous, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
|
||||
disconnect(previous, SIGNAL(maximumScrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
|
||||
disconnect(previous, SIGNAL(itemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
|
||||
disconnect(previous, SIGNAL(maximumItemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
|
||||
disconnect(previous, SIGNAL(scrollTo(qreal)), this, SLOT(scrollTo(qreal)));
|
||||
disconnect(previous, &KItemListView::scrollOrientationChanged,
|
||||
this, &KItemListContainer::slotScrollOrientationChanged);
|
||||
disconnect(previous, &KItemListView::scrollOffsetChanged,
|
||||
this, &KItemListContainer::updateScrollOffsetScrollBar);
|
||||
disconnect(previous, &KItemListView::maximumScrollOffsetChanged,
|
||||
this, &KItemListContainer::updateScrollOffsetScrollBar);
|
||||
disconnect(previous, &KItemListView::itemOffsetChanged,
|
||||
this, &KItemListContainer::updateItemOffsetScrollBar);
|
||||
disconnect(previous, &KItemListView::maximumItemOffsetChanged,
|
||||
this, &KItemListContainer::updateItemOffsetScrollBar);
|
||||
disconnect(previous, &KItemListView::scrollTo, this, &KItemListContainer::scrollTo);
|
||||
m_horizontalSmoothScroller->setTargetObject(0);
|
||||
m_verticalSmoothScroller->setTargetObject(0);
|
||||
}
|
||||
if (current) {
|
||||
scene->addItem(current);
|
||||
connect(current, SIGNAL(scrollOrientationChanged(Qt::Orientation,Qt::Orientation)), this, SLOT(slotScrollOrientationChanged(Qt::Orientation,Qt::Orientation)));
|
||||
connect(current, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
|
||||
connect(current, SIGNAL(maximumScrollOffsetChanged(qreal,qreal)), this, SLOT(updateScrollOffsetScrollBar()));
|
||||
connect(current, SIGNAL(itemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
|
||||
connect(current, SIGNAL(maximumItemOffsetChanged(qreal,qreal)), this, SLOT(updateItemOffsetScrollBar()));
|
||||
connect(current, SIGNAL(scrollTo(qreal)), this, SLOT(scrollTo(qreal)));
|
||||
connect(current, &KItemListView::scrollOrientationChanged,
|
||||
this, &KItemListContainer::slotScrollOrientationChanged);
|
||||
connect(current, &KItemListView::scrollOffsetChanged,
|
||||
this, &KItemListContainer::updateScrollOffsetScrollBar);
|
||||
connect(current, &KItemListView::maximumScrollOffsetChanged,
|
||||
this, &KItemListContainer::updateScrollOffsetScrollBar);
|
||||
connect(current, &KItemListView::itemOffsetChanged,
|
||||
this, &KItemListContainer::updateItemOffsetScrollBar);
|
||||
connect(current, &KItemListView::maximumItemOffsetChanged,
|
||||
this, &KItemListContainer::updateItemOffsetScrollBar);
|
||||
connect(current, &KItemListView::scrollTo, this, &KItemListContainer::scrollTo);
|
||||
m_horizontalSmoothScroller->setTargetObject(current);
|
||||
m_verticalSmoothScroller->setTargetObject(current);
|
||||
updateSmoothScrollers(current->scrollOrientation());
|
||||
|
|
|
@ -61,15 +61,15 @@ KItemListController::KItemListController(KItemModelBase* model, KItemListView* v
|
|||
m_keyboardAnchorIndex(-1),
|
||||
m_keyboardAnchorPos(0)
|
||||
{
|
||||
connect(m_keyboardManager, SIGNAL(changeCurrentItem(QString,bool)),
|
||||
this, SLOT(slotChangeCurrentItem(QString,bool)));
|
||||
connect(m_selectionManager, SIGNAL(currentChanged(int,int)),
|
||||
m_keyboardManager, SLOT(slotCurrentChanged(int,int)));
|
||||
connect(m_keyboardManager, &KItemListKeyboardSearchManager::changeCurrentItem,
|
||||
this, &KItemListController::slotChangeCurrentItem);
|
||||
connect(m_selectionManager, &KItemListSelectionManager::currentChanged,
|
||||
m_keyboardManager, &KItemListKeyboardSearchManager::slotCurrentChanged);
|
||||
|
||||
m_autoActivationTimer = new QTimer(this);
|
||||
m_autoActivationTimer->setSingleShot(true);
|
||||
m_autoActivationTimer->setInterval(-1);
|
||||
connect(m_autoActivationTimer, SIGNAL(timeout()), this, SLOT(slotAutoActivationTimeout()));
|
||||
connect(m_autoActivationTimer, &QTimer::timeout, this, &KItemListController::slotAutoActivationTimeout);
|
||||
|
||||
setModel(model);
|
||||
setView(view);
|
||||
|
@ -127,7 +127,7 @@ void KItemListController::setView(KItemListView* view)
|
|||
|
||||
KItemListView* oldView = m_view;
|
||||
if (oldView) {
|
||||
disconnect(oldView, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(slotViewScrollOffsetChanged(qreal,qreal)));
|
||||
disconnect(oldView, &KItemListView::scrollOffsetChanged, this, &KItemListController::slotViewScrollOffsetChanged);
|
||||
oldView->deleteLater();
|
||||
}
|
||||
|
||||
|
@ -137,7 +137,7 @@ void KItemListController::setView(KItemListView* view)
|
|||
m_view->setParent(this);
|
||||
m_view->setController(this);
|
||||
m_view->setModel(m_model);
|
||||
connect(m_view, SIGNAL(scrollOffsetChanged(qreal,qreal)), this, SLOT(slotViewScrollOffsetChanged(qreal,qreal)));
|
||||
connect(m_view, &KItemListView::scrollOffsetChanged, this, &KItemListController::slotViewScrollOffsetChanged);
|
||||
updateExtendedSelectionRegion();
|
||||
}
|
||||
|
||||
|
@ -656,7 +656,7 @@ bool KItemListController::mousePressEvent(QGraphicsSceneMouseEvent* event, const
|
|||
rubberBand->setStartPosition(startPos);
|
||||
rubberBand->setEndPosition(startPos);
|
||||
rubberBand->setActive(true);
|
||||
connect(rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandChanged()));
|
||||
connect(rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListController::slotRubberBandChanged);
|
||||
m_view->setAutoScroll(true);
|
||||
}
|
||||
|
||||
|
@ -744,7 +744,7 @@ bool KItemListController::mouseReleaseEvent(QGraphicsSceneMouseEvent* event, con
|
|||
|
||||
KItemListRubberBand* rubberBand = m_view->rubberBand();
|
||||
if (rubberBand->isActive()) {
|
||||
disconnect(rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandChanged()));
|
||||
disconnect(rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListController::slotRubberBandChanged);
|
||||
rubberBand->setActive(false);
|
||||
m_oldSelection.clear();
|
||||
m_view->setAutoScroll(false);
|
||||
|
|
|
@ -81,8 +81,8 @@ KItemListHeader::KItemListHeader(KItemListView* listView) :
|
|||
m_headerWidget = m_view->m_headerWidget;
|
||||
Q_ASSERT(m_headerWidget);
|
||||
|
||||
connect(m_headerWidget, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
|
||||
this, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)));
|
||||
connect(m_headerWidget, &KItemListHeaderWidget::columnWidthChanged,
|
||||
this, &KItemListHeader::columnWidthChanged);
|
||||
}
|
||||
|
||||
#include "kitemlistheader.moc"
|
||||
|
|
|
@ -119,16 +119,16 @@ KItemListView::KItemListView(QGraphicsWidget* parent) :
|
|||
m_layouter = new KItemListViewLayouter(m_sizeHintResolver, this);
|
||||
|
||||
m_animation = new KItemListViewAnimation(this);
|
||||
connect(m_animation, SIGNAL(finished(QGraphicsWidget*,KItemListViewAnimation::AnimationType)),
|
||||
this, SLOT(slotAnimationFinished(QGraphicsWidget*,KItemListViewAnimation::AnimationType)));
|
||||
connect(m_animation, &KItemListViewAnimation::finished,
|
||||
this, &KItemListView::slotAnimationFinished);
|
||||
|
||||
m_layoutTimer = new QTimer(this);
|
||||
m_layoutTimer->setInterval(300);
|
||||
m_layoutTimer->setSingleShot(true);
|
||||
connect(m_layoutTimer, SIGNAL(timeout()), this, SLOT(slotLayoutTimerFinished()));
|
||||
connect(m_layoutTimer, &QTimer::timeout, this, &KItemListView::slotLayoutTimerFinished);
|
||||
|
||||
m_rubberBand = new KItemListRubberBand(this);
|
||||
connect(m_rubberBand, SIGNAL(activationChanged(bool)), this, SLOT(slotRubberBandActivationChanged(bool)));
|
||||
connect(m_rubberBand, &KItemListRubberBand::activationChanged, this, &KItemListView::slotRubberBandActivationChanged);
|
||||
|
||||
m_headerWidget = new KItemListHeaderWidget(this);
|
||||
m_headerWidget->setVisible(false);
|
||||
|
@ -272,7 +272,7 @@ void KItemListView::setAutoScroll(bool enabled)
|
|||
if (enabled && !m_autoScrollTimer) {
|
||||
m_autoScrollTimer = new QTimer(this);
|
||||
m_autoScrollTimer->setSingleShot(true);
|
||||
connect(m_autoScrollTimer, SIGNAL(timeout()), this, SLOT(triggerAutoScrolling()));
|
||||
connect(m_autoScrollTimer, &QTimer::timeout, this, &KItemListView::triggerAutoScrolling);
|
||||
m_autoScrollTimer->start(InitialAutoScrollDelay);
|
||||
} else if (!enabled && m_autoScrollTimer) {
|
||||
delete m_autoScrollTimer;
|
||||
|
@ -577,26 +577,26 @@ void KItemListView::setHeaderVisible(bool visible)
|
|||
m_headerWidget->setColumns(m_visibleRoles);
|
||||
m_headerWidget->setZValue(1);
|
||||
|
||||
connect(m_headerWidget, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
|
||||
this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
|
||||
connect(m_headerWidget, SIGNAL(columnMoved(QByteArray,int,int)),
|
||||
this, SLOT(slotHeaderColumnMoved(QByteArray,int,int)));
|
||||
connect(m_headerWidget, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
|
||||
this, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
|
||||
connect(m_headerWidget, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SIGNAL(sortRoleChanged(QByteArray,QByteArray)));
|
||||
connect(m_headerWidget, &KItemListHeaderWidget::columnWidthChanged,
|
||||
this, &KItemListView::slotHeaderColumnWidthChanged);
|
||||
connect(m_headerWidget, &KItemListHeaderWidget::columnMoved,
|
||||
this, &KItemListView::slotHeaderColumnMoved);
|
||||
connect(m_headerWidget, &KItemListHeaderWidget::sortOrderChanged,
|
||||
this, &KItemListView::sortOrderChanged);
|
||||
connect(m_headerWidget, &KItemListHeaderWidget::sortRoleChanged,
|
||||
this, &KItemListView::sortRoleChanged);
|
||||
|
||||
m_layouter->setHeaderHeight(headerSize.height());
|
||||
m_headerWidget->setVisible(true);
|
||||
} else if (!visible && m_headerWidget->isVisible()) {
|
||||
disconnect(m_headerWidget, SIGNAL(columnWidthChanged(QByteArray,qreal,qreal)),
|
||||
this, SLOT(slotHeaderColumnWidthChanged(QByteArray,qreal,qreal)));
|
||||
disconnect(m_headerWidget, SIGNAL(columnMoved(QByteArray,int,int)),
|
||||
this, SLOT(slotHeaderColumnMoved(QByteArray,int,int)));
|
||||
disconnect(m_headerWidget, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
|
||||
this, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
|
||||
disconnect(m_headerWidget, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SIGNAL(sortRoleChanged(QByteArray,QByteArray)));
|
||||
disconnect(m_headerWidget, &KItemListHeaderWidget::columnWidthChanged,
|
||||
this, &KItemListView::slotHeaderColumnWidthChanged);
|
||||
disconnect(m_headerWidget, &KItemListHeaderWidget::columnMoved,
|
||||
this, &KItemListView::slotHeaderColumnMoved);
|
||||
disconnect(m_headerWidget, &KItemListHeaderWidget::sortOrderChanged,
|
||||
this, &KItemListView::sortOrderChanged);
|
||||
disconnect(m_headerWidget, &KItemListHeaderWidget::sortRoleChanged,
|
||||
this, &KItemListView::sortRoleChanged);
|
||||
|
||||
m_layouter->setHeaderHeight(0);
|
||||
m_headerWidget->setVisible(false);
|
||||
|
@ -642,10 +642,10 @@ void KItemListView::editRole(int index, const QByteArray& role)
|
|||
m_editingRole = true;
|
||||
widget->setEditedRole(role);
|
||||
|
||||
connect(widget, SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingCanceled(int,QByteArray,QVariant)));
|
||||
connect(widget, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
|
||||
connect(widget, &KItemListWidget::roleEditingCanceled,
|
||||
this, &KItemListView::slotRoleEditingCanceled);
|
||||
connect(widget, &KItemListWidget::roleEditingFinished,
|
||||
this, &KItemListView::slotRoleEditingFinished);
|
||||
}
|
||||
|
||||
void KItemListView::paint(QPainter* painter, const QStyleOptionGraphicsItem* option, QWidget* widget)
|
||||
|
@ -1375,12 +1375,12 @@ void KItemListView::slotRubberBandPosChanged()
|
|||
void KItemListView::slotRubberBandActivationChanged(bool active)
|
||||
{
|
||||
if (active) {
|
||||
connect(m_rubberBand, SIGNAL(startPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
|
||||
connect(m_rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
|
||||
connect(m_rubberBand, &KItemListRubberBand::startPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
|
||||
connect(m_rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
|
||||
m_skipAutoScrollForRubberBand = true;
|
||||
} else {
|
||||
disconnect(m_rubberBand, SIGNAL(startPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
|
||||
disconnect(m_rubberBand, SIGNAL(endPositionChanged(QPointF,QPointF)), this, SLOT(slotRubberBandPosChanged()));
|
||||
disconnect(m_rubberBand, &KItemListRubberBand::startPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
|
||||
disconnect(m_rubberBand, &KItemListRubberBand::endPositionChanged, this, &KItemListView::slotRubberBandPosChanged);
|
||||
m_skipAutoScrollForRubberBand = false;
|
||||
}
|
||||
|
||||
|
@ -1507,16 +1507,16 @@ void KItemListView::setController(KItemListController* controller)
|
|||
KItemListController* previous = m_controller;
|
||||
if (previous) {
|
||||
KItemListSelectionManager* selectionManager = previous->selectionManager();
|
||||
disconnect(selectionManager, SIGNAL(currentChanged(int,int)), this, SLOT(slotCurrentChanged(int,int)));
|
||||
disconnect(selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)), this, SLOT(slotSelectionChanged(KItemSet,KItemSet)));
|
||||
disconnect(selectionManager, &KItemListSelectionManager::currentChanged, this, &KItemListView::slotCurrentChanged);
|
||||
disconnect(selectionManager, &KItemListSelectionManager::selectionChanged, this, &KItemListView::slotSelectionChanged);
|
||||
}
|
||||
|
||||
m_controller = controller;
|
||||
|
||||
if (controller) {
|
||||
KItemListSelectionManager* selectionManager = controller->selectionManager();
|
||||
connect(selectionManager, SIGNAL(currentChanged(int,int)), this, SLOT(slotCurrentChanged(int,int)));
|
||||
connect(selectionManager, SIGNAL(selectionChanged(KItemSet,KItemSet)), this, SLOT(slotSelectionChanged(KItemSet,KItemSet)));
|
||||
connect(selectionManager, &KItemListSelectionManager::currentChanged, this, &KItemListView::slotCurrentChanged);
|
||||
connect(selectionManager, &KItemListSelectionManager::selectionChanged, this, &KItemListView::slotSelectionChanged);
|
||||
}
|
||||
|
||||
onControllerChanged(controller, previous);
|
||||
|
@ -1532,22 +1532,22 @@ void KItemListView::setModel(KItemModelBase* model)
|
|||
KItemModelBase* previous = m_model;
|
||||
|
||||
if (m_model) {
|
||||
disconnect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
disconnect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
|
||||
this, SLOT(slotItemsInserted(KItemRangeList)));
|
||||
disconnect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
|
||||
this, SLOT(slotItemsRemoved(KItemRangeList)));
|
||||
disconnect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
|
||||
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
|
||||
disconnect(m_model, SIGNAL(groupsChanged()),
|
||||
this, SLOT(slotGroupsChanged()));
|
||||
disconnect(m_model, SIGNAL(groupedSortingChanged(bool)),
|
||||
this, SLOT(slotGroupedSortingChanged(bool)));
|
||||
disconnect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
|
||||
this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
|
||||
disconnect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
|
||||
disconnect(m_model, &KItemModelBase::itemsChanged,
|
||||
this, &KItemListView::slotItemsChanged);
|
||||
disconnect(m_model, &KItemModelBase::itemsInserted,
|
||||
this, &KItemListView::slotItemsInserted);
|
||||
disconnect(m_model, &KItemModelBase::itemsRemoved,
|
||||
this, &KItemListView::slotItemsRemoved);
|
||||
disconnect(m_model, &KItemModelBase::itemsMoved,
|
||||
this, &KItemListView::slotItemsMoved);
|
||||
disconnect(m_model, &KItemModelBase::groupsChanged,
|
||||
this, &KItemListView::slotGroupsChanged);
|
||||
disconnect(m_model, &KItemModelBase::groupedSortingChanged,
|
||||
this, &KItemListView::slotGroupedSortingChanged);
|
||||
disconnect(m_model, &KItemModelBase::sortOrderChanged,
|
||||
this, &KItemListView::slotSortOrderChanged);
|
||||
disconnect(m_model, &KItemModelBase::sortRoleChanged,
|
||||
this, &KItemListView::slotSortRoleChanged);
|
||||
|
||||
m_sizeHintResolver->itemsRemoved(KItemRangeList() << KItemRange(0, m_model->count()));
|
||||
}
|
||||
|
@ -1557,22 +1557,22 @@ void KItemListView::setModel(KItemModelBase* model)
|
|||
m_grouped = model->groupedSorting();
|
||||
|
||||
if (m_model) {
|
||||
connect(m_model, SIGNAL(itemsChanged(KItemRangeList,QSet<QByteArray>)),
|
||||
this, SLOT(slotItemsChanged(KItemRangeList,QSet<QByteArray>)));
|
||||
connect(m_model, SIGNAL(itemsInserted(KItemRangeList)),
|
||||
this, SLOT(slotItemsInserted(KItemRangeList)));
|
||||
connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
|
||||
this, SLOT(slotItemsRemoved(KItemRangeList)));
|
||||
connect(m_model, SIGNAL(itemsMoved(KItemRange,QList<int>)),
|
||||
this, SLOT(slotItemsMoved(KItemRange,QList<int>)));
|
||||
connect(m_model, SIGNAL(groupsChanged()),
|
||||
this, SLOT(slotGroupsChanged()));
|
||||
connect(m_model, SIGNAL(groupedSortingChanged(bool)),
|
||||
this, SLOT(slotGroupedSortingChanged(bool)));
|
||||
connect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
|
||||
this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
|
||||
connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
|
||||
connect(m_model, &KItemModelBase::itemsChanged,
|
||||
this, &KItemListView::slotItemsChanged);
|
||||
connect(m_model, &KItemModelBase::itemsInserted,
|
||||
this, &KItemListView::slotItemsInserted);
|
||||
connect(m_model, &KItemModelBase::itemsRemoved,
|
||||
this, &KItemListView::slotItemsRemoved);
|
||||
connect(m_model, &KItemModelBase::itemsMoved,
|
||||
this, &KItemListView::slotItemsMoved);
|
||||
connect(m_model, &KItemModelBase::groupsChanged,
|
||||
this, &KItemListView::slotGroupsChanged);
|
||||
connect(m_model, &KItemModelBase::groupedSortingChanged,
|
||||
this, &KItemListView::slotGroupedSortingChanged);
|
||||
connect(m_model, &KItemModelBase::sortOrderChanged,
|
||||
this, &KItemListView::slotSortOrderChanged);
|
||||
connect(m_model, &KItemModelBase::sortRoleChanged,
|
||||
this, &KItemListView::slotSortRoleChanged);
|
||||
|
||||
const int itemCount = m_model->count();
|
||||
if (itemCount > 0) {
|
||||
|
@ -1981,7 +1981,7 @@ void KItemListView::updateGroupHeaderForWidget(KItemListWidget* widget)
|
|||
groupHeader = groupHeaderCreator()->create(this);
|
||||
groupHeader->setParentItem(widget);
|
||||
m_visibleGroups.insert(widget, groupHeader);
|
||||
connect(widget, SIGNAL(geometryChanged()), this, SLOT(slotGeometryOfGroupHeaderParentChanged()));
|
||||
connect(widget, &KItemListWidget::geometryChanged, this, &KItemListView::slotGeometryOfGroupHeaderParentChanged);
|
||||
}
|
||||
Q_ASSERT(groupHeader->parentItem() == widget);
|
||||
|
||||
|
@ -2028,7 +2028,7 @@ void KItemListView::recycleGroupHeaderForWidget(KItemListWidget* widget)
|
|||
header->setParentItem(0);
|
||||
groupHeaderCreator()->recycle(header);
|
||||
m_visibleGroups.remove(widget);
|
||||
disconnect(widget, SIGNAL(geometryChanged()), this, SLOT(slotGeometryOfGroupHeaderParentChanged()));
|
||||
disconnect(widget, &KItemListWidget::geometryChanged, this, &KItemListView::slotGeometryOfGroupHeaderParentChanged);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2582,8 +2582,8 @@ void KItemListView::disconnectRoleEditingSignals(int index)
|
|||
return;
|
||||
}
|
||||
|
||||
widget->disconnect(SIGNAL(roleEditingCanceled(int,QByteArray,QVariant)), this);
|
||||
widget->disconnect(SIGNAL(roleEditingFinished(int,QByteArray,QVariant)), this);
|
||||
disconnect(widget, &KItemListWidget::roleEditingCanceled, this, nullptr);
|
||||
disconnect(widget, &KItemListWidget::roleEditingFinished, this, nullptr);
|
||||
}
|
||||
|
||||
int KItemListView::calculateAutoScrollingIncrement(int pos, int range, int oldInc)
|
||||
|
|
|
@ -252,7 +252,7 @@ void KItemListWidget::setHovered(bool hovered)
|
|||
m_hoverAnimation = new QPropertyAnimation(this, "hoverOpacity", this);
|
||||
const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 200;
|
||||
m_hoverAnimation->setDuration(duration);
|
||||
connect(m_hoverAnimation, SIGNAL(finished()), this, SLOT(slotHoverAnimationFinished()));
|
||||
connect(m_hoverAnimation, &QPropertyAnimation::finished, this, &KItemListWidget::slotHoverAnimationFinished);
|
||||
}
|
||||
m_hoverAnimation->stop();
|
||||
|
||||
|
|
|
@ -704,10 +704,10 @@ void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const
|
|||
if (m_roleEditor) {
|
||||
emit roleEditingCanceled(index(), current, data().value(current));
|
||||
|
||||
disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingCanceled(QByteArray,QVariant)));
|
||||
disconnect(m_roleEditor, SIGNAL(roleEditingFinished(QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingFinished(QByteArray,QVariant)));
|
||||
disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
|
||||
this, &KStandardItemListWidget::slotRoleEditingCanceled);
|
||||
disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingFinished,
|
||||
this, &KStandardItemListWidget::slotRoleEditingFinished);
|
||||
|
||||
if (m_oldRoleEditor) {
|
||||
m_oldRoleEditor->deleteLater();
|
||||
|
@ -742,10 +742,10 @@ void KStandardItemListWidget::editedRoleChanged(const QByteArray& current, const
|
|||
m_roleEditor->setTextCursor(cursor);
|
||||
}
|
||||
|
||||
connect(m_roleEditor, SIGNAL(roleEditingCanceled(QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingCanceled(QByteArray,QVariant)));
|
||||
connect(m_roleEditor, SIGNAL(roleEditingFinished(QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingFinished(QByteArray,QVariant)));
|
||||
connect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
|
||||
this, &KStandardItemListWidget::slotRoleEditingCanceled);
|
||||
connect(m_roleEditor, &KItemListRoleEditor::roleEditingFinished,
|
||||
this, &KStandardItemListWidget::slotRoleEditingFinished);
|
||||
|
||||
// Adjust the geometry of the editor
|
||||
QRectF rect = roleEditingRect(current);
|
||||
|
@ -782,14 +782,14 @@ void KStandardItemListWidget::showEvent(QShowEvent* event)
|
|||
const KUrl itemUrl = data().value("url").value<KUrl>();
|
||||
m_isCut = clipboard->isCut(itemUrl);
|
||||
|
||||
connect(clipboard, SIGNAL(cutItemsChanged()),
|
||||
this, SLOT(slotCutItemsChanged()));
|
||||
connect(clipboard, &KFileItemClipboard::cutItemsChanged,
|
||||
this, &KStandardItemListWidget::slotCutItemsChanged);
|
||||
}
|
||||
|
||||
void KStandardItemListWidget::hideEvent(QHideEvent* event)
|
||||
{
|
||||
disconnect(KFileItemClipboard::instance(), SIGNAL(cutItemsChanged()),
|
||||
this, SLOT(slotCutItemsChanged()));
|
||||
disconnect(KFileItemClipboard::instance(), &KFileItemClipboard::cutItemsChanged,
|
||||
this, &KStandardItemListWidget::slotCutItemsChanged);
|
||||
|
||||
KItemListWidget::hideEvent(event);
|
||||
}
|
||||
|
@ -1353,10 +1353,10 @@ QRectF KStandardItemListWidget::roleEditingRect(const QByteArray& role) const
|
|||
|
||||
void KStandardItemListWidget::closeRoleEditor()
|
||||
{
|
||||
disconnect(m_roleEditor, SIGNAL(roleEditingCanceled(QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingCanceled(QByteArray,QVariant)));
|
||||
disconnect(m_roleEditor, SIGNAL(roleEditingFinished(QByteArray,QVariant)),
|
||||
this, SLOT(slotRoleEditingFinished(QByteArray,QVariant)));
|
||||
disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingCanceled,
|
||||
this, &KStandardItemListWidget::slotRoleEditingCanceled);
|
||||
disconnect(m_roleEditor, &KItemListRoleEditor::roleEditingFinished,
|
||||
this, &KStandardItemListWidget::slotRoleEditingFinished);
|
||||
|
||||
if (m_roleEditor->hasFocus()) {
|
||||
// If the editing was not ended by a FocusOut event, we have
|
||||
|
|
|
@ -35,8 +35,8 @@ KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObj
|
|||
m_dirWatcher(0),
|
||||
m_watchedDirs()
|
||||
{
|
||||
connect(m_model, SIGNAL(itemsRemoved(KItemRangeList)),
|
||||
this, SLOT(slotItemsRemoved()));
|
||||
connect(m_model, &KFileItemModel::itemsRemoved,
|
||||
this, &KDirectoryContentsCounter::slotItemsRemoved);
|
||||
|
||||
if (!m_workerThread) {
|
||||
m_workerThread = new QThread();
|
||||
|
@ -47,13 +47,13 @@ KDirectoryContentsCounter::KDirectoryContentsCounter(KFileItemModel* model, QObj
|
|||
m_worker->moveToThread(m_workerThread);
|
||||
++m_workersCount;
|
||||
|
||||
connect(this, SIGNAL(requestDirectoryContentsCount(QString,KDirectoryContentsCounterWorker::Options)),
|
||||
m_worker, SLOT(countDirectoryContents(QString,KDirectoryContentsCounterWorker::Options)));
|
||||
connect(m_worker, SIGNAL(result(QString,int)),
|
||||
this, SLOT(slotResult(QString,int)));
|
||||
connect(this, &KDirectoryContentsCounter::requestDirectoryContentsCount,
|
||||
m_worker, &KDirectoryContentsCounterWorker::countDirectoryContents);
|
||||
connect(m_worker, &KDirectoryContentsCounterWorker::result,
|
||||
this, &KDirectoryContentsCounter::slotResult);
|
||||
|
||||
m_dirWatcher = new KDirWatch(this);
|
||||
connect(m_dirWatcher, SIGNAL(dirty(QString)), this, SLOT(slotDirWatchDirty(QString)));
|
||||
connect(m_dirWatcher, &KDirWatch::dirty, this, &KDirectoryContentsCounter::slotDirWatchDirty);
|
||||
}
|
||||
|
||||
KDirectoryContentsCounter::~KDirectoryContentsCounter()
|
||||
|
|
|
@ -71,8 +71,8 @@ KFileItemClipboard::KFileItemClipboard() :
|
|||
{
|
||||
updateCutItems();
|
||||
|
||||
connect(QApplication::clipboard(), SIGNAL(dataChanged()),
|
||||
this, SLOT(updateCutItems()));
|
||||
connect(QApplication::clipboard(), &QClipboard::dataChanged,
|
||||
this, &KFileItemClipboard::updateCutItems);
|
||||
}
|
||||
|
||||
#include "kfileitemclipboard.moc"
|
||||
|
|
|
@ -62,19 +62,19 @@ void KItemListHeaderWidget::setModel(KItemModelBase* model)
|
|||
}
|
||||
|
||||
if (m_model) {
|
||||
disconnect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
|
||||
disconnect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
|
||||
this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
|
||||
disconnect(m_model, &KItemModelBase::sortRoleChanged,
|
||||
this, &KItemListHeaderWidget::slotSortRoleChanged);
|
||||
disconnect(m_model, &KItemModelBase::sortOrderChanged,
|
||||
this, &KItemListHeaderWidget::slotSortOrderChanged);
|
||||
}
|
||||
|
||||
m_model = model;
|
||||
|
||||
if (m_model) {
|
||||
connect(m_model, SIGNAL(sortRoleChanged(QByteArray,QByteArray)),
|
||||
this, SLOT(slotSortRoleChanged(QByteArray,QByteArray)));
|
||||
connect(m_model, SIGNAL(sortOrderChanged(Qt::SortOrder,Qt::SortOrder)),
|
||||
this, SLOT(slotSortOrderChanged(Qt::SortOrder,Qt::SortOrder)));
|
||||
connect(m_model, &KItemModelBase::sortRoleChanged,
|
||||
this, &KItemListHeaderWidget::slotSortRoleChanged);
|
||||
connect(m_model, &KItemModelBase::sortOrderChanged,
|
||||
this, &KItemListHeaderWidget::slotSortOrderChanged);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ KItemListRoleEditor::KItemListRoleEditor(QWidget *parent) :
|
|||
parent->installEventFilter(this);
|
||||
}
|
||||
|
||||
connect(this, SIGNAL(textChanged()), this, SLOT(autoAdjustSize()));
|
||||
connect(this, &KItemListRoleEditor::textChanged, this, &KItemListRoleEditor::autoAdjustSize);
|
||||
}
|
||||
|
||||
KItemListRoleEditor::~KItemListRoleEditor()
|
||||
|
|
|
@ -38,8 +38,8 @@ KItemListSmoothScroller::KItemListSmoothScroller(QScrollBar* scrollBar,
|
|||
m_animation = new QPropertyAnimation(this);
|
||||
const int duration = (KGlobalSettings::graphicEffectsLevel() == KGlobalSettings::NoEffects) ? 1 : 100;
|
||||
m_animation->setDuration(duration);
|
||||
connect(m_animation, SIGNAL(stateChanged(QAbstractAnimation::State,QAbstractAnimation::State)),
|
||||
this, SLOT(slotAnimationStateChanged(QAbstractAnimation::State,QAbstractAnimation::State)));
|
||||
connect(m_animation, &QPropertyAnimation::stateChanged,
|
||||
this, &KItemListSmoothScroller::slotAnimationStateChanged);
|
||||
|
||||
m_scrollBar->installEventFilter(this);
|
||||
}
|
||||
|
|
|
@ -172,7 +172,7 @@ void KItemListViewAnimation::start(QGraphicsWidget* widget, AnimationType type,
|
|||
}
|
||||
|
||||
Q_ASSERT(propertyAnim);
|
||||
connect(propertyAnim, SIGNAL(finished()), this, SLOT(slotFinished()));
|
||||
connect(propertyAnim, &QPropertyAnimation::finished, this, &KItemListViewAnimation::slotFinished);
|
||||
m_animation[type].insert(widget, propertyAnim);
|
||||
|
||||
propertyAnim->start();
|
||||
|
|
Loading…
Reference in a new issue