Commit 655fdfb6 authored by David Edmundson's avatar David Edmundson
Browse files

port old style connects

parent e37cd4dd
......@@ -99,21 +99,21 @@ KDEPlatformFileDialog::KDEPlatformFileDialog()
, m_fileWidget(new KFileWidget(QUrl(), this))
{
setLayout(new QVBoxLayout);
connect(m_fileWidget, SIGNAL(filterChanged(QString)), SIGNAL(filterSelected(QString)));
connect(m_fileWidget, &KFileWidget::filterChanged, this, &KDEPlatformFileDialogBase::filterSelected);
layout()->addWidget(m_fileWidget);
m_buttons = new QDialogButtonBox(this);
m_buttons->addButton(m_fileWidget->okButton(), QDialogButtonBox::AcceptRole);
m_buttons->addButton(m_fileWidget->cancelButton(), QDialogButtonBox::RejectRole);
connect(m_buttons, SIGNAL(rejected()), m_fileWidget, SLOT(slotCancel()));
connect(m_buttons, &QDialogButtonBox::rejected, m_fileWidget, &KFileWidget::slotCancel);
// Also call the cancel function when the dialog is closed via the escape key
// or titlebar close button to make sure we always save the view config
connect(this, &KDEPlatformFileDialog::rejected,
m_fileWidget, &KFileWidget::slotCancel);
connect(m_fileWidget->okButton(), SIGNAL(clicked(bool)), m_fileWidget, SLOT(slotOk()));
connect(m_fileWidget, SIGNAL(accepted()), m_fileWidget, SLOT(accept()));
connect(m_fileWidget, SIGNAL(accepted()), SLOT(accept()));
connect(m_fileWidget->cancelButton(), SIGNAL(clicked(bool)), SLOT(reject()));
connect(m_fileWidget->okButton(), &QAbstractButton::clicked, m_fileWidget, &KFileWidget::slotOk);
connect(m_fileWidget, &KFileWidget::accepted, m_fileWidget, &KFileWidget::accept);
connect(m_fileWidget, &KFileWidget::accepted, this, &QDialog::accept);
connect(m_fileWidget->cancelButton(), &QAbstractButton::clicked, this, &QDialog::reject);
connect(m_fileWidget->dirOperator(), &KDirOperator::urlEntered, this, &KDEPlatformFileDialogBase::directoryEntered);
layout()->addWidget(m_buttons);
}
......@@ -257,15 +257,15 @@ KDEPlatformFileDialogHelper::KDEPlatformFileDialogHelper()
: QPlatformFileDialogHelper()
, m_dialog(new KDEPlatformFileDialog)
{
connect(m_dialog, SIGNAL(closed()), SLOT(saveSize()));
connect(m_dialog, SIGNAL(finished(int)), SLOT(saveSize()));
connect(m_dialog, SIGNAL(currentChanged(QUrl)), SIGNAL(currentChanged(QUrl)));
connect(m_dialog, SIGNAL(directoryEntered(QUrl)), SIGNAL(directoryEntered(QUrl)));
connect(m_dialog, SIGNAL(fileSelected(QUrl)), SIGNAL(fileSelected(QUrl)));
connect(m_dialog, SIGNAL(filesSelected(QList<QUrl>)), SIGNAL(filesSelected(QList<QUrl>)));
connect(m_dialog, SIGNAL(filterSelected(QString)), SIGNAL(filterSelected(QString)));
connect(m_dialog, SIGNAL(accepted()), SIGNAL(accept()));
connect(m_dialog, SIGNAL(rejected()), SIGNAL(reject()));
connect(m_dialog, &KDEPlatformFileDialogBase::closed, this, &KDEPlatformFileDialogHelper::saveSize);
connect(m_dialog, &QDialog::finished, this, &KDEPlatformFileDialogHelper::saveSize);
connect(m_dialog, &KDEPlatformFileDialogBase::currentChanged, this, &QPlatformFileDialogHelper::currentChanged);
connect(m_dialog, &KDEPlatformFileDialogBase::directoryEntered, this, &QPlatformFileDialogHelper::directoryEntered);
connect(m_dialog, &KDEPlatformFileDialogBase::fileSelected, this, &QPlatformFileDialogHelper::fileSelected);
connect(m_dialog, &KDEPlatformFileDialogBase::filesSelected, this, &QPlatformFileDialogHelper::filesSelected);
connect(m_dialog, &KDEPlatformFileDialogBase::filterSelected, this, &QPlatformFileDialogHelper::filterSelected);
connect(m_dialog, &QDialog::accepted, this, &QPlatformDialogHelper::accept);
connect(m_dialog, &QDialog::rejected, this, &QPlatformDialogHelper::reject);
}
KDEPlatformFileDialogHelper::~KDEPlatformFileDialogHelper()
......@@ -280,8 +280,8 @@ void KDEPlatformFileDialogHelper::initializeDialog()
if (options()->testOption(QFileDialogOptions::ShowDirsOnly)) {
m_dialog->deleteLater();
m_dialog = new KDirSelectDialog(options()->initialDirectory());
connect(m_dialog, SIGNAL(accepted()), SIGNAL(accept()));
connect(m_dialog, SIGNAL(rejected()), SIGNAL(reject()));
connect(m_dialog, &QDialog::accepted, this, &QPlatformDialogHelper::accept);
connect(m_dialog, &QDialog::rejected, this, &QPlatformDialogHelper::reject);
if (!options()->windowTitle().isEmpty())
m_dialog->setWindowTitle(options()->windowTitle());
} else {
......
......@@ -297,7 +297,7 @@ KDirSelectDialog::KDirSelectDialog(const QUrl &startDir, bool localOnly, QWidget
m_buttons->addButton(folderButton, QDialogButtonBox::ActionRole);
m_buttons->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
connect(m_buttons, SIGNAL(accepted()), this, SLOT(accept()));
connect(m_buttons, SIGNAL(rejected()), this, SLOT(reject()));
connect(m_buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
topLayout->addWidget(m_buttons);
QHBoxLayout *hlay = new QHBoxLayout(page);
......@@ -310,8 +310,8 @@ KDirSelectDialog::KDirSelectDialog(const QUrl &startDir, bool localOnly, QWidget
d->m_placesView->setObjectName(QStringLiteral("speedbar"));
d->m_placesView->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff);
d->m_placesView->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Minimum);
connect(d->m_placesView, SIGNAL(urlChanged(QUrl)),
SLOT(setCurrentUrl(QUrl)));
connect(d->m_placesView, &KFilePlacesView::urlChanged,
this, &KDirSelectDialog::setCurrentUrl);
hlay->addWidget(d->m_placesView);
hlay->addLayout(mainLayout);
......@@ -362,7 +362,7 @@ KDirSelectDialog::KDirSelectDialog(const QUrl &startDir, bool localOnly, QWidget
d->showHiddenFoldersAction = new KToggleAction(i18nc("@option:check", "Show Hidden Folders"), this);
d->m_actions->addAction(d->showHiddenFoldersAction->objectName(), d->showHiddenFoldersAction);
d->showHiddenFoldersAction->setShortcut(Qt::Key_F8);
connect(d->showHiddenFoldersAction, SIGNAL(triggered(bool)), d->m_treeView, SLOT(setShowHiddenFiles(bool)));
connect(d->showHiddenFoldersAction, &QAction::triggered, d->m_treeView, &KFileTreeView::setShowHiddenFiles);
d->m_contextMenu->addAction(d->showHiddenFoldersAction);
d->m_contextMenu->addSeparator();
......
......@@ -192,7 +192,7 @@ void KFileTreeView::contextMenuEvent(QContextMenuEvent *event)
QMenu menu;
KToggleAction *showHiddenAction = new KToggleAction(i18n("Show Hidden Folders"), &menu);
showHiddenAction->setChecked(d->mSourceModel->dirLister()->showingDotFiles());
connect(showHiddenAction, SIGNAL(toggled(bool)), this, SLOT(setShowHiddenFiles(bool)));
connect(showHiddenAction, &QAction::toggled, this, &KFileTreeView::setShowHiddenFiles);
menu.addAction(showHiddenAction);
menu.exec(event->globalPos());
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment