diff options
Diffstat (limited to 'src/panels')
| -rw-r--r-- | src/panels/folders/folderspanel.cpp | 16 | ||||
| -rw-r--r-- | src/panels/folders/treeviewcontextmenu.cpp | 26 | ||||
| -rw-r--r-- | src/panels/folders/treeviewcontextmenu.h | 1 | ||||
| -rw-r--r-- | src/panels/information/informationpanel.cpp | 34 | ||||
| -rw-r--r-- | src/panels/information/informationpanelcontent.cpp | 29 | ||||
| -rw-r--r-- | src/panels/information/phononwidget.cpp | 13 | ||||
| -rw-r--r-- | src/panels/information/pixmapviewer.cpp | 4 | ||||
| -rw-r--r-- | src/panels/places/placesitem.cpp | 8 | ||||
| -rw-r--r-- | src/panels/places/placesitemeditdialog.cpp | 4 | ||||
| -rw-r--r-- | src/panels/places/placesitemmodel.cpp | 29 | ||||
| -rw-r--r-- | src/panels/places/placespanel.cpp | 41 | ||||
| -rw-r--r-- | src/panels/terminal/terminalpanel.cpp | 11 | ||||
| -rw-r--r-- | src/panels/terminal/terminalpanel.h | 4 |
13 files changed, 120 insertions, 100 deletions
diff --git a/src/panels/folders/folderspanel.cpp b/src/panels/folders/folderspanel.cpp index 46c1b3450..0b2ea3888 100644 --- a/src/panels/folders/folderspanel.cpp +++ b/src/panels/folders/folderspanel.cpp @@ -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); diff --git a/src/panels/folders/treeviewcontextmenu.cpp b/src/panels/folders/treeviewcontextmenu.cpp index fa8844dfa..2e59ae833 100644 --- a/src/panels/folders/treeviewcontextmenu.cpp +++ b/src/panels/folders/treeviewcontextmenu.cpp @@ -24,6 +24,9 @@ #include <KIconLoader> #include <KIO/DeleteJob> #include <KMenu> +#include <KIcon> +#include <KSharedConfig> +#include <KConfigGroup> #include <konqmimedata.h> #include <KFileItemListProperties> #include <konq_operations.h> @@ -34,6 +37,7 @@ #include <QApplication> #include <QClipboard> +#include <QMimeData> TreeViewContextMenu::TreeViewContextMenu(FoldersPanel* parent, const KFileItem& fileInfo) : @@ -57,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); @@ -77,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' @@ -91,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; @@ -100,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); } @@ -112,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); @@ -121,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); } @@ -192,12 +196,12 @@ void TreeViewContextMenu::rename() void TreeViewContextMenu::moveToTrash() { - KonqOperations::del(m_parent, KonqOperations::TRASH, m_fileItem.url()); + KonqOperations::del(m_parent, KonqOperations::TRASH, KUrl::List() << m_fileItem.url()); } void TreeViewContextMenu::deleteItem() { - KonqOperations::del(m_parent, KonqOperations::DEL, m_fileItem.url()); + KonqOperations::del(m_parent, KonqOperations::DEL, KUrl::List() << m_fileItem.url()); } void TreeViewContextMenu::showProperties() diff --git a/src/panels/folders/treeviewcontextmenu.h b/src/panels/folders/treeviewcontextmenu.h index 0b3fd79bd..598ffaed6 100644 --- a/src/panels/folders/treeviewcontextmenu.h +++ b/src/panels/folders/treeviewcontextmenu.h @@ -23,6 +23,7 @@ #include <QObject> #include <KFileItem> +class QMimeData; class FoldersPanel; /** diff --git a/src/panels/information/informationpanel.cpp b/src/panels/information/informationpanel.cpp index eda74f3b5..4ad1276a5 100644 --- a/src/panels/information/informationpanel.cpp +++ b/src/panels/information/informationpanel.cpp @@ -22,10 +22,12 @@ #include "informationpanelcontent.h" #include <KIO/Job> #include <KIO/JobUiDelegate> +#include <KJobWidgets> #include <KDirNotify> #include <QApplication> #include <QShowEvent> #include <QVBoxLayout> +#include <QTimer> InformationPanel::InformationPanel(QWidget* parent) : Panel(parent), @@ -184,10 +186,10 @@ void InformationPanel::showItemInfo() // an item for the currently shown directory. m_folderStatJob = KIO::stat(url(), KIO::HideProgressInfo); if (m_folderStatJob->ui()) { - m_folderStatJob->ui()->setWindow(this); + 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); } @@ -322,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); diff --git a/src/panels/information/informationpanelcontent.cpp b/src/panels/information/informationpanelcontent.cpp index 4fb0d9442..9dc59db13 100644 --- a/src/panels/information/informationpanelcontent.cpp +++ b/src/panels/information/informationpanelcontent.cpp @@ -24,8 +24,10 @@ #include <KGlobalSettings> #include <KIO/JobUiDelegate> #include <KIO/PreviewJob> +#include <KJobWidgets> #include <KIconEffect> #include <KIconLoader> +#include <KIcon> #include <KLocale> #include <KMenu> #include <kseparator.h> @@ -81,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()); @@ -97,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); @@ -114,12 +116,15 @@ InformationPanelContent::InformationPanelContent(QWidget* parent) : #ifndef HAVE_BALOO m_metaDataWidget = new KFileMetaDataWidget(parent); + connect(m_metaDataWidget, &KFileMetaDataWidget::urlActivated, + this, &InformationPanelContent::urlActivated); #else m_metaDataWidget = new Baloo::FileMetaDataWidget(parent); + connect(m_metaDataWidget, &Baloo::FileMetaDataWidget::urlActivated, + this, &InformationPanelContent::urlActivated); #endif m_metaDataWidget->setFont(KGlobalSettings::smallestReadableFont()); m_metaDataWidget->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Minimum); - connect(m_metaDataWidget, SIGNAL(urlActivated(KUrl)), this, SIGNAL(urlActivated(KUrl))); // Encapsulate the MetaDataWidget inside a container that has a dummy widget // at the bottom. This prevents that the meta data widget gets vertically stretched @@ -193,13 +198,13 @@ void InformationPanelContent::showItem(const KFileItem& item) m_previewJob->setScaleType(KIO::PreviewJob::Unscaled); m_previewJob->setIgnoreMaximumSize(item.isLocalFile()); if (m_previewJob->ui()) { - m_previewJob->ui()->setWindow(this); + 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); } } @@ -287,7 +292,7 @@ void InformationPanelContent::configureSettings(const QList<QAction*>& customCon KMenu popup(this); QAction* previewAction = popup.addAction(i18nc("@action:inmenu", "Preview")); - previewAction->setIcon(KIcon("view-preview")); + previewAction->setIcon(QIcon::fromTheme("view-preview")); previewAction->setCheckable(true); previewAction->setChecked(InformationPanelSettings::previewsShown()); @@ -319,7 +324,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); } } diff --git a/src/panels/information/phononwidget.cpp b/src/panels/information/phononwidget.cpp index a36ada180..4b2cc28c5 100644 --- a/src/panels/information/phononwidget.cpp +++ b/src/panels/information/phononwidget.cpp @@ -33,6 +33,7 @@ #include <KDialog> #include <KIcon> +#include <KIconLoader> #include <KUrl> #include <KLocale> @@ -130,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); @@ -177,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); } diff --git a/src/panels/information/pixmapviewer.cpp b/src/panels/information/pixmapviewer.cpp index 8a752c587..db3a63331 100644 --- a/src/panels/information/pixmapviewer.cpp +++ b/src/panels/information/pixmapviewer.cpp @@ -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); } } diff --git a/src/panels/places/placesitem.cpp b/src/panels/places/placesitem.cpp index 539b9263d..1729bbd19 100644 --- a/src/panels/places/placesitem.cpp +++ b/src/panels/places/placesitem.cpp @@ -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) { diff --git a/src/panels/places/placesitemeditdialog.cpp b/src/panels/places/placesitemeditdialog.cpp index 08c910d17..0a66ef7de 100644 --- a/src/panels/places/placesitemeditdialog.cpp +++ b/src/panels/places/placesitemeditdialog.cpp @@ -24,9 +24,11 @@ #include "placesitemeditdialog.h" #include <KAboutData> +#include <k4aboutdata.h> #include <KComponentData> #include <KDebug> #include <KFile> +#include <KGlobal> #include <KIconButton> #include <KLineEdit> #include <KLocale> @@ -133,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); diff --git a/src/panels/places/placesitemmodel.cpp b/src/panels/places/placesitemmodel.cpp index 1f05e07f9..6ba91c5ba 100644 --- a/src/panels/places/placesitemmodel.cpp +++ b/src/panels/places/placesitemmodel.cpp @@ -35,6 +35,7 @@ #include <KLocale> #include <KStandardDirs> #include <KUser> +#include <KGlobal> #include "placesitem.h" #include <QAction> #include <QDate> @@ -98,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() @@ -312,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(); @@ -329,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(); } } @@ -358,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 +969,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) { diff --git a/src/panels/places/placespanel.cpp b/src/panels/places/placespanel.cpp index f19fa1e25..d3614c9ce 100644 --- a/src/panels/places/placespanel.cpp +++ b/src/panels/places/placespanel.cpp @@ -30,7 +30,9 @@ #include <KIcon> #include <KIO/Job> #include <KIO/JobUiDelegate> +#include <KJobWidgets> #include <KLocale> +#include <KIconLoader> #include <kitemviews/kitemlistcontainer.h> #include <kitemviews/kitemlistcontroller.h> #include <kitemviews/kitemlistselectionmanager.h> @@ -48,6 +50,7 @@ #include <QGraphicsSceneDragDropEvent> #include <QVBoxLayout> #include <QShowEvent> +#include <QMimeData> PlacesPanel::PlacesPanel(QWidget* parent) : Panel(parent), @@ -101,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>()); @@ -114,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); @@ -340,8 +343,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; @@ -379,8 +382,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) { @@ -423,13 +426,13 @@ void PlacesPanel::slotTrashUpdated(KJob* job) if (job->error()) { emit errorMessage(job->errorString()); } - org::kde::KDirNotify::emitFilesAdded("trash:/"); + org::kde::KDirNotify::emitFilesAdded(QUrl("trash:/")); } 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; @@ -460,8 +463,8 @@ void PlacesPanel::emptyTrash() stream << int(1); KIO::Job *job = KIO::special(KUrl("trash:/"), packedArgs); KNotification::event("Trash: emptied", QString() , QPixmap() , 0, KNotification::DefaultEvent); - job->ui()->setWindow(parentWidget()); - connect(job, SIGNAL(result(KJob*)), SLOT(slotTrashUpdated(KJob*))); + KJobWidgets::setWindow(job, parentWidget()); + connect(job, &KIO::Job::result, this, &PlacesPanel::slotTrashUpdated); } } @@ -524,8 +527,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 { diff --git a/src/panels/terminal/terminalpanel.cpp b/src/panels/terminal/terminalpanel.cpp index bfd3002f0..5c726527e 100644 --- a/src/panels/terminal/terminalpanel.cpp +++ b/src/panels/terminal/terminalpanel.cpp @@ -24,11 +24,12 @@ #include <KPluginLoader> #include <KPluginFactory> #include <KService> -#include <kde_terminal_interface_v2.h> +#include <kde_terminal_interface.h> #include <KParts/Part> #include <KShell> #include <KIO/Job> #include <KIO/JobUiDelegate> +#include <KJobWidgets> #include <QBoxLayout> #include <QDir> @@ -109,10 +110,10 @@ 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<TerminalInterfaceV2 *>(m_konsolePart); + m_terminal = qobject_cast<TerminalInterface*>(m_konsolePart); } } if (m_terminal) { @@ -136,9 +137,9 @@ void TerminalPanel::changeDir(const KUrl& url) } else { m_mostLocalUrlJob = KIO::mostLocalUrl(url, KIO::HideProgressInfo); if (m_mostLocalUrlJob->ui()) { - m_mostLocalUrlJob->ui()->setWindow(this); + KJobWidgets::setWindow(m_mostLocalUrlJob, this); } - connect(m_mostLocalUrlJob, SIGNAL(result(KJob*)), this, SLOT(slotMostLocalUrlResult(KJob*))); + connect(m_mostLocalUrlJob, &KIO::StatJob::result, this, &TerminalPanel::slotMostLocalUrlResult); } } diff --git a/src/panels/terminal/terminalpanel.h b/src/panels/terminal/terminalpanel.h index 374476e1c..987ee4753 100644 --- a/src/panels/terminal/terminalpanel.h +++ b/src/panels/terminal/terminalpanel.h @@ -22,7 +22,7 @@ #include <panels/panel.h> -class TerminalInterfaceV2; +class TerminalInterface; class QVBoxLayout; class QWidget; @@ -78,7 +78,7 @@ private: KIO::StatJob* m_mostLocalUrlJob; QVBoxLayout* m_layout; - TerminalInterfaceV2* m_terminal; + TerminalInterface* m_terminal; QWidget* m_terminalWidget; KParts::ReadOnlyPart* m_konsolePart; QString m_konsolePartCurrentDirectory; |
