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