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

Port deprecated methods

parent 5a8b9e2d
......@@ -79,7 +79,7 @@ class ResultDialog : public QDialog
{
Q_OBJECT
public:
ResultDialog(const QStringList &created, const QStringList &errors, QWidget *parent = nullptr, Qt::WindowFlags f = nullptr)
ResultDialog(const QStringList &created, const QStringList &errors, QWidget *parent = nullptr, Qt::WindowFlags f = {})
: QDialog(parent, f),
createdLB(created.empty()
? i18nc("@info", "No checksum files have been created.")
......
......@@ -73,7 +73,7 @@ class DecryptVerifyEMailWizard : public QWizard
{
Q_OBJECT
public:
explicit DecryptVerifyEMailWizard(QWidget *parent = nullptr, Qt::WindowFlags f = nullptr)
explicit DecryptVerifyEMailWizard(QWidget *parent = nullptr, Qt::WindowFlags f = {})
: QWizard(parent, f),
m_resultPage(this)
{
......
......@@ -70,7 +70,7 @@ class HLine : public QFrame
{
Q_OBJECT
public:
explicit HLine(QWidget *p = nullptr, Qt::WindowFlags f = nullptr)
explicit HLine(QWidget *p = nullptr, Qt::WindowFlags f = {})
: QFrame(p, f)
{
setFrameStyle(QFrame::HLine | QFrame::Sunken);
......
......@@ -120,9 +120,8 @@ public:
m_outputCreated(outputCreated),
m_auditLog(auditLog)
{
qCDebug(KLEOPATRA_LOG) << endl
<< "inputError :" << m_inputErrorString << endl
<< "outputError:" << m_outputErrorString;
qCDebug(KLEOPATRA_LOG) << "\ninputError :" << m_inputErrorString
<< "\noutputError:" << m_outputErrorString;
Q_ASSERT(!m_sresult.isNull());
}
SignEncryptFilesResult(const EncryptionResult &er, const std::shared_ptr<Input> &input, const std::shared_ptr<Output> &output, bool outputCreated, const AuditLog &auditLog)
......@@ -135,9 +134,8 @@ public:
m_outputCreated(outputCreated),
m_auditLog(auditLog)
{
qCDebug(KLEOPATRA_LOG) << endl
<< "inputError :" << m_inputErrorString << endl
<< "outputError:" << m_outputErrorString;
qCDebug(KLEOPATRA_LOG) << "\ninputError :" << m_inputErrorString
<< "\noutputError:" << m_outputErrorString;
Q_ASSERT(!m_eresult.isNull());
}
SignEncryptFilesResult(const SigningResult &sr, const EncryptionResult &er, const std::shared_ptr<Input> &input, const std::shared_ptr<Output> &output, bool outputCreated, const AuditLog &auditLog)
......@@ -151,9 +149,8 @@ public:
m_outputCreated(outputCreated),
m_auditLog(auditLog)
{
qCDebug(KLEOPATRA_LOG) << endl
<< "inputError :" << m_inputErrorString << endl
<< "outputError:" << m_outputErrorString;
qCDebug(KLEOPATRA_LOG) << "\ninputError :" << m_inputErrorString
<< "\noutputError:" << m_outputErrorString;
Q_ASSERT(!m_sresult.isNull() || !m_eresult.isNull());
}
......
......@@ -660,9 +660,9 @@ void Command::Private::run()
if (in.parentWId) {
#if defined(Q_OS_WIN32)
err = send_option(ctx, "window-id", QString().sprintf("%lx", reinterpret_cast<quintptr>(in.parentWId)));
err = send_option(ctx, "window-id", QString::asprintf("%lx", reinterpret_cast<quintptr>(in.parentWId)));
#else
err = send_option(ctx, "window-id", QString().sprintf("%lx", static_cast<unsigned long>(in.parentWId)));
err = send_option(ctx, "window-id", QString::asprintf("%lx", static_cast<unsigned long>(in.parentWId)));
#endif
if (err) {
qDebug("sending option window-id failed - ignoring");
......
......@@ -752,7 +752,7 @@ private:
(conn.*mp).push_back(mb);
const QString email = mb.addrSpec().asString();
(void)assuan_write_line(conn.ctx.get(), qPrintable(QString().sprintf("# ok, parsed as \"%s\"", qPrintable(email))));
(void)assuan_write_line(conn.ctx.get(), qPrintable(QString::asprintf("# ok, parsed as \"%s\"", qPrintable(email))));
if (sender && !informative) {
return AssuanCommandFactory::_handle(conn.ctx.get(), line, "PREP_SIGN");
} else {
......
......@@ -217,7 +217,7 @@ QString Kleo::gpgConfListDir(const char *which)
gpgConf.start(gpgConfPath, QStringList() << QStringLiteral("--list-dirs"));
if (!gpgConf.waitForFinished()) {
qCDebug(KLEOPATRA_LOG) << "gpgConfListDir(): failed to execute gpgconf: " << qPrintable(gpgConf.errorString());
qCDebug(KLEOPATRA_LOG) << "output was:" << endl << gpgConf.readAllStandardError().constData();
qCDebug(KLEOPATRA_LOG) << "output was:\n" << gpgConf.readAllStandardError().constData();
return QString();
}
const QList<QByteArray> lines = gpgConf.readAllStandardOutput().split('\n');
......@@ -234,7 +234,7 @@ QString Kleo::gpgConfListDir(const char *which)
return result;
}
qCDebug(KLEOPATRA_LOG) << "gpgConfListDir(): didn't find '" << which << "'"
<< "entry in output:" << endl << gpgConf.readAllStandardError().constData();
<< "entry in output:\n" << gpgConf.readAllStandardError().constData();
return QString();
}
......
......@@ -347,7 +347,7 @@ ProcessStdOutInput::ProcessStdOutInput(const QString &cmd, const QStringList &ar
{
const QIODevice::OpenMode openMode =
stdin_.isEmpty() ? QIODevice::ReadOnly : QIODevice::ReadWrite;
qCDebug(KLEOPATRA_LOG) << "cd" << wd.absolutePath() << endl << cmd << args << Outputter(stdin_);
qCDebug(KLEOPATRA_LOG) << "cd" << wd.absolutePath() << '\n' << cmd << args << Outputter(stdin_);
if (cmd.isEmpty())
throw Exception(gpg_error(GPG_ERR_INV_ARG),
i18n("Command not specified"));
......
......@@ -650,7 +650,7 @@ ProcessStdInOutput::ProcessStdInOutput(const QString &cmd, const QStringList &ar
m_arguments(args),
m_proc(new redirect_close<QProcess>)
{
qCDebug(KLEOPATRA_LOG) << "cd" << wd.absolutePath() << endl << cmd << args;
qCDebug(KLEOPATRA_LOG) << "cd" << wd.absolutePath() << '\n' << cmd << args;
if (cmd.isEmpty())
throw Exception(gpg_error(GPG_ERR_INV_ARG),
i18n("Command not specified"));
......
......@@ -724,17 +724,17 @@ Command::Restrictions find_root_restrictions(const std::vector<Key> &keys)
Command::Restrictions KeyListController::Private::calculateRestrictionsMask(const QItemSelectionModel *sm)
{
if (!sm) {
return nullptr;
return Command::NoRestriction;
}
const KeyListModelInterface *const m = dynamic_cast<const KeyListModelInterface *>(sm->model());
if (!m) {
return nullptr;
return Command::NoRestriction;
}
const std::vector<Key> keys = m->keys(sm->selectedRows());
if (keys.empty()) {
return nullptr;
return Command::NoRestriction;
}
Command::Restrictions result = Command::NeedSelection;
......
......@@ -571,7 +571,7 @@ void TabWidget::Private::slotPageHierarchyChanged(bool)
void TabWidget::Private::slotNewTab()
{
const KConfigGroup group = KSharedConfig::openConfig()->group(QString().sprintf("View #%u", tabWidget.count()));
const KConfigGroup group = KSharedConfig::openConfig()->group(QString::asprintf("View #%u", tabWidget.count()));
Page *page = new Page(QString(), QStringLiteral("all-certificates"), QString(), nullptr, QString(), nullptr, group);
addView(page, currentPage());
tabWidget.setCurrentIndex(tabWidget.count() - 1);
......@@ -938,7 +938,7 @@ void TabWidget::saveViews(KConfig *config) const
if (p->isTemporary()) {
continue;
}
KConfigGroup group(config, QString().sprintf("View #%u", vg++));
KConfigGroup group(config, QString::asprintf("View #%u", vg++));
p->saveTo(group);
if (KCONFIG_DELETEGROUP_BROKEN) {
group.writeEntry("magic", 0xFA1AFE1U);
......
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