Commit affe11d5 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Port to new connect api

parent b60891be
......@@ -119,10 +119,10 @@ struct BrowseMainPagePrivate : public Ui_BrowseMainPage
mFullScreenToolBar2->setBackgroundRole(QPalette::Mid);
// Thumbnail slider
QObject::connect(mThumbnailSlider, SIGNAL(valueChanged(int)),
mThumbnailView, SLOT(setThumbnailWidth(int)));
QObject::connect(mThumbnailView, SIGNAL(thumbnailWidthChanged(int)),
mThumbnailSlider, SLOT(setValue(int)));
QObject::connect(mThumbnailSlider, &ZoomSlider::valueChanged,
mThumbnailView, &ThumbnailView::setThumbnailWidth);
QObject::connect(mThumbnailView, &ThumbnailView::thumbnailWidthChanged,
mThumbnailSlider, &ZoomSlider::setValue);
// Document count label
QMargins labelMargins = mDocumentCountLabel->contentsMargins();
......
......@@ -61,7 +61,7 @@ ConfigDialog::ConfigDialog(QWidget* parent)
pageItem = addPage(widget, i18n("General"));
pageItem->setIcon(QIcon::fromTheme("gwenview"));
connect(mGeneralConfigPage.kcfg_ViewBackgroundValue, SIGNAL(valueChanged(int)), SLOT(updateViewBackgroundFrame()));
connect(mGeneralConfigPage.kcfg_ViewBackgroundValue, &QAbstractSlider::valueChanged, this, &ConfigDialog::updateViewBackgroundFrame);
// Image View
widget = setupPage(mImageViewConfigPage);
......
......@@ -130,10 +130,10 @@ FileOpsContextManagerItem::FileOpsContextManagerItem(ContextManager* manager, QL
mInTrash = false;
mNewFileMenu = new KNewFileMenu(Q_NULLPTR, QString(), this);
connect(contextManager(), SIGNAL(selectionChanged()),
SLOT(updateActions()));
connect(contextManager(), SIGNAL(currentDirUrlChanged(QUrl)),
SLOT(updateActions()));
connect(contextManager(), &ContextManager::selectionChanged,
this, &FileOpsContextManagerItem::updateActions);
connect(contextManager(), &ContextManager::currentDirUrlChanged,
this, &FileOpsContextManagerItem::updateActions);
KActionCategory* file = new KActionCategory(i18nc("@title actions category", "File"), actionCollection);
KActionCategory* edit = new KActionCategory(i18nc("@title actions category", "Edit"), actionCollection);
......@@ -218,8 +218,8 @@ FileOpsContextManagerItem::FileOpsContextManagerItem(ContextManager* manager, QL
<< mShowPropertiesAction
;
connect(QApplication::clipboard(), SIGNAL(dataChanged()),
SLOT(updatePasteAction()));
connect(QApplication::clipboard(), &QClipboard::dataChanged,
this, &FileOpsContextManagerItem::updatePasteAction);
// Delay action update because it must happen *after* main window has called
// createGUI(), otherwise calling mXMLGUIClient->plugActionList() will
......
......@@ -75,7 +75,7 @@ NameFilterWidget::NameFilterWidget(SortedDirModel* model)
QTimer* timer = new QTimer(this);
timer->setInterval(350);
timer->setSingleShot(true);
connect(timer, SIGNAL(timeout()), SLOT(applyNameFilter()));
connect(timer, &QTimer::timeout, this, &NameFilterWidget::applyNameFilter);
connect(mLineEdit, SIGNAL(textChanged(QString)),
timer, SLOT(start()));
......@@ -114,8 +114,8 @@ DateFilterWidget::DateFilterWidget(SortedDirModel* model)
layout->addWidget(mModeComboBox);
layout->addWidget(mDateWidget);
connect(mDateWidget, SIGNAL(dateChanged(QDate)),
SLOT(applyDateFilter()));
connect(mDateWidget, &DateWidget::dateChanged,
this, &DateFilterWidget::applyDateFilter);
connect(mModeComboBox, SIGNAL(currentIndexChanged(int)),
SLOT(applyDateFilter()));
......@@ -255,7 +255,7 @@ public:
closeButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Minimum);
int size = IconSize(KIconLoader::Small);
closeButton->setIconSize(QSize(size, size));
connect(closeButton, SIGNAL(clicked()), SLOT(deleteLater()));
connect(closeButton, &QAbstractButton::clicked, this, &QObject::deleteLater);
QHBoxLayout* layout = new QHBoxLayout(this);
layout->setMargin(2);
layout->setSpacing(2);
......@@ -364,7 +364,7 @@ void FilterController::addFilter(QWidget* widget)
mFrame->layout()->addWidget(container);
mFilterWidgetCount++;
QObject::connect(container, SIGNAL(destroyed()), q, SLOT(slotFilterWidgetClosed()));
QObject::connect(container, &QObject::destroyed, q, &FilterController::slotFilterWidgetClosed);
}
} // namespace
......@@ -104,8 +104,8 @@ FolderViewContextManagerItem::FolderViewContextManagerItem(ContextManager* manag
setupView();
connect(contextManager(), SIGNAL(currentDirUrlChanged(QUrl)),
SLOT(slotCurrentDirUrlChanged(QUrl)));
connect(contextManager(), &ContextManager::currentDirUrlChanged,
this, &FolderViewContextManagerItem::slotCurrentDirUrlChanged);
}
void FolderViewContextManagerItem::slotCurrentDirUrlChanged(const QUrl &url)
......
......@@ -114,8 +114,8 @@ void FullScreenContent::init(KActionCollection* actionCollection, QWidget* autoH
{
mSlideShow = slideShow;
mActionCollection = actionCollection;
connect(actionCollection->action("view"), SIGNAL(toggled(bool)),
SLOT(slotViewModeActionToggled(bool)));
connect(actionCollection->action("view"), &QAction::toggled,
this, &FullScreenContent::slotViewModeActionToggled);
// mAutoHideContainer
mAutoHideContainer = new FullScreenBar(autoHideParentWidget);
......@@ -216,8 +216,8 @@ void FullScreenContent::setCurrentUrl(const QUrl &url)
mCurrentDocument = Document::Ptr();
} else {
mCurrentDocument = DocumentFactory::instance()->load(url);
connect(mCurrentDocument.data(), SIGNAL(metaInfoUpdated()),
SLOT(updateCurrentUrlWidgets()));
connect(mCurrentDocument.data(), &Document::metaInfoUpdated,
this, &FullScreenContent::updateCurrentUrlWidgets);
}
updateCurrentUrlWidgets();
......@@ -263,10 +263,10 @@ void FullScreenContent::showImageMetaInfoDialog()
// it's already quite complicated to create a theme
mImageMetaInfoDialog->setStyle(QApplication::style());
mImageMetaInfoDialog->setAttribute(Qt::WA_DeleteOnClose, true);
connect(mImageMetaInfoDialog, SIGNAL(preferredMetaInfoKeyListChanged(QStringList)),
SLOT(slotPreferredMetaInfoKeyListChanged(QStringList)));
connect(mImageMetaInfoDialog, SIGNAL(destroyed()),
SLOT(slotImageMetaInfoDialogClosed()));
connect(mImageMetaInfoDialog.data(), &ImageMetaInfoDialog::preferredMetaInfoKeyListChanged,
this, &FullScreenContent::slotPreferredMetaInfoKeyListChanged);
connect(mImageMetaInfoDialog.data(), &QObject::destroyed,
this, &FullScreenContent::slotImageMetaInfoDialogClosed);
}
if (mCurrentDocument) {
mImageMetaInfoDialog->setMetaInfo(mCurrentDocument->metaInfo(), GwenviewConfig::fullScreenPreferredMetaInfoKeyList());
......@@ -407,7 +407,7 @@ void FullScreenContent::createOptionsAction()
mOptionsAction->setPriority(QAction::LowPriority);
mOptionsAction->setIcon(QIcon::fromTheme("configure"));
mOptionsAction->setToolTip(i18nc("@info:tooltip", "Configure full screen mode"));
QObject::connect(mOptionsAction, SIGNAL(triggered()), this, SLOT(showOptionsMenu()));
QObject::connect(mOptionsAction, &QAction::triggered, this, &FullScreenContent::showOptionsMenu);
}
......@@ -441,19 +441,19 @@ void FullScreenContent::showOptionsMenu()
// Slideshow checkboxes
widget->mSlideShowLoopCheckBox->setChecked(mSlideShow->loopAction()->isChecked());
connect(widget->mSlideShowLoopCheckBox, SIGNAL(toggled(bool)),
mSlideShow->loopAction(), SLOT(trigger()));
connect(widget->mSlideShowLoopCheckBox, &QAbstractButton::toggled,
mSlideShow->loopAction(), &QAction::trigger);
widget->mSlideShowRandomCheckBox->setChecked(mSlideShow->randomAction()->isChecked());
connect(widget->mSlideShowRandomCheckBox, SIGNAL(toggled(bool)),
mSlideShow->randomAction(), SLOT(trigger()));
connect(widget->mSlideShowRandomCheckBox, &QAbstractButton::toggled,
mSlideShow->randomAction(), &QAction::trigger);
// Interval slider
widget->mSlideShowIntervalSlider->setValue(int(GwenviewConfig::interval()));
connect(widget->mSlideShowIntervalSlider, SIGNAL(valueChanged(int)),
mSlideShow, SLOT(setInterval(int)));
connect(widget->mSlideShowIntervalSlider, SIGNAL(valueChanged(int)),
SLOT(updateSlideShowIntervalLabel()));
connect(widget->mSlideShowIntervalSlider, &QAbstractSlider::valueChanged,
mSlideShow, &SlideShow::setInterval);
connect(widget->mSlideShowIntervalSlider, &QAbstractSlider::valueChanged,
this, &FullScreenContent::updateSlideShowIntervalLabel);
// Interval label
QString text = formatSlideShowIntervalText(88);
......@@ -462,8 +462,8 @@ void FullScreenContent::showOptionsMenu()
updateSlideShowIntervalLabel();
// Image information
connect(widget->mConfigureDisplayedInformationButton, SIGNAL(clicked()),
SLOT(showImageMetaInfoDialog()));
connect(widget->mConfigureDisplayedInformationButton, &QAbstractButton::clicked,
this, &FullScreenContent::showImageMetaInfoDialog);
// Thumbnails
widget->mThumbnailGroupBox->setVisible(mViewPageVisible);
......@@ -471,10 +471,10 @@ void FullScreenContent::showOptionsMenu()
widget->mShowThumbnailsCheckBox->setChecked(GwenviewConfig::showFullScreenThumbnails());
widget->mHeightSlider->setMinimum(mMinimumThumbnailBarHeight);
widget->mHeightSlider->setValue(mThumbnailBar->height());
connect(widget->mShowThumbnailsCheckBox, SIGNAL(toggled(bool)),
SLOT(slotShowThumbnailsToggled(bool)));
connect(widget->mHeightSlider, SIGNAL(valueChanged(int)),
SLOT(setFullScreenBarHeight(int)));
connect(widget->mShowThumbnailsCheckBox, &QAbstractButton::toggled,
this, &FullScreenContent::slotShowThumbnailsToggled);
connect(widget->mHeightSlider, &QAbstractSlider::valueChanged,
this, &FullScreenContent::setFullScreenBarHeight);
}
// Show menu below its button
......
......@@ -133,8 +133,8 @@ ImageMetaInfoDialog::ImageMetaInfoDialog(QWidget* parent)
layout()->addWidget(d->mTreeView);
QDialogButtonBox *buttonBox = new QDialogButtonBox(QDialogButtonBox::Close);
layout()->addWidget(buttonBox);
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
connect(buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
ImageMetaInfoDialog::~ImageMetaInfoDialog()
......@@ -146,8 +146,8 @@ void ImageMetaInfoDialog::setMetaInfo(ImageMetaInfoModel* model, const QStringLi
{
if (model) {
d->mModel.reset(new PreferredImageMetaInfoModel(model, list));
connect(d->mModel.get(), SIGNAL(preferredMetaInfoKeyListChanged(QStringList)),
this, SIGNAL(preferredMetaInfoKeyListChanged(QStringList)));
connect(d->mModel.get(), &PreferredImageMetaInfoModel::preferredMetaInfoKeyListChanged,
this, &ImageMetaInfoDialog::preferredMetaInfoKeyListChanged);
} else {
d->mModel.reset(nullptr);
}
......
......@@ -155,12 +155,12 @@ ImageOpsContextManagerItem::ImageOpsContextManagerItem(ContextManager* manager,
EventWatcher::install(d->mGroup, QEvent::Show, this, SLOT(updateSideBarContent()));
d->setupActions();
updateActions();
connect(contextManager(), SIGNAL(selectionChanged()),
SLOT(updateActions()));
connect(mainWindow, SIGNAL(viewModeChanged()),
SLOT(updateActions()));
connect(mainWindow->viewMainPage(), SIGNAL(completed()),
SLOT(updateActions()));
connect(contextManager(), &ContextManager::selectionChanged,
this, &ImageOpsContextManagerItem::updateActions);
connect(mainWindow, &MainWindow::viewModeChanged,
this, &ImageOpsContextManagerItem::updateActions);
connect(mainWindow->viewMainPage(), &ViewMainPage::completed,
this, &ImageOpsContextManagerItem::updateActions);
}
ImageOpsContextManagerItem::~ImageOpsContextManagerItem()
......
......@@ -264,10 +264,10 @@ InfoContextManagerItem::InfoContextManagerItem(ContextManager* manager)
{
d->q = this;
d->setupGroup();
connect(contextManager(), SIGNAL(selectionChanged()),
SLOT(updateSideBarContent()));
connect(contextManager(), SIGNAL(selectionDataChanged()),
SLOT(updateSideBarContent()));
connect(contextManager(), &ContextManager::selectionChanged,
this, &InfoContextManagerItem::updateSideBarContent);
connect(contextManager(), &ContextManager::selectionDataChanged,
this, &InfoContextManagerItem::updateSideBarContent);
}
InfoContextManagerItem::~InfoContextManagerItem()
......@@ -309,8 +309,8 @@ void InfoContextManagerItem::fillOneFileGroup(const KFileItem& item)
d->forgetCurrentDocument();
d->mDocument = DocumentFactory::instance()->load(item.url());
connect(d->mDocument.data(), SIGNAL(metaInfoUpdated()),
SLOT(updateOneFileInfo()));
connect(d->mDocument.data(), &Document::metaInfoUpdated,
this, &InfoContextManagerItem::updateOneFileInfo);
d->updateMetaInfoDialog();
updateOneFileInfo();
......@@ -366,8 +366,8 @@ void InfoContextManagerItem::showMetaInfoDialog()
if (!d->mImageMetaInfoDialog) {
d->mImageMetaInfoDialog = new ImageMetaInfoDialog(d->mOneFileWidget);
d->mImageMetaInfoDialog->setAttribute(Qt::WA_DeleteOnClose, true);
connect(d->mImageMetaInfoDialog, SIGNAL(preferredMetaInfoKeyListChanged(QStringList)),
SLOT(slotPreferredMetaInfoKeyListChanged(QStringList)));
connect(d->mImageMetaInfoDialog.data(), &ImageMetaInfoDialog::preferredMetaInfoKeyListChanged,
this, &InfoContextManagerItem::slotPreferredMetaInfoKeyListChanged);
}
d->mImageMetaInfoDialog->setMetaInfo(d->mDocument ? d->mDocument->metaInfo() : nullptr, GwenviewConfig::preferredMetaInfoKeyList());
d->mImageMetaInfoDialog->show();
......
......@@ -72,8 +72,8 @@ KIPIExportAction::KIPIExportAction(QObject* parent)
setToolTip(i18nc("@info:tooltip", "Share images using various services"));
setDelayed(false);
connect(menu(), SIGNAL(aboutToShow()), SLOT(init()));
connect(menu(), SIGNAL(triggered(QAction*)), SLOT(slotPluginTriggered(QAction*)));
connect(menu(), &QMenu::aboutToShow, this, &KIPIExportAction::init);
connect(menu(), &QMenu::triggered, this, &KIPIExportAction::slotPluginTriggered);
}
KIPIExportAction::~KIPIExportAction()
......@@ -100,7 +100,7 @@ void KIPIExportAction::init()
}
}
// We are done, don't come back next time menu is shown
disconnect(menu(), SIGNAL(aboutToShow()), this, SLOT(init()));
disconnect(menu(), &QMenu::aboutToShow, this, &KIPIExportAction::init);
// TODO: Temporary fix for the 'Share' menu not showing when updated
// the second time. See Bug 395034 and D13312
d->updateMenu();
......
......@@ -241,10 +241,10 @@ KIPIInterface::KIPIInterface(MainWindow* mainWindow)
connect(&d->mPluginLoadTimer, &QTimer::timeout, this, &KIPIInterface::loadPlugins);
d->setupPluginsMenu();
QObject::connect(d->mMainWindow->contextManager(), SIGNAL(selectionChanged()),
this, SLOT(slotSelectionChanged()));
QObject::connect(d->mMainWindow->contextManager(), SIGNAL(currentDirUrlChanged(QUrl)),
this, SLOT(slotDirectoryChanged()));
QObject::connect(d->mMainWindow->contextManager(), &ContextManager::selectionChanged,
this, &KIPIInterface::slotSelectionChanged);
QObject::connect(d->mMainWindow->contextManager(), &ContextManager::currentDirUrlChanged,
this, &KIPIInterface::slotDirectoryChanged);
#if 0
//TODO instead of delaying can we load them all at start-up to use actions somewhere else?
// delay a bit, so that it's called after loadPlugins()
......
......@@ -213,16 +213,16 @@ struct MainWindow::Private
void setupContextManager()
{
mContextManager = new ContextManager(mDirModel, q);
connect(mContextManager, SIGNAL(selectionChanged()),
q, SLOT(slotSelectionChanged()));
connect(mContextManager, SIGNAL(currentDirUrlChanged(QUrl)),
q, SLOT(slotCurrentDirUrlChanged(QUrl)));
connect(mContextManager, &ContextManager::selectionChanged,
q, &MainWindow::slotSelectionChanged);
connect(mContextManager, &ContextManager::currentDirUrlChanged,
q, &MainWindow::slotCurrentDirUrlChanged);
}
void setupWidgets()
{
mFullScreenContent = new FullScreenContent(q, mGvCore);
connect(mContextManager, SIGNAL(currentUrlChanged(QUrl)), mFullScreenContent, SLOT(setCurrentUrl(QUrl)));
connect(mContextManager, &ContextManager::currentUrlChanged, mFullScreenContent, &FullScreenContent::setCurrentUrl);
mCentralSplitter = new Splitter(Qt::Horizontal, q);
q->setCentralWidget(mCentralSplitter);
......@@ -234,7 +234,7 @@ struct MainWindow::Private
mContentWidget = new QWidget(mCentralSplitter);
mSaveBar = new SaveBar(mContentWidget, q->actionCollection());
connect(mContextManager, SIGNAL(currentUrlChanged(QUrl)), mSaveBar, SLOT(setCurrentUrl(QUrl)));
connect(mContextManager, &ContextManager::currentUrlChanged, mSaveBar, &SaveBar::setCurrentUrl);
mViewStackedWidget = new QStackedWidget(mContentWidget);
QVBoxLayout* layout = new QVBoxLayout(mContentWidget);
layout->addWidget(mSaveBar);
......@@ -245,7 +245,7 @@ struct MainWindow::Private
mStartSlideShowWhenDirListerCompleted = false;
mSlideShow = new SlideShow(q);
connect(mContextManager, SIGNAL(currentUrlChanged(QUrl)), mSlideShow, SLOT(setCurrentUrl(QUrl)));
connect(mContextManager, &ContextManager::currentUrlChanged, mSlideShow, &SlideShow::setCurrentUrl);
setupThumbnailView(mViewStackedWidget);
setupViewMainPage(mViewStackedWidget);
......@@ -261,13 +261,13 @@ struct MainWindow::Private
mThumbnailView->setFocus();
connect(mSaveBar, SIGNAL(requestSaveAll()),
mGvCore, SLOT(saveAll()));
connect(mSaveBar, SIGNAL(goToUrl(QUrl)),
q, SLOT(goToUrl(QUrl)));
connect(mSaveBar, &SaveBar::requestSaveAll,
mGvCore, &GvCore::saveAll);
connect(mSaveBar, &SaveBar::goToUrl,
q, &MainWindow::goToUrl);
connect(mSlideShow, SIGNAL(goToUrl(QUrl)),
q, SLOT(goToUrl(QUrl)));
connect(mSlideShow, &SlideShow::goToUrl,
q, &MainWindow::goToUrl);
}
void setupThumbnailView(QWidget* parent)
......@@ -283,15 +283,15 @@ struct MainWindow::Private
mThumbnailView->setDocumentInfoProvider(mDocumentInfoProvider);
mThumbnailViewHelper = new ThumbnailViewHelper(mDirModel, q->actionCollection());
connect(mContextManager, SIGNAL(currentDirUrlChanged(QUrl)),
mThumbnailViewHelper, SLOT(setCurrentDirUrl(QUrl)));
connect(mContextManager, &ContextManager::currentDirUrlChanged,
mThumbnailViewHelper, &ThumbnailViewHelper::setCurrentDirUrl);
mThumbnailView->setThumbnailViewHelper(mThumbnailViewHelper);
mThumbnailBarSelectionModel = new KLinkItemSelectionModel(mThumbnailBarModel, mContextManager->selectionModel(), q);
// Connect thumbnail view
connect(mThumbnailView, SIGNAL(indexActivated(QModelIndex)),
q, SLOT(slotThumbnailViewIndexActivated(QModelIndex)));
connect(mThumbnailView, &ThumbnailView::indexActivated,
q, &MainWindow::slotThumbnailViewIndexActivated);
// Connect delegate
QAbstractItemDelegate* delegate = mThumbnailView->itemDelegate();
......@@ -307,21 +307,21 @@ struct MainWindow::Private
mGvCore, SLOT(setRating(QUrl,int)));
// Connect url navigator
connect(mUrlNavigator, SIGNAL(urlChanged(QUrl)),
q, SLOT(openDirUrl(QUrl)));
connect(mUrlNavigator, &KUrlNavigator::urlChanged,
q, &MainWindow::openDirUrl);
}
void setupViewMainPage(QWidget* parent)
{
mViewMainPage = new ViewMainPage(parent, mSlideShow, q->actionCollection(), mGvCore);
connect(mViewMainPage, SIGNAL(captionUpdateRequested(QString)),
q, SLOT(slotUpdateCaption(QString)));
connect(mViewMainPage, SIGNAL(completed()),
q, SLOT(slotPartCompleted()));
connect(mViewMainPage, SIGNAL(previousImageRequested()),
q, SLOT(goToPrevious()));
connect(mViewMainPage, SIGNAL(nextImageRequested()),
q, SLOT(goToNext()));
connect(mViewMainPage, &ViewMainPage::captionUpdateRequested,
q, &MainWindow::slotUpdateCaption);
connect(mViewMainPage, &ViewMainPage::completed,
q, &MainWindow::slotPartCompleted);
connect(mViewMainPage, &ViewMainPage::previousImageRequested,
q, &MainWindow::goToPrevious);
connect(mViewMainPage, &ViewMainPage::nextImageRequested,
q, &MainWindow::goToNext);
connect(mViewMainPage, &ViewMainPage::openUrlRequested,
q, &MainWindow::openUrl);
connect(mViewMainPage, &ViewMainPage::openDirUrlRequested,
......@@ -345,8 +345,8 @@ struct MainWindow::Private
void setupStartMainPage(QWidget* parent)
{
mStartMainPage = new StartMainPage(parent, mGvCore);
connect(mStartMainPage, SIGNAL(urlSelected(QUrl)),
q, SLOT(slotStartMainPageUrlSelected(QUrl)));
connect(mStartMainPage, &StartMainPage::urlSelected,
q, &MainWindow::slotStartMainPageUrlSelected);
connect(mStartMainPage, &StartMainPage::recentFileRemoved, [this](const QUrl& url) {
mFileOpenRecentAction->removeUrl(url);
});
......@@ -392,8 +392,8 @@ struct MainWindow::Private
mBrowseAction->setCheckable(true);
mBrowseAction->setIcon(QIcon::fromTheme("view-list-icons"));
actionCollection->setDefaultShortcut(mBrowseAction, Qt::Key_Escape);
connect(mViewMainPage, SIGNAL(goToBrowseModeRequested()),
mBrowseAction, SLOT(trigger()));
connect(mViewMainPage, &ViewMainPage::goToBrowseModeRequested,
mBrowseAction, &QAction::trigger);
mViewAction = view->addAction("view");
mViewAction->setText(i18nc("@action:intoolbar Switch to image view", "View"));
......@@ -405,16 +405,16 @@ struct MainWindow::Private
mViewModeActionGroup->addAction(mBrowseAction);
mViewModeActionGroup->addAction(mViewAction);
connect(mViewModeActionGroup, SIGNAL(triggered(QAction*)),
q, SLOT(setActiveViewModeAction(QAction*)));
connect(mViewModeActionGroup, &QActionGroup::triggered,
q, &MainWindow::setActiveViewModeAction);
mFullScreenAction = KStandardAction::fullScreen(q, &MainWindow::toggleFullScreen, q, actionCollection);
QList<QKeySequence> shortcuts = mFullScreenAction->shortcuts();
shortcuts.append(QKeySequence(Qt::Key_F11));
actionCollection->setDefaultShortcuts(mFullScreenAction, shortcuts);
connect(mViewMainPage, SIGNAL(toggleFullScreenRequested()),
mFullScreenAction, SLOT(trigger()));
connect(mViewMainPage, &ViewMainPage::toggleFullScreenRequested,
mFullScreenAction, &QAction::trigger);
QAction * leaveFullScreenAction = view->addAction("leave_fullscreen", q, SLOT(leaveFullScreen()));
leaveFullScreenAction->setIcon(QIcon::fromTheme("view-restore"));
......@@ -467,15 +467,15 @@ struct MainWindow::Private
mToggleSideBarAction->setIcon(QIcon::fromTheme("view-sidetree"));
actionCollection->setDefaultShortcut(mToggleSideBarAction, Qt::Key_F4);
mToggleSideBarAction->setText(i18nc("@action", "Sidebar"));
connect(mBrowseMainPage->toggleSideBarButton(), SIGNAL(clicked()),
mToggleSideBarAction, SLOT(trigger()));
connect(mViewMainPage->toggleSideBarButton(), SIGNAL(clicked()),
mToggleSideBarAction, SLOT(trigger()));
connect(mBrowseMainPage->toggleSideBarButton(), &QAbstractButton::clicked,
mToggleSideBarAction, &QAction::trigger);
connect(mViewMainPage->toggleSideBarButton(), &QAbstractButton::clicked,
mToggleSideBarAction, &QAction::trigger);
mToggleSlideShowAction = view->addAction("toggle_slideshow", q, SLOT(toggleSlideShow()));
q->updateSlideShowAction();
connect(mSlideShow, SIGNAL(stateChanged(bool)),
q, SLOT(updateSlideShowAction()));
connect(mSlideShow, &SlideShow::stateChanged,
q, &MainWindow::updateSlideShowAction);
q->setStandardToolBarMenuEnabled(true);
......@@ -581,13 +581,13 @@ struct MainWindow::Private
| MimeTypeUtils::KIND_SVG_IMAGE
| MimeTypeUtils::KIND_VIDEO);
connect(mDirModel, SIGNAL(rowsInserted(QModelIndex,int,int)),
q, SLOT(slotDirModelNewItems()));
connect(mDirModel, &QAbstractItemModel::rowsInserted,
q, &MainWindow::slotDirModelNewItems);
connect(mDirModel, SIGNAL(rowsRemoved(QModelIndex,int,int)),
q, SLOT(updatePreviousNextActions()));
connect(mDirModel, SIGNAL(modelReset()),
q, SLOT(updatePreviousNextActions()));
connect(mDirModel, &QAbstractItemModel::rowsRemoved,
q, &MainWindow::updatePreviousNextActions);
connect(mDirModel, &QAbstractItemModel::modelReset,
q, &MainWindow::updatePreviousNextActions);
connect(mDirModel->dirLister(), SIGNAL(completed()),
q, SLOT(slotDirListerCompleted()));
......@@ -851,8 +851,8 @@ MainWindow::MainWindow()
createGUI();
loadConfig();
connect(DocumentFactory::instance(), SIGNAL(modifiedDocumentListChanged()),
SLOT(slotModifiedDocumentListChanged()));
connect(DocumentFactory::instance(), &DocumentFactory::modifiedDocumentListChanged,
this, &MainWindow::slotModifiedDocumentListChanged);
#ifdef HAVE_QTDBUS
d->mMpris2Service = new Mpris2Service(d->mSlideShow, d->mContextManager,
......@@ -959,7 +959,7 @@ void MainWindow::setActiveViewModeAction(QAction* action)
d->mViewStackedWidget->setCurrentWidget(d->mViewMainPage);
openSelectedDocuments();
d->mPreloadDirectionIsForward = true;
QTimer::singleShot(VIEW_PRELOAD_DELAY, this, SLOT(preloadNextUrl()));
QTimer::singleShot(VIEW_PRELOAD_DELAY, this, &MainWindow::preloadNextUrl);
} else {
d->mCurrentMainPageId = BrowseMainPageId;
// Switching to browse mode
......@@ -1215,7 +1215,7 @@ void MainWindow::slotSelectionChanged()
// Start preloading
int preloadDelay = d->mCurrentMainPageId == ViewMainPageId ? VIEW_PRELOAD_DELAY : BROWSE_PRELOAD_DELAY;
QTimer::singleShot(preloadDelay, this, SLOT(preloadNextUrl()));
QTimer::singleShot(preloadDelay, this, &MainWindow::preloadNextUrl);
}
void MainWindow::slotCurrentDirUrlChanged(const QUrl &url)
......@@ -1239,7 +1239,7 @@ void MainWindow::slotDirListerCompleted()
{
if (d->mStartSlideShowWhenDirListerCompleted) {
d->mStartSlideShowWhenDirListerCompleted = false;
QTimer::singleShot(0, d->mToggleSlideShowAction, SLOT(trigger()));
QTimer::singleShot(0, d->mToggleSlideShowAction, &QAction::trigger);
}
if (d->mContextManager->selectionModel()->hasSelection()) {
updatePreviousNextActions();
......@@ -1513,7 +1513,7 @@ void MainWindow::showConfigDialog()
saveConfig();
DialogGuard<ConfigDialog> dialog(this);
connect(dialog.data(), SIGNAL(settingsChanged(QString)), SLOT(loadConfig()));
connect(dialog.data(), &KConfigDialog::settingsChanged, this, &MainWindow::loadConfig);
dialog->exec();
}
......
......@@ -77,8 +77,8 @@ void Preloader::preload(const QUrl &url, const QSize& size)
d->mDocument = DocumentFactory::instance()->load(url);
d->mSize = size;
connect(d->mDocument.data(), SIGNAL(metaInfoUpdated()),
SLOT(doPreload()));
connect(d->mDocument.data(), &Document::metaInfoUpdated,
this, &Preloader::doPreload);