Commit 2973ea21 authored by David Jarvie's avatar David Jarvie
Browse files

Code quality fixes

parent 4b131aa7
Pipeline #147967 passed with stage
in 2 minutes
......@@ -81,7 +81,7 @@ bool convInterval(const QString& timeParam, KARecurrence::Type&, int& timeInterv
class CommandOptions::Private
{
public:
Private(CommandOptions* parent)
explicit Private(CommandOptions* parent)
: p(parent)
{}
bool checkCommand(Option, Command, EditAlarmDlg::Type = EditAlarmDlg::NO_TYPE);
......
......@@ -39,6 +39,8 @@ public:
QStringList setOptions(QCommandLineParser*, const QStringList& args);
static CommandOptions* firstInstance() { return mFirstInstance; }
CommandOptions();
CommandOptions(CommandOptions&) = delete;
CommandOptions& operator=(CommandOptions&) = delete;
void parse();
void process();
Command command() const { return mCommand; }
......
/*
* editdlg.cpp - dialog to create or modify an alarm or alarm template
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2022 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -906,8 +906,8 @@ void EditAlarmDlg::closeEvent(QCloseEvent* ce)
*/
void EditAlarmDlg::slotResize()
{
QSize s = mTabScrollGroup->adjustSize(true);
s = minimumSizeHint();
mTabScrollGroup->adjustSize(true);
const QSize s = minimumSizeHint();
if (height() > s.height())
{
// Resize to slightly greater than the minimum height.
......
......@@ -404,7 +404,6 @@ int KAlarmApp::activateInstance(const QStringList& args, const QString& workingD
int exitCode = 0; // default = success
static bool firstInstance = true;
bool dontRedisplay = false;
CommandOptions::Command command = CommandOptions::NONE;
if (!firstInstance || !isSessionRestored())
{
options->process();
......@@ -412,7 +411,7 @@ int KAlarmApp::activateInstance(const QStringList& args, const QString& workingD
if (options->simulationTime().isValid())
KAlarm::setSimulatedSystemTime(options->simulationTime());
#endif
command = options->command();
CommandOptions::Command command = options->command();
if (options->disableAll())
setAlarmsEnabled(false); // disable alarm monitoring
......
......@@ -285,6 +285,8 @@ void ResourceSelector::selectionChanged()
*/
void ResourceSelector::initActions(KActionCollection* actions)
{
if (mActionReload)
return; // this function can only be called once
mActionReload = new QAction(QIcon::fromTheme(QStringLiteral("view-refresh")), i18nc("@action Reload calendar", "Re&load"), this);
actions->addAction(QStringLiteral("resReload"), mActionReload);
connect(mActionReload, &QAction::triggered, this, &ResourceSelector::reloadResource);
......
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