dolphin: convert panels/ and filterbar to qt signal/slot syntax

TerminalPanel connections to konsole part were not converted since there
is no header available that defines these function, we have to keep the
old syntax here.

Additionally the new syntax no longer accepts QPointer arguments, we have
to explicitly call .data() there.
This commit is contained in:
Alex Richardson 2014-04-10 02:57:01 +02:00
parent bb642c92d3
commit b069fb9b43
12 changed files with 92 additions and 92 deletions

View file

@ -38,7 +38,7 @@ FilterBar::FilterBar(QWidget* parent) :
closeButton->setAutoRaise(true);
closeButton->setIcon(KIcon("dialog-close"));
closeButton->setToolTip(i18nc("@info:tooltip", "Hide Filter Bar"));
connect(closeButton, SIGNAL(clicked()), this, SIGNAL(closeRequest()));
connect(closeButton, &QToolButton::clicked, this, &FilterBar::closeRequest);
// Create button to lock text when changing folders
m_lockButton = new QToolButton(this);
@ -46,7 +46,7 @@ FilterBar::FilterBar(QWidget* parent) :
m_lockButton->setCheckable(true);
m_lockButton->setIcon(KIcon("object-unlocked"));
m_lockButton->setToolTip(i18nc("@info:tooltip", "Keep Filter When Changing Folders"));
connect(m_lockButton, SIGNAL(toggled(bool)), this, SLOT(slotToggleLockButton(bool)));
connect(m_lockButton, &QToolButton::toggled, this, &FilterBar::slotToggleLockButton);
// Create label
QLabel* filterLabel = new QLabel(i18nc("@label:textbox", "Filter:"), this);
@ -55,8 +55,8 @@ FilterBar::FilterBar(QWidget* parent) :
m_filterInput = new KLineEdit(this);
m_filterInput->setLayoutDirection(Qt::LeftToRight);
m_filterInput->setClearButtonShown(true);
connect(m_filterInput, SIGNAL(textChanged(QString)),
this, SIGNAL(filterChanged(QString)));
connect(m_filterInput, &KLineEdit::textChanged,
this, &FilterBar::filterChanged);
setFocusProxy(m_filterInput);
// Apply layout

View file

@ -137,15 +137,15 @@ void FoldersPanel::showEvent(QShowEvent* event)
// opening the folders panel.
view->setOpacity(0);
connect(view, SIGNAL(roleEditingFinished(int,QByteArray,QVariant)),
this, SLOT(slotRoleEditingFinished(int,QByteArray,QVariant)));
connect(view, &KFileItemListView::roleEditingFinished,
this, &FoldersPanel::slotRoleEditingFinished);
m_model = new KFileItemModel(this);
m_model->setShowDirectoriesOnly(true);
m_model->setShowHiddenFiles(FoldersPanelSettings::hiddenFilesShown());
// Use a QueuedConnection to give the view the possibility to react first on the
// finished loading.
connect(m_model, SIGNAL(directoryLoadingCompleted()), this, SLOT(slotLoadingCompleted()), Qt::QueuedConnection);
connect(m_model, &KFileItemModel::directoryLoadingCompleted, this, &FoldersPanel::slotLoadingCompleted, Qt::QueuedConnection);
m_controller = new KItemListController(m_model, view, this);
m_controller->setSelectionBehavior(KItemListController::SingleSelection);
@ -154,11 +154,11 @@ void FoldersPanel::showEvent(QShowEvent* event)
m_controller->setAutoActivationDelay(750);
m_controller->setSingleClickActivationEnforced(true);
connect(m_controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
connect(m_controller, &KItemListController::itemActivated, this, &FoldersPanel::slotItemActivated);
connect(m_controller, &KItemListController::itemMiddleClicked, this, &FoldersPanel::slotItemMiddleClicked);
connect(m_controller, &KItemListController::itemContextMenuRequested, this, &FoldersPanel::slotItemContextMenuRequested);
connect(m_controller, &KItemListController::viewContextMenuRequested, this, &FoldersPanel::slotViewContextMenuRequested);
connect(m_controller, &KItemListController::itemDropEvent, this, &FoldersPanel::slotItemDropEvent);
KItemListContainer* container = new KItemListContainer(m_controller, this);
container->setEnabledFrame(false);

View file

@ -61,15 +61,15 @@ void TreeViewContextMenu::open()
// insert 'Cut', 'Copy' and 'Paste'
QAction* cutAction = new QAction(KIcon("edit-cut"), i18nc("@action:inmenu", "Cut"), this);
cutAction->setEnabled(capabilities.supportsMoving());
connect(cutAction, SIGNAL(triggered()), this, SLOT(cut()));
connect(cutAction, &QAction::triggered, this, &TreeViewContextMenu::cut);
QAction* copyAction = new QAction(KIcon("edit-copy"), i18nc("@action:inmenu", "Copy"), this);
connect(copyAction, SIGNAL(triggered()), this, SLOT(copy()));
connect(copyAction, &QAction::triggered, this, &TreeViewContextMenu::copy);
QAction* pasteAction = new QAction(KIcon("edit-paste"), i18nc("@action:inmenu", "Paste"), this);
const QMimeData* mimeData = QApplication::clipboard()->mimeData();
const KUrl::List pasteData = KUrl::List::fromMimeData(mimeData);
connect(pasteAction, SIGNAL(triggered()), this, SLOT(paste()));
connect(pasteAction, &QAction::triggered, this, &TreeViewContextMenu::paste);
pasteAction->setEnabled(!pasteData.isEmpty() && capabilities.supportsWriting());
popup->addAction(cutAction);
@ -81,7 +81,7 @@ void TreeViewContextMenu::open()
QAction* renameAction = new QAction(i18nc("@action:inmenu", "Rename..."), this);
renameAction->setEnabled(capabilities.supportsMoving());
renameAction->setIcon(KIcon("edit-rename"));
connect(renameAction, SIGNAL(triggered()), this, SLOT(rename()));
connect(renameAction, &QAction::triggered, this, &TreeViewContextMenu::rename);
popup->addAction(renameAction);
// insert 'Move to Trash' and (optionally) 'Delete'
@ -95,7 +95,7 @@ void TreeViewContextMenu::open()
i18nc("@action:inmenu", "Move to Trash"), this);
const bool enableMoveToTrash = capabilities.isLocal() && capabilities.supportsMoving();
moveToTrashAction->setEnabled(enableMoveToTrash);
connect(moveToTrashAction, SIGNAL(triggered()), this, SLOT(moveToTrash()));
connect(moveToTrashAction, &QAction::triggered, this, &TreeViewContextMenu::moveToTrash);
popup->addAction(moveToTrashAction);
} else {
showDeleteCommand = true;
@ -104,7 +104,7 @@ void TreeViewContextMenu::open()
if (showDeleteCommand) {
QAction* deleteAction = new QAction(KIcon("edit-delete"), i18nc("@action:inmenu", "Delete"), this);
deleteAction->setEnabled(capabilities.supportsDeleting());
connect(deleteAction, SIGNAL(triggered()), this, SLOT(deleteItem()));
connect(deleteAction, &QAction::triggered, this, &TreeViewContextMenu::deleteItem);
popup->addAction(deleteAction);
}
@ -116,7 +116,7 @@ void TreeViewContextMenu::open()
showHiddenFilesAction->setCheckable(true);
showHiddenFilesAction->setChecked(m_parent->showHiddenFiles());
popup->addAction(showHiddenFilesAction);
connect(showHiddenFilesAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool)));
connect(showHiddenFilesAction, &QAction::toggled, this, &TreeViewContextMenu::setShowHiddenFiles);
// insert 'Automatic Scrolling'
QAction* autoScrollingAction = new QAction(i18nc("@action:inmenu", "Automatic Scrolling"), this);
@ -125,13 +125,13 @@ void TreeViewContextMenu::open()
// TODO: Temporary disabled. Horizontal autoscrolling will be implemented later either
// in KItemViews or manually as part of the FoldersPanel
//popup->addAction(autoScrollingAction);
connect(autoScrollingAction, SIGNAL(toggled(bool)), this, SLOT(setAutoScrolling(bool)));
connect(autoScrollingAction, &QAction::toggled, this, &TreeViewContextMenu::setAutoScrolling);
if (!m_fileItem.isNull()) {
// insert 'Properties' entry
QAction* propertiesAction = new QAction(i18nc("@action:inmenu", "Properties"), this);
propertiesAction->setIcon(KIcon("document-properties"));
connect(propertiesAction, SIGNAL(triggered()), this, SLOT(showProperties()));
connect(propertiesAction, &QAction::triggered, this, &TreeViewContextMenu::showProperties);
popup->addAction(propertiesAction);
}

View file

@ -188,8 +188,8 @@ void InformationPanel::showItemInfo()
if (m_folderStatJob->ui()) {
KJobWidgets::setWindow(m_folderStatJob, this);
}
connect(m_folderStatJob, SIGNAL(result(KJob*)),
this, SLOT(slotFolderStatFinished(KJob*)));
connect(m_folderStatJob, &KIO::Job::result,
this, &InformationPanel::slotFolderStatFinished);
} else {
m_content->showItem(item);
}
@ -324,35 +324,35 @@ void InformationPanel::init()
m_infoTimer = new QTimer(this);
m_infoTimer->setInterval(300);
m_infoTimer->setSingleShot(true);
connect(m_infoTimer, SIGNAL(timeout()),
this, SLOT(slotInfoTimeout()));
connect(m_infoTimer, &QTimer::timeout,
this, &InformationPanel::slotInfoTimeout);
m_urlChangedTimer = new QTimer(this);
m_urlChangedTimer->setInterval(200);
m_urlChangedTimer->setSingleShot(true);
connect(m_urlChangedTimer, SIGNAL(timeout()),
this, SLOT(showItemInfo()));
connect(m_urlChangedTimer, &QTimer::timeout,
this, &InformationPanel::showItemInfo);
m_resetUrlTimer = new QTimer(this);
m_resetUrlTimer->setInterval(1000);
m_resetUrlTimer->setSingleShot(true);
connect(m_resetUrlTimer, SIGNAL(timeout()),
this, SLOT(reset()));
connect(m_resetUrlTimer, &QTimer::timeout,
this, &InformationPanel::reset);
Q_ASSERT(m_urlChangedTimer->interval() < m_infoTimer->interval());
Q_ASSERT(m_urlChangedTimer->interval() < m_resetUrlTimer->interval());
org::kde::KDirNotify* dirNotify = new org::kde::KDirNotify(QString(), QString(),
QDBusConnection::sessionBus(), this);
connect(dirNotify, SIGNAL(FileRenamed(QString,QString)), SLOT(slotFileRenamed(QString,QString)));
connect(dirNotify, SIGNAL(FilesAdded(QString)), SLOT(slotFilesAdded(QString)));
connect(dirNotify, SIGNAL(FilesChanged(QStringList)), SLOT(slotFilesChanged(QStringList)));
connect(dirNotify, SIGNAL(FilesRemoved(QStringList)), SLOT(slotFilesRemoved(QStringList)));
connect(dirNotify, SIGNAL(enteredDirectory(QString)), SLOT(slotEnteredDirectory(QString)));
connect(dirNotify, SIGNAL(leftDirectory(QString)), SLOT(slotLeftDirectory(QString)));
connect(dirNotify, &OrgKdeKDirNotifyInterface::FileRenamed, this, &InformationPanel::slotFileRenamed);
connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesAdded, this, &InformationPanel::slotFilesAdded);
connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesChanged, this, &InformationPanel::slotFilesChanged);
connect(dirNotify, &OrgKdeKDirNotifyInterface::FilesRemoved, this, &InformationPanel::slotFilesRemoved);
connect(dirNotify, &OrgKdeKDirNotifyInterface::enteredDirectory, this, &InformationPanel::slotEnteredDirectory);
connect(dirNotify, &OrgKdeKDirNotifyInterface::leftDirectory, this, &InformationPanel::slotLeftDirectory);
m_content = new InformationPanelContent(this);
connect(m_content, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
connect(m_content, &InformationPanelContent::urlActivated, this, &InformationPanel::urlActivated);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setContentsMargins(0, 0, 0, 0);

View file

@ -83,8 +83,8 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
m_outdatedPreviewTimer = new QTimer(this);
m_outdatedPreviewTimer->setInterval(300);
m_outdatedPreviewTimer->setSingleShot(true);
connect(m_outdatedPreviewTimer, SIGNAL(timeout()),
this, SLOT(markOutdatedPreview()));
connect(m_outdatedPreviewTimer, &QTimer::timeout,
this, &InformationPanelContent::markOutdatedPreview);
QVBoxLayout* layout = new QVBoxLayout(this);
layout->setSpacing(KDialog::spacingHint());
@ -99,8 +99,8 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
m_phononWidget = new PhononWidget(parent);
m_phononWidget->hide();
m_phononWidget->setMinimumWidth(minPreviewWidth);
connect(m_phononWidget, SIGNAL(hasVideoChanged(bool)),
this, SLOT(slotHasVideoChanged(bool)));
connect(m_phononWidget, &PhononWidget::hasVideoChanged,
this, &InformationPanelContent::slotHasVideoChanged);
// name
m_nameLabel = new QLabel(parent);
@ -121,7 +121,7 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) :
#endif
m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont());
m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum);
connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl)));
connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated, this, &InformationPanelContent::urlActivated);
// Encapsulate the MetaDataWidget inside a container that has a dummy widget
// at the bottom. This prevents that the meta data widget gets vertically stretched
@ -198,10 +198,10 @@ void InformationPanelContent::showItem(const KFileItem& item)
KJobWidgets::setWindow(m_previewJob, this);
}
connect(m_previewJob, SIGNAL(gotPreview(KFileItem,QPixmap)),
this, SLOT(showPreview(KFileItem,QPixmap)));
connect(m_previewJob, SIGNAL(failed(KFileItem)),
this, SLOT(showIcon(KFileItem)));
connect(m_previewJob.data(), &KIO::PreviewJob::gotPreview,
this, &InformationPanelContent::showPreview);
connect(m_previewJob.data(), &KIO::PreviewJob::failed,
this, &InformationPanelContent::showIcon);
}
}
@ -317,7 +317,7 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon
dialog->show();
dialog->raise();
dialog->activateWindow();
connect(dialog, SIGNAL(destroyed()), this, SLOT(refreshMetaData()));
connect(dialog, &FileMetaDataConfigurationDialog::destroyed, this, &InformationPanelContent::refreshMetaData);
}
}

View file

@ -131,14 +131,14 @@ void PhononWidget::showEvent(QShowEvent *event)
m_playButton->setIconSize(buttonSize);
m_playButton->setIcon(KIcon("media-playback-start"));
m_playButton->setAutoRaise(true);
connect(m_playButton, SIGNAL(clicked()), this, SLOT(play()));
connect(m_playButton, &QToolButton::clicked, this, &PhononWidget::play);
m_stopButton->setToolTip(i18n("stop"));
m_stopButton->setIconSize(buttonSize);
m_stopButton->setIcon(KIcon("media-playback-stop"));
m_stopButton->setAutoRaise(true);
m_stopButton->hide();
connect(m_stopButton, SIGNAL(clicked()), this, SLOT(stop()));
connect(m_stopButton, &QToolButton::clicked, this, &PhononWidget::stop);
m_seekSlider->setIconVisible(false);
@ -178,10 +178,10 @@ void PhononWidget::play()
{
if (!m_media) {
m_media = new Phonon::MediaObject(this);
connect(m_media, SIGNAL(stateChanged(Phonon::State,Phonon::State)),
this, SLOT(stateChanged(Phonon::State)));
connect(m_media, SIGNAL(hasVideoChanged(bool)),
this, SLOT(slotHasVideoChanged(bool)));
connect(m_media, &Phonon::MediaObject::stateChanged,
this, &PhononWidget::stateChanged);
connect(m_media, &Phonon::MediaObject::hasVideoChanged,
this, &PhononWidget::slotHasVideoChanged);
m_seekSlider->setMediaObject(m_media);
}

View file

@ -39,8 +39,8 @@ PixmapViewer::PixmapViewer(QWidget* parent, Transition transition) :
m_animation.setCurveShape(QTimeLine::LinearCurve);
if (m_transition != NoTransition) {
connect(&m_animation, SIGNAL(valueChanged(qreal)), this, SLOT(update()));
connect(&m_animation, SIGNAL(finished()), this, SLOT(checkPendingPixmaps()));
connect(&m_animation, &QTimeLine::valueChanged, this, static_cast<void(PixmapViewer::*)()>(&PixmapViewer::update));
connect(&m_animation, &QTimeLine::finished, this, &PixmapViewer::checkPendingPixmaps);
}
}

View file

@ -69,8 +69,8 @@ void PlacesItem::setUrl(const KUrl& url)
m_trashDirLister = new KDirLister();
m_trashDirLister->setAutoErrorHandlingEnabled(false, 0);
m_trashDirLister->setDelayedMimeTypes(true);
QObject::connect(m_trashDirLister, SIGNAL(completed()),
m_signalHandler, SLOT(onTrashDirListerCompleted()));
QObject::connect(m_trashDirLister.data(), static_cast<void(KDirLister::*)()>(&KDirLister::completed),
m_signalHandler.data(), &PlacesItemSignalHandler::onTrashDirListerCompleted);
m_trashDirLister->openUrl(url);
}
@ -271,8 +271,8 @@ void PlacesItem::initializeDevice(const QString& udi)
if (m_access) {
setUrl(m_access->filePath());
QObject::connect(m_access, SIGNAL(accessibilityChanged(bool,QString)),
m_signalHandler, SLOT(onAccessibilityChanged()));
QObject::connect(m_access.data(), &Solid::StorageAccess::accessibilityChanged,
m_signalHandler.data(), &PlacesItemSignalHandler::onAccessibilityChanged);
} else if (m_disc && (m_disc->availableContent() & Solid::OpticalDisc::Audio) != 0) {
Solid::Block *block = m_device.as<Solid::Block>();
if (block) {

View file

@ -135,7 +135,7 @@ void PlacesItemEditDialog::initialize()
formLayout->addRow(i18nc("@label", "Location:"), m_urlEdit);
// Provide room for at least 40 chars (average char width is half of height)
m_urlEdit->setMinimumWidth(m_urlEdit->fontMetrics().height() * (40 / 2));
connect(m_urlEdit->lineEdit(), SIGNAL(textChanged(QString)), this, SLOT(slotUrlChanged(QString)));
connect(m_urlEdit->lineEdit(), &KLineEdit::textChanged, this, &PlacesItemEditDialog::slotUrlChanged);
m_iconButton = new KIconButton(mainWidget);
formLayout->addRow(i18nc("@label", "Choose an icon:"), m_iconButton);

View file

@ -99,17 +99,17 @@ PlacesItemModel::PlacesItemModel(QObject* parent) :
m_saveBookmarksTimer = new QTimer(this);
m_saveBookmarksTimer->setInterval(syncBookmarksTimeout);
m_saveBookmarksTimer->setSingleShot(true);
connect(m_saveBookmarksTimer, SIGNAL(timeout()), this, SLOT(saveBookmarks()));
connect(m_saveBookmarksTimer, &QTimer::timeout, this, &PlacesItemModel::saveBookmarks);
m_updateBookmarksTimer = new QTimer(this);
m_updateBookmarksTimer->setInterval(syncBookmarksTimeout);
m_updateBookmarksTimer->setSingleShot(true);
connect(m_updateBookmarksTimer, SIGNAL(timeout()), this, SLOT(updateBookmarks()));
connect(m_updateBookmarksTimer, &QTimer::timeout, this, &PlacesItemModel::updateBookmarks);
connect(m_bookmarkManager, SIGNAL(changed(QString,QString)),
m_updateBookmarksTimer, SLOT(start()));
connect(m_bookmarkManager, SIGNAL(bookmarksChanged(QString)),
m_updateBookmarksTimer, SLOT(start()));
connect(m_bookmarkManager, &KBookmarkManager::changed,
m_updateBookmarksTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
connect(m_bookmarkManager, &KBookmarkManager::bookmarksChanged,
m_updateBookmarksTimer, static_cast<void(QTimer::*)()>(&QTimer::start));
}
PlacesItemModel::~PlacesItemModel()
@ -313,8 +313,8 @@ void PlacesItemModel::requestEject(int index)
if (item) {
Solid::OpticalDrive* drive = item->device().parent().as<Solid::OpticalDrive>();
if (drive) {
connect(drive, SIGNAL(ejectDone(Solid::ErrorType,QVariant,QString)),
this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)));
connect(drive, &Solid::OpticalDrive::ejectDone,
this, &PlacesItemModel::slotStorageTeardownDone);
drive->eject();
} else {
const QString label = item->text();
@ -330,8 +330,8 @@ void PlacesItemModel::requestTeardown(int index)
if (item) {
Solid::StorageAccess* access = item->device().as<Solid::StorageAccess>();
if (access) {
connect(access, SIGNAL(teardownDone(Solid::ErrorType,QVariant,QString)),
this, SLOT(slotStorageTeardownDone(Solid::ErrorType,QVariant)));
connect(access, &Solid::StorageAccess::teardownDone,
this, &PlacesItemModel::slotStorageTeardownDone);
access->teardown();
}
}
@ -359,8 +359,8 @@ void PlacesItemModel::requestStorageSetup(int index)
m_storageSetupInProgress[access] = index;
connect(access, SIGNAL(setupDone(Solid::ErrorType,QVariant,QString)),
this, SLOT(slotStorageSetupDone(Solid::ErrorType,QVariant,QString)));
connect(access, &Solid::StorageAccess::setupDone,
this, &PlacesItemModel::slotStorageSetupDone);
access->setup();
}
@ -968,8 +968,8 @@ void PlacesItemModel::initializeAvailableDevices()
Q_ASSERT(m_predicate.isValid());
Solid::DeviceNotifier* notifier = Solid::DeviceNotifier::instance();
connect(notifier, SIGNAL(deviceAdded(QString)), this, SLOT(slotDeviceAdded(QString)));
connect(notifier, SIGNAL(deviceRemoved(QString)), this, SLOT(slotDeviceRemoved(QString)));
connect(notifier, &Solid::DeviceNotifier::deviceAdded, this, &PlacesItemModel::slotDeviceAdded);
connect(notifier, &Solid::DeviceNotifier::deviceRemoved, this, &PlacesItemModel::slotDeviceRemoved);
const QList<Solid::Device>& deviceList = Solid::Device::listFromQuery(m_predicate);
foreach (const Solid::Device& device, deviceList) {

View file

@ -104,8 +104,8 @@ void PlacesPanel::showEvent(QShowEvent* event)
// used at all and stays invisible.
m_model = new PlacesItemModel(this);
m_model->setGroupedSorting(true);
connect(m_model, SIGNAL(errorMessage(QString)),
this, SIGNAL(errorMessage(QString)));
connect(m_model, &PlacesItemModel::errorMessage,
this, &PlacesPanel::errorMessage);
m_view = new PlacesView();
m_view->setWidgetCreator(new KItemListWidgetCreator<PlacesItemListWidget>());
@ -117,12 +117,12 @@ void PlacesPanel::showEvent(QShowEvent* event)
readSettings();
connect(m_controller, SIGNAL(itemActivated(int)), this, SLOT(slotItemActivated(int)));
connect(m_controller, SIGNAL(itemMiddleClicked(int)), this, SLOT(slotItemMiddleClicked(int)));
connect(m_controller, SIGNAL(itemContextMenuRequested(int,QPointF)), this, SLOT(slotItemContextMenuRequested(int,QPointF)));
connect(m_controller, SIGNAL(viewContextMenuRequested(QPointF)), this, SLOT(slotViewContextMenuRequested(QPointF)));
connect(m_controller, SIGNAL(itemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
connect(m_controller, SIGNAL(aboveItemDropEvent(int,QGraphicsSceneDragDropEvent*)), this, SLOT(slotAboveItemDropEvent(int,QGraphicsSceneDragDropEvent*)));
connect(m_controller, &KItemListController::itemActivated, this, &PlacesPanel::slotItemActivated);
connect(m_controller, &KItemListController::itemMiddleClicked, this, &PlacesPanel::slotItemMiddleClicked);
connect(m_controller, &KItemListController::itemContextMenuRequested, this, &PlacesPanel::slotItemContextMenuRequested);
connect(m_controller, &KItemListController::viewContextMenuRequested, this, &PlacesPanel::slotViewContextMenuRequested);
connect(m_controller, &KItemListController::itemDropEvent, this, &PlacesPanel::slotItemDropEvent);
connect(m_controller, &KItemListController::aboveItemDropEvent, this, &PlacesPanel::slotAboveItemDropEvent);
KItemListContainer* container = new KItemListContainer(m_controller, this);
container->setEnabledFrame(false);
@ -342,8 +342,8 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
}
if (m_model->storageSetupNeeded(index)) {
connect(m_model, SIGNAL(storageSetupDone(int,bool)),
this, SLOT(slotItemDropEventStorageSetupDone(int,bool)));
connect(m_model, &PlacesItemModel::storageSetupDone,
this, &PlacesPanel::slotItemDropEventStorageSetupDone);
m_itemDropEventIndex = index;
@ -381,8 +381,8 @@ void PlacesPanel::slotItemDropEvent(int index, QGraphicsSceneDragDropEvent* even
void PlacesPanel::slotItemDropEventStorageSetupDone(int index, bool success)
{
disconnect(m_model, SIGNAL(storageSetupDone(int,bool)),
this, SLOT(slotItemDropEventStorageSetupDone(int,bool)));
disconnect(m_model, &PlacesItemModel::storageSetupDone,
this, &PlacesPanel::slotItemDropEventStorageSetupDone);
if ((index == m_itemDropEventIndex) && m_itemDropEvent && m_itemDropEventMimeData) {
if (success) {
@ -430,8 +430,8 @@ void PlacesPanel::slotTrashUpdated(KJob* job)
void PlacesPanel::slotStorageSetupDone(int index, bool success)
{
disconnect(m_model, SIGNAL(storageSetupDone(int,bool)),
this, SLOT(slotStorageSetupDone(int,bool)));
disconnect(m_model, &PlacesItemModel::storageSetupDone,
this, &PlacesPanel::slotStorageSetupDone);
if (m_triggerStorageSetupButton == Qt::NoButton) {
return;
@ -463,7 +463,7 @@ void PlacesPanel::emptyTrash()
KIO::Job *job = KIO::special(KUrl("trash:/"), packedArgs);
KNotification::event("Trash: emptied", QString() , QPixmap() , 0, KNotification::DefaultEvent);
KJobWidgets::setWindow(job, parentWidget());
connect(job, SIGNAL(result(KJob*)), SLOT(slotTrashUpdated(KJob*)));
connect(job, &KIO::Job::result, this, &PlacesPanel::slotTrashUpdated);
}
}
@ -526,8 +526,8 @@ void PlacesPanel::triggerItem(int index, Qt::MouseButton button)
m_triggerStorageSetupButton = button;
m_storageSetupFailedUrl = url();
connect(m_model, SIGNAL(storageSetupDone(int,bool)),
this, SLOT(slotStorageSetupDone(int,bool)));
connect(m_model, &PlacesItemModel::storageSetupDone,
this, &PlacesPanel::slotStorageSetupDone);
m_model->requestStorageSetup(index);
} else {

View file

@ -110,7 +110,7 @@ void TerminalPanel::showEvent(QShowEvent* event)
}
m_konsolePart = factory ? (factory->create<KParts::ReadOnlyPart>(this)) : 0;
if (m_konsolePart) {
connect(m_konsolePart, SIGNAL(destroyed(QObject*)), this, SLOT(terminalExited()));
connect(m_konsolePart, &KParts::ReadOnlyPart::destroyed, this, &TerminalPanel::terminalExited);
m_terminalWidget = m_konsolePart->widget();
m_layout->addWidget(m_terminalWidget);
m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart);
@ -139,7 +139,7 @@ void TerminalPanel::changeDir(const KUrl& url)
if (m_mostLocalUrlJob->ui()) {
KJobWidgets::setWindow(m_mostLocalUrlJob, this);
}
connect(m_mostLocalUrlJob, SIGNAL(result(KJob*)), this, SLOT(slotMostLocalUrlResult(KJob*)));
connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult);
}
}