Port to new PMF connect syntax

This way we catch missing methods/mismatching arguments at compile and
not at runtime.
This fixes some Qt6 regressions due to the removal of deprecated methods.
This commit is contained in:
Alexander Lohnau 2023-07-20 17:22:29 +03:00 committed by Albert Vaca Cintora
parent c61fad5561
commit 35a450f366
6 changed files with 16 additions and 18 deletions

View file

@ -17,8 +17,8 @@ ClipboardConfig::ClipboardConfig(QObject *parent, const QVariantList &args)
{
m_ui->setupUi(widget());
connect(m_ui->check_autoshare, SIGNAL(toggled(bool)), this, SLOT(autoShareChanged()));
connect(m_ui->check_password, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->check_autoshare, &QCheckBox::toggled, this, &ClipboardConfig::autoShareChanged);
connect(m_ui->check_password, &QCheckBox::toggled, this, &ClipboardConfig::markAsChanged);
}
ClipboardConfig::~ClipboardConfig()

View file

@ -24,10 +24,9 @@ public:
void save() override;
void load() override;
void defaults() override;
public Q_SLOTS:
void autoShareChanged();
private:
void autoShareChanged();
Ui::ClipboardConfigUi *m_ui;
};

View file

@ -17,11 +17,11 @@ PauseMusicConfig::PauseMusicConfig(QObject *parent, const QVariantList &args)
{
m_ui->setupUi(widget());
connect(m_ui->rad_ringing, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->rad_talking, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->check_pause, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->check_mute, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->check_resume, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->rad_ringing, &QCheckBox::toggled, this, &PauseMusicConfig::markAsChanged);
connect(m_ui->rad_talking, &QCheckBox::toggled, this, &PauseMusicConfig::markAsChanged);
connect(m_ui->check_pause, &QCheckBox::toggled, this, &PauseMusicConfig::markAsChanged);
connect(m_ui->check_mute, &QCheckBox::toggled, this, &PauseMusicConfig::markAsChanged);
connect(m_ui->check_resume, &QCheckBox::toggled, this, &PauseMusicConfig::markAsChanged);
}
PauseMusicConfig::~PauseMusicConfig()

View file

@ -22,12 +22,11 @@ public:
void load() override;
void defaults() override;
private Q_SLOTS:
private:
void onDataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
void exportCommands();
void importCommands();
private:
void addSuggestedCommand(QMenu *menu, const QString &name, const QString &command);
void insertRow(int i, const QString &name, const QString &command);
void insertEmptyRow();

View file

@ -33,14 +33,14 @@ SendNotificationsConfig::SendNotificationsConfig(QObject *parent, const QVariant
for (int i = 0; i < 3; i++)
m_ui->appList->resizeColumnToContents(i);
connect(m_ui->appList->horizontalHeader(), SIGNAL(sortIndicatorChanged(int, Qt::SortOrder)), m_ui->appList, SLOT(sortByColumn(int)));
connect(m_ui->appList->horizontalHeader(), &QHeaderView::sortIndicatorChanged, m_ui->appList, &QTableView::sortByColumn);
connect(m_ui->check_persistent, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->spin_urgency, SIGNAL(editingFinished()), this, SLOT(changed()));
connect(m_ui->check_body, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->check_icons, SIGNAL(toggled(bool)), this, SLOT(changed()));
connect(m_ui->check_persistent, &QCheckBox::toggled, this, &SendNotificationsConfig::markAsChanged);
connect(m_ui->spin_urgency, &QSpinBox::editingFinished, this, &SendNotificationsConfig::markAsChanged);
connect(m_ui->check_body, &QCheckBox::toggled, this, &SendNotificationsConfig::markAsChanged);
connect(m_ui->check_icons, &QCheckBox::toggled, this, &SendNotificationsConfig::markAsChanged);
connect(appModel, SIGNAL(applicationsChanged()), this, SLOT(changed()));
connect(appModel, &NotifyingApplicationModel::applicationsChanged, this, &SendNotificationsConfig::markAsChanged);
connect(config(), &KdeConnectPluginConfig::configChanged, this, &SendNotificationsConfig::loadApplications);
}

View file

@ -174,7 +174,7 @@ bool SharePlugin::receivePacket(const NetworkPacket &np)
if (defaultApp == QLatin1String("org.kde.kate") || defaultApp == QLatin1String("org.kde.kwrite")) {
QProcess *proc = new QProcess();
connect(proc, SIGNAL(finished(int)), proc, SLOT(deleteLater()));
connect(proc, &QProcess::finished, proc, &QObject::deleteLater);
proc->start(defaultApp.section(QStringLiteral("."), 2, 2), QStringList(QStringLiteral("--stdin")));
proc->write(text.toUtf8());
proc->closeWriteChannel();