Commit 7d97e81e authored by David Edmundson's avatar David Edmundson
Browse files

port old style connects

parent 335d04ac
......@@ -129,7 +129,7 @@ KCMShellMultiDialog::KCMShellMultiDialog(KPageDialog::FaceType dialogFace, QWidg
QDBusConnection::sessionBus().registerObject(QStringLiteral("/KCModule/dialog"), this, QDBusConnection::ExportScriptableSlots);
connect(this, &KCMShellMultiDialog::currentPageChanged,
this, [this](KPageWidgetItem *newPage,KPageWidgetItem *oldPage) {
this, [](KPageWidgetItem *newPage,KPageWidgetItem *oldPage) {
Q_UNUSED(oldPage);
KCModuleProxy *activeModule = newPage->widget()->findChild<KCModuleProxy *>();
if (activeModule) {
......@@ -159,8 +159,8 @@ void KCMShell::waitForExit()
watcher->setConnection(QDBusConnection::sessionBus());
watcher->setWatchMode(QDBusServiceWatcher::WatchForOwnerChange);
watcher->addWatchedService(m_serviceName);
connect(watcher, SIGNAL(serviceOwnerChanged(QString,QString,QString)),
SLOT(appExit(QString,QString,QString)));
connect(watcher, &QDBusServiceWatcher::serviceOwnerChanged,
this, &KCMShell::appExit);
exec();
}
......
......@@ -57,7 +57,7 @@ KDEsuDialog::KDEsuDialog(QByteArray user, QByteArray authUser, bool enableKeep,
setPrompt(prompt);
if( withIgnoreButton ) {
connect(buttonBox()->button(QDialogButtonBox::Ignore), SIGNAL(clicked()), SLOT(slotUser1()));
connect(buttonBox()->button(QDialogButtonBox::Ignore), &QAbstractButton::clicked, this, &KDEsuDialog::slotUser1);
}
}
......
......@@ -69,7 +69,7 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
iconButton = new KIconButton(firstWidget);
iconButton->setIconType(KIconLoader::Desktop, KIconLoader::MimeType);
connect(iconButton, SIGNAL(iconChanged(QString)), SLOT(updateIcon(QString)));
connect(iconButton, &KIconButton::iconChanged, this, &FileTypeDetails::updateIcon);
iconButton->setWhatsThis( i18n("This button displays the icon associated"
" with the selected file type. Click on it to choose a different icon.") );
iconButton->setFixedSize(70, 70);
......@@ -82,7 +82,7 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
hBox = new QHBoxLayout(gb);
extensionLB = new QListWidget(gb);
connect(extensionLB, SIGNAL(itemSelectionChanged()), SLOT(enableExtButtons()));
connect(extensionLB, &QListWidget::itemSelectionChanged, this, &FileTypeDetails::enableExtButtons);
hBox->addWidget(extensionLB);
extensionLB->setFixedHeight(extensionLB->minimumSizeHint().height());
......@@ -99,16 +99,16 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
addExtButton = new QPushButton(i18n("Add..."), gb);
addExtButton->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
addExtButton->setEnabled(false);
connect(addExtButton, SIGNAL(clicked()),
this, SLOT(addExtension()));
connect(addExtButton, &QAbstractButton::clicked,
this, &FileTypeDetails::addExtension);
vbox->addWidget(addExtButton);
addExtButton->setWhatsThis( i18n("Add a new pattern for the selected file type.") );
removeExtButton = new QPushButton(i18n("Remove"), gb);
removeExtButton->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
removeExtButton->setEnabled(false);
connect(removeExtButton, SIGNAL(clicked()),
this, SLOT(removeExtension()));
connect(removeExtButton, &QAbstractButton::clicked,
this, &FileTypeDetails::removeExtension);
vbox->addWidget(removeExtButton);
removeExtButton->setWhatsThis( i18n("Remove the selected filename pattern.") );
......@@ -118,8 +118,8 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
description = new KLineEdit(firstWidget);
description->setClearButtonEnabled(true);
connect(description, SIGNAL(textChanged(const QString &)),
SLOT(updateDescription(const QString &)));
connect(description, &QLineEdit::textChanged,
this, &FileTypeDetails::updateDescription);
QHBoxLayout *descriptionBox = new QHBoxLayout;
descriptionBox->addWidget(new QLabel(i18n("Description:"),firstWidget));
......@@ -132,7 +132,7 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
description->setWhatsThis( wtstr );
serviceListWidget = new KServiceListWidget( KServiceListWidget::SERVICELIST_APPLICATIONS, firstWidget );
connect( serviceListWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
connect( serviceListWidget, &KServiceListWidget::changed, this, &FileTypeDetails::changed);
firstLayout->addWidget(serviceListWidget,5);
// Second tab - Embedding
......@@ -149,7 +149,7 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
m_rbGroupSettings = new QRadioButton( QStringLiteral("Use settings for '%1' group") );
m_chkAskSave = new QCheckBox( i18n("Ask whether to save to disk instead (only for Konqueror browser)") );
connect(m_chkAskSave, SIGNAL( toggled(bool) ), SLOT( slotAskSaveToggled(bool) ));
connect(m_chkAskSave, &QAbstractButton::toggled, this, &FileTypeDetails::slotAskSaveToggled);
m_autoEmbedGroup = new QButtonGroup(m_autoEmbedBox);
m_autoEmbedGroup->addButton(embViewerRadio, 0);
......@@ -172,7 +172,7 @@ FileTypeDetails::FileTypeDetails( QWidget * parent )
embedServiceListWidget = new KServiceListWidget( KServiceListWidget::SERVICELIST_SERVICES, secondWidget );
// embedServiceListWidget->setMinimumHeight( serviceListWidget->sizeHint().height() );
connect( embedServiceListWidget, SIGNAL(changed(bool)), this, SIGNAL(changed(bool)));
connect( embedServiceListWidget, &KServiceListWidget::changed, this, &FileTypeDetails::changed);
secondLayout->addWidget(embedServiceListWidget);
m_tabWidget->addTab( firstWidget, i18n("&General") );
......
......@@ -89,8 +89,8 @@ FileTypesView::FileTypesView(QWidget *parent, const QVariantList &)
patternFilterLE->setPlaceholderText(i18n("Search for file type or filename pattern..."));
leftLayout->addWidget(patternFilterLE);
connect(patternFilterLE, SIGNAL(textChanged(const QString &)),
this, SLOT(slotFilter(const QString &)));
connect(patternFilterLE, &QLineEdit::textChanged,
this, &FileTypesView::slotFilter);
wtstr = i18n("Enter a part of a filename pattern, and only file types with a "
"matching file pattern will appear in the list. Alternatively, enter "
......@@ -102,10 +102,10 @@ FileTypesView::FileTypesView(QWidget *parent, const QVariantList &)
typesLV->setHeaderLabel(i18n("Known Types"));
leftLayout->addWidget(typesLV);
connect(typesLV, SIGNAL(currentItemChanged(QTreeWidgetItem *, QTreeWidgetItem *)),
this, SLOT(updateDisplay(QTreeWidgetItem *)));
connect(typesLV, SIGNAL(itemDoubleClicked(QTreeWidgetItem *, int)),
this, SLOT(slotDoubleClicked(QTreeWidgetItem *)));
connect(typesLV, &QTreeWidget::currentItemChanged,
this, &FileTypesView::updateDisplay);
connect(typesLV, &QTreeWidget::itemDoubleClicked,
this, &FileTypesView::slotDoubleClicked);
typesLV->setWhatsThis( i18n("Here you can see a hierarchical list of"
" the file types which are known on your system. Click on the '+' sign"
......@@ -118,14 +118,14 @@ FileTypesView::FileTypesView(QWidget *parent, const QVariantList &)
btnsLay->addStretch(1);
QPushButton *addTypeB = new QPushButton(i18n("Add..."), this);
addTypeB->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
connect(addTypeB, SIGNAL(clicked()), SLOT(addType()));
connect(addTypeB, &QAbstractButton::clicked, this, &FileTypesView::addType);
btnsLay->addWidget(addTypeB);
addTypeB->setWhatsThis( i18n("Click here to add a new file type.") );
m_removeTypeB = new QPushButton(i18n("&Remove"), this);
m_removeTypeB->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
connect(m_removeTypeB, SIGNAL(clicked()), SLOT(removeType()));
connect(m_removeTypeB, &QAbstractButton::clicked, this, &FileTypesView::removeType);
btnsLay->addWidget(m_removeTypeB);
m_removeTypeB->setEnabled(false);
m_removeButtonSaysRevert = false;
......@@ -137,16 +137,16 @@ FileTypesView::FileTypesView(QWidget *parent, const QVariantList &)
// File Type Details
m_details = new FileTypeDetails( m_widgetStack );
connect( m_details, SIGNAL( changed(bool) ),
this, SLOT( setDirty(bool) ) );
connect( m_details, SIGNAL( embedMajor(const QString &, bool &) ),
this, SLOT( slotEmbedMajor(const QString &, bool &)));
connect( m_details, &FileTypeDetails::changed,
this, &FileTypesView::setDirty );
connect( m_details, &FileTypeDetails::embedMajor,
this, &FileTypesView::slotEmbedMajor);
m_widgetStack->insertWidget( 1, m_details /*id*/ );
// File Group Details
m_groupDetails = new FileGroupDetails( m_widgetStack );
connect( m_groupDetails, SIGNAL( changed(bool) ),
this, SLOT( setDirty(bool) ) );
connect( m_groupDetails, &FileGroupDetails::changed,
this, &FileTypesView::setDirty );
m_widgetStack->insertWidget( 2,m_groupDetails /*id*/ );
// Widget shown on startup
......
......@@ -64,13 +64,13 @@ void FileTypeDialog::init()
{
m_details = new FileTypeDetails( this );
m_details->setMimeTypeData( m_mimeTypeData );
connect(m_details, SIGNAL(changed(bool)), this, SLOT(clientChanged(bool)));
connect(m_details, &FileTypeDetails::changed, this, &FileTypeDialog::clientChanged);
m_buttonBox = new QDialogButtonBox;
m_buttonBox->setStandardButtons(QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Cancel);
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(m_buttonBox->button(QDialogButtonBox::Apply), SIGNAL(clicked()), SLOT(save()));
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(m_buttonBox->button(QDialogButtonBox::Apply), &QAbstractButton::clicked, this, &FileTypeDialog::save);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
// This code is very similar to kcdialog.cpp
QVBoxLayout* layout = new QVBoxLayout(this);
......
......@@ -67,9 +67,9 @@ KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
QHBoxLayout *lay= new QHBoxLayout(this);
servicesLB = new QListWidget(this);
connect(servicesLB, SIGNAL(itemSelectionChanged()), SLOT(enableMoveButtons()));
connect(servicesLB, &QListWidget::itemSelectionChanged, this, &KServiceListWidget::enableMoveButtons);
lay->addWidget(servicesLB);
connect( servicesLB, SIGNAL( itemDoubleClicked(QListWidgetItem*)), this, SLOT( editService()));
connect( servicesLB, &QListWidget::itemDoubleClicked, this, &KServiceListWidget::editService);
QString wtstr =
(kind == SERVICELIST_APPLICATIONS ?
......@@ -93,7 +93,7 @@ KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
servUpButton = new QPushButton(i18n("Move &Up"), this);
servUpButton->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up")));
servUpButton->setEnabled(false);
connect(servUpButton, SIGNAL(clicked()), SLOT(promoteService()));
connect(servUpButton, &QAbstractButton::clicked, this, &KServiceListWidget::promoteService);
btnsLay->addWidget(servUpButton);
servUpButton->setWhatsThis( kind == SERVICELIST_APPLICATIONS ?
......@@ -107,7 +107,7 @@ KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
servDownButton = new QPushButton(i18n("Move &Down"), this);
servDownButton->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down")));
servDownButton->setEnabled(false);
connect(servDownButton, SIGNAL(clicked()), SLOT(demoteService()));
connect(servDownButton, &QAbstractButton::clicked, this, &KServiceListWidget::demoteService);
btnsLay->addWidget(servDownButton);
servDownButton->setWhatsThis( kind == SERVICELIST_APPLICATIONS ?
i18n("Assigns a lower priority to the selected\n"
......@@ -120,7 +120,7 @@ KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
servNewButton = new QPushButton(i18n("Add..."), this);
servNewButton->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
servNewButton->setEnabled(false);
connect(servNewButton, SIGNAL(clicked()), SLOT(addService()));
connect(servNewButton, &QAbstractButton::clicked, this, &KServiceListWidget::addService);
btnsLay->addWidget(servNewButton);
servNewButton->setWhatsThis( i18n( "Add a new application for this file type." ) );
......@@ -128,7 +128,7 @@ KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
servEditButton = new QPushButton(i18n("Edit..."), this);
servEditButton->setIcon(QIcon::fromTheme(QStringLiteral("edit-rename")));
servEditButton->setEnabled(false);
connect(servEditButton, SIGNAL(clicked()), SLOT(editService()));
connect(servEditButton, &QAbstractButton::clicked, this, &KServiceListWidget::editService);
btnsLay->addWidget(servEditButton);
servEditButton->setWhatsThis( i18n( "Edit command line of the selected application." ) );
......@@ -136,7 +136,7 @@ KServiceListWidget::KServiceListWidget(int kind, QWidget *parent)
servRemoveButton = new QPushButton(i18n("Remove"), this);
servRemoveButton->setIcon(QIcon::fromTheme(QStringLiteral("list-remove")));
servRemoveButton->setEnabled(false);
connect(servRemoveButton, SIGNAL(clicked()), SLOT(removeService()));
connect(servRemoveButton, &QAbstractButton::clicked, this, &KServiceListWidget::removeService);
btnsLay->addWidget(servRemoveButton);
servRemoveButton->setWhatsThis( i18n( "Remove the selected application from the list." ) );
......
......@@ -55,9 +55,9 @@ KServiceSelectDlg::KServiceSelectDlg( const QString& /*serviceType*/, const QStr
m_listbox->setMinimumWidth(400);
layout->addWidget( m_listbox );
layout->addWidget( m_buttonBox );
connect(m_listbox,SIGNAL(itemDoubleClicked(QListWidgetItem*)),SLOT(accept()));
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(m_listbox,&QListWidget::itemDoubleClicked,this, &QDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
KServiceSelectDlg::~KServiceSelectDlg()
......
......@@ -72,8 +72,8 @@ NewTypeDialog::NewTypeDialog(const QStringList &groups, QWidget *parent)
mainLayout->addLayout(formLayout);
mainLayout->addWidget(m_buttonBox);
connect(m_buttonBox, SIGNAL(accepted()), SLOT(accept()));
connect(m_buttonBox, SIGNAL(rejected()), SLOT(reject()));
connect(m_buttonBox, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect(m_buttonBox, &QDialogButtonBox::rejected, this, &QDialog::reject);
// Set a minimum width so that caption is not half-hidden
setMinimumWidth(300);
......
......@@ -215,8 +215,8 @@ bool ClientApp::kde_open(const QString& url, const QString& mimeType, bool allow
#if KIO_VERSION >= QT_VERSION_CHECK(5,55,0)
run->setFollowRedirections(false);
#endif
QObject::connect( run, SIGNAL( finished() ), this, SLOT( delayedQuit() ));
QObject::connect( run, SIGNAL( error() ), this, SLOT( delayedQuit() ));
QObject::connect( run, &KRun::finished, this, &ClientApp::delayedQuit);
QObject::connect( run, &KRun::error, this, &ClientApp::delayedQuit);
qApp->exec();
return !krun_has_error;
} else {
......@@ -234,7 +234,7 @@ bool ClientApp::doCopy( const QStringList& urls )
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
connect( job, &KJob::result, this, &ClientApp::slotResult );
qApp->exec();
return m_ok;
}
......@@ -259,7 +259,7 @@ bool ClientApp::doList( const QStringList& urls )
}
connect(job, SIGNAL(entries(KIO::Job*,KIO::UDSEntryList)),
SLOT(slotEntries(KIO::Job*,KIO::UDSEntryList)));
connect(job, SIGNAL(result(KJob *)), this, SLOT(slotResult(KJob *)));
connect(job, &KJob::result, this, &ClientApp::slotResult);
qApp->exec();
return m_ok;
}
......@@ -273,7 +273,7 @@ bool ClientApp::doMove( const QStringList& urls )
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
connect( job, &KJob::result, this, &ClientApp::slotResult );
qApp->exec();
return m_ok;
}
......@@ -285,7 +285,7 @@ bool ClientApp::doRemove( const QStringList& urls )
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect( job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
connect( job, &KJob::result, this, &ClientApp::slotResult );
qApp->exec();
return m_ok;
}
......@@ -327,7 +327,7 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
QUrl url = makeURL(parser.positionalArguments().last());
KPropertiesDialog * p = new KPropertiesDialog(url, nullptr /*no parent*/ );
QObject::connect( p, SIGNAL( destroyed() ), qApp, SLOT( quit() ));
QObject::connect( p, SIGNAL( canceled() ), this, SLOT( slotDialogCanceled() ));
QObject::connect( p, &KPropertiesDialog::canceled, this, &ClientApp::slotDialogCanceled);
p->show();
qApp->exec();
return m_ok;
......@@ -343,8 +343,8 @@ bool ClientApp::doIt(const QCommandLineParser& parser)
job->setUiDelegate( nullptr );
job->setUiDelegateExtension( nullptr );
}
connect(job, SIGNAL(data(KIO::Job*,QByteArray) ), this, SLOT(slotPrintData(KIO::Job*,QByteArray)));
connect(job, SIGNAL( result( KJob * ) ), this, SLOT( slotResult( KJob * ) ) );
connect(job, &KIO::TransferJob::data, this, &ClientApp::slotPrintData);
connect(job, &KJob::result, this, &ClientApp::slotResult );
qApp->exec();
return m_ok;
}
......
......@@ -83,7 +83,7 @@ KStart::KStart()
sendRule();
else {
// connect to window add to get the NEW windows
connect(KWindowSystem::self(), SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId)));
connect(KWindowSystem::self(), &KWindowSystem::windowAdded, this, &KStart::windowAdded);
}
// propagate the app startup notification info to the started app
// We are not using KApplication, so the env remained set
......
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