[education/rkward] rkward: Fix some cppcheck warnings (mostly explicit ctors)
Thomas Friedrichsmeier
null at kde.org
Fri May 10 17:04:24 BST 2024
Git commit f40cdbfe672175013de5e9805b9a167aa60bf73e by Thomas Friedrichsmeier.
Committed on 10/05/2024 at 14:20.
Pushed by tfry into branch 'master'.
Fix some cppcheck warnings (mostly explicit ctors)
M +1 -3 rkward/agents/rkeditobjectagent.cpp
M +5 -2 rkward/agents/rkprintagent.cpp
M +3 -3 rkward/core/rkmodificationtracker.h
M +1 -1 rkward/core/robject.cpp
M +1 -1 rkward/dataeditor/rkeditor.h
M +2 -2 rkward/dataeditor/rkvareditmodel.h
M +1 -1 rkward/dialogs/rkloadlibsdialog.cpp
M +2 -2 rkward/dialogs/rkrecoverdialog.h
M +1 -1 rkward/dialogs/rksetupwizard.h
M +1 -1 rkward/misc/editformatdialog.h
M +2 -2 rkward/misc/rkaccordiontable.cpp
M +1 -1 rkward/misc/rkobjectlistview.cpp
M +1 -1 rkward/misc/rkparsedversion.h
M +2 -2 rkward/plugin/rkcomponentmap.h
M +2 -2 rkward/plugin/rkmatrixinput.h
M +1 -1 rkward/plugin/rkoptionset.h
M +1 -1 rkward/rbackend/rksessionvars.h
M +1 -1 rkward/rkconsole.h
M +1 -1 rkward/settings/rkrecenturls.h
M +3 -3 rkward/settings/rksettingsmoduleplugins.cpp
M +1 -1 rkward/settings/rksettingsmoduleplugins.h
M +1 -1 rkward/windows/katepluginintegration.cpp
M +2 -2 rkward/windows/katepluginintegration.h
M +1 -1 rkward/windows/rkcodecompletion.cpp
M +1 -1 rkward/windows/rkcodecompletion.h
M +2 -2 rkward/windows/rkcommandeditorwindow.cpp
M +2 -2 rkward/windows/rkcommandeditorwindow.h
M +2 -7 rkward/windows/rkhtmlwindow.cpp
M +0 -2 rkward/windows/rkhtmlwindow.h
M +1 -1 rkward/windows/rkmdiwindow.h
M +0 -2 rkward/windows/rkwindowcatcher.h
https://invent.kde.org/education/rkward/-/commit/f40cdbfe672175013de5e9805b9a167aa60bf73e
diff --git a/rkward/agents/rkeditobjectagent.cpp b/rkward/agents/rkeditobjectagent.cpp
index 09b042eca..986681767 100644
--- a/rkward/agents/rkeditobjectagent.cpp
+++ b/rkward/agents/rkeditobjectagent.cpp
@@ -16,11 +16,9 @@ SPDX-License-Identifier: GPL-2.0-or-later
#include "../debug.h"
-RKEditObjectAgent::RKEditObjectAgent (const QStringList &_object_names, RCommandChain *chain) {
+RKEditObjectAgent::RKEditObjectAgent (const QStringList &_object_names, RCommandChain *chain) : object_names(_object_names) {
RK_TRACE (APP);
- RKEditObjectAgent::object_names = _object_names;
-
// first issue an empty command to trigger an update of the object list
RInterface::issueCommand (new RCommand (QString (), RCommand::EmptyCommand | RCommand::ObjectListUpdate), chain);
diff --git a/rkward/agents/rkprintagent.cpp b/rkward/agents/rkprintagent.cpp
index 036f713e9..926855400 100644
--- a/rkward/agents/rkprintagent.cpp
+++ b/rkward/agents/rkprintagent.cpp
@@ -70,10 +70,13 @@ void RKPrintAgent::printPostscript (const QString &file, bool delete_file) {
if (ok) printaction = a;
}
if (!(printaction && provider->openUrl(QUrl::fromLocalFile(file)))) {
- RK_DEBUG (APP, DL_WARNING, "No print action in postscript provider");
+ if (!printaction) {
+ RK_DEBUG(APP, DL_WARNING, "No print action in postscript provider");
+ } else {
+ RK_DEBUG(APP, DL_WARNING, "Failure to open file %s in postscript provider", qPrintable(file));
+ }
delete provider;
provider = nullptr;
- } else {
fallbackToGeneric(file, delete_file);
return;
}
diff --git a/rkward/core/rkmodificationtracker.h b/rkward/core/rkmodificationtracker.h
index 18d4fd246..472fcbd83 100644
--- a/rkward/core/rkmodificationtracker.h
+++ b/rkward/core/rkmodificationtracker.h
@@ -37,7 +37,7 @@ public:
ListenerType listenerType () const { return type; };
bool wantsNotificationType (NotificationType type) const { return (notifications & type); };
protected:
- RObjectListener (ListenerType type);
+ explicit RObjectListener(ListenerType type);
virtual ~RObjectListener ();
friend class RKModificationTracker;
@@ -76,8 +76,8 @@ public:
ColumnCount = ClassColumn + 1
};
protected:
- RKObjectListModel (QObject *parent);
- virtual ~RKObjectListModel ();
+ explicit RKObjectListModel(QObject *parent);
+ virtual ~RKObjectListModel();
public:
/** implements QAbstractItemModel::index() */
QModelIndex index (int row, int column, const QModelIndex& parent = QModelIndex ()) const override;
diff --git a/rkward/core/robject.cpp b/rkward/core/robject.cpp
index 21487e58a..dcbdf6959 100644
--- a/rkward/core/robject.cpp
+++ b/rkward/core/robject.cpp
@@ -33,7 +33,7 @@ namespace RObjectPrivate {
* This is needed, because RObject is not QObject dereived. */
class RObjectLifeTimeGuard {
public:
- RObjectLifeTimeGuard(RObject *object) : command_count(0), object(object) {
+ explicit RObjectLifeTimeGuard(RObject *object) : command_count(0), object(object) {
object->guard = this;
};
~RObjectLifeTimeGuard() {
diff --git a/rkward/dataeditor/rkeditor.h b/rkward/dataeditor/rkeditor.h
index 149ce53e4..5867276f6 100644
--- a/rkward/dataeditor/rkeditor.h
+++ b/rkward/dataeditor/rkeditor.h
@@ -41,7 +41,7 @@ public:
/** Tells the editor to restore the given object in the R-workspace from its copy of the data */
virtual void restoreObject (RObject *object) = 0;
- bool isModified () override { return false; };
+ bool isModified() const override { return false; };
protected:
RObject *object;
};
diff --git a/rkward/dataeditor/rkvareditmodel.h b/rkward/dataeditor/rkvareditmodel.h
index 4efe7be68..244a191ad 100644
--- a/rkward/dataeditor/rkvareditmodel.h
+++ b/rkward/dataeditor/rkvareditmodel.h
@@ -159,8 +159,8 @@ public:
RKVarEditModel* getDataModel () const { return data_model; };
protected:
friend class RKVarEditModel;
- RKVarEditMetaModel (RKVarEditModel* data_model);
- ~RKVarEditMetaModel ();
+ explicit RKVarEditMetaModel(RKVarEditModel* data_model);
+ ~RKVarEditMetaModel();
void beginAddDataObject (int index);
void endAddDataObject ();
diff --git a/rkward/dialogs/rkloadlibsdialog.cpp b/rkward/dialogs/rkloadlibsdialog.cpp
index 3ad9531a1..cfe1d33af 100644
--- a/rkward/dialogs/rkloadlibsdialog.cpp
+++ b/rkward/dialogs/rkloadlibsdialog.cpp
@@ -550,7 +550,7 @@ void LoadUnloadWidget::apply () {
class InstallPackagesDelegate : public QStyledItemDelegate {
Q_OBJECT
public:
- InstallPackagesDelegate (QTreeView* parent) : QStyledItemDelegate (parent) {
+ explicit InstallPackagesDelegate(QTreeView* parent) : QStyledItemDelegate(parent) {
table = parent;
expanded = RKStandardIcons::getIcon (RKStandardIcons::ActionCollapseUp);
collapsed = RKStandardIcons::getIcon (RKStandardIcons::ActionExpandDown);
diff --git a/rkward/dialogs/rkrecoverdialog.h b/rkward/dialogs/rkrecoverdialog.h
index ba9858aec..567f45d76 100644
--- a/rkward/dialogs/rkrecoverdialog.h
+++ b/rkward/dialogs/rkrecoverdialog.h
@@ -19,8 +19,8 @@ public:
@returns The url of the recovery file, if user selected to load it. An empty QUrl otherwise. */
static QUrl checkRecoverCrashedWorkspace ();
protected:
- RKRecoverDialog (const QStringList &recovery_files);
- ~RKRecoverDialog ();
+ explicit RKRecoverDialog(const QStringList &recovery_files);
+ ~RKRecoverDialog();
static QString saveFileFor (const QString &recovery_file);
QStringList files;
private Q_SLOTS:
diff --git a/rkward/dialogs/rksetupwizard.h b/rkward/dialogs/rksetupwizard.h
index 19733e862..929a950d8 100644
--- a/rkward/dialogs/rksetupwizard.h
+++ b/rkward/dialogs/rksetupwizard.h
@@ -64,7 +64,7 @@ public:
Warning,
Good
};
- RKSetupWizardItem(const QString &shortlabel, const QString &longlabel=QString(), Status status=Good, const QString &shortstatuslabel=QString()) : status(status), shortlabel(shortlabel), longlabel(longlabel), shortstatuslabel(shortstatuslabel), box(nullptr) {};
+ explicit RKSetupWizardItem(const QString &shortlabel, const QString &longlabel=QString(), Status status=Good, const QString &shortstatuslabel=QString()) : status(status), shortlabel(shortlabel), longlabel(longlabel), shortstatuslabel(shortstatuslabel), box(nullptr) {};
~RKSetupWizardItem() {};
void addOption(const QString &shortlabel, const QString &longlabel, std::function<void(RKSetupWizard*)> callback) {
options.append(Option(shortlabel, longlabel, callback));
diff --git a/rkward/misc/editformatdialog.h b/rkward/misc/editformatdialog.h
index 6d949f767..99aa5bcef 100644
--- a/rkward/misc/editformatdialog.h
+++ b/rkward/misc/editformatdialog.h
@@ -30,7 +30,7 @@ protected:
friend class EditFormatDialogProxy;
/** ctor */
- EditFormatDialog (QWidget *parent);
+ explicit EditFormatDialog(QWidget *parent);
/** dtor */
~EditFormatDialog ();
diff --git a/rkward/misc/rkaccordiontable.cpp b/rkward/misc/rkaccordiontable.cpp
index 27e66dadf..3cf417cbc 100644
--- a/rkward/misc/rkaccordiontable.cpp
+++ b/rkward/misc/rkaccordiontable.cpp
@@ -28,7 +28,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
class RKAccordionDummyModel : public QAbstractProxyModel {
Q_OBJECT
public:
- RKAccordionDummyModel (QObject *parent) : QAbstractProxyModel (parent) {
+ explicit RKAccordionDummyModel(QObject *parent) : QAbstractProxyModel(parent) {
add_trailing_columns = 1;
add_trailing_rows = 1;
};
@@ -214,7 +214,7 @@ private:
/** Responsible for drawing expand / collapse indicators in first column */
class RKAccordionDelegate : public QStyledItemDelegate {
public:
- RKAccordionDelegate (RKAccordionTable* parent) : QStyledItemDelegate (parent) {
+ explicit RKAccordionDelegate(RKAccordionTable* parent) : QStyledItemDelegate(parent) {
table = parent;
expanded = RKStandardIcons::getIcon (RKStandardIcons::ActionCollapseUp);
collapsed = RKStandardIcons::getIcon (RKStandardIcons::ActionExpandDown);
diff --git a/rkward/misc/rkobjectlistview.cpp b/rkward/misc/rkobjectlistview.cpp
index ab4f7061a..35f36e0ea 100644
--- a/rkward/misc/rkobjectlistview.cpp
+++ b/rkward/misc/rkobjectlistview.cpp
@@ -32,7 +32,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
/** Responsible for drawing the root level items "My Objects" and "Other Environments" */
class RKObjectListViewRootDelegate : public QStyledItemDelegate {
public:
- RKObjectListViewRootDelegate (RKObjectListView* parent) : QStyledItemDelegate (parent) {
+ explicit RKObjectListViewRootDelegate(RKObjectListView* parent) : QStyledItemDelegate(parent) {
tree = parent;
expanded = RKStandardIcons::getIcon (RKStandardIcons::ActionCollapseUp);
collapsed = RKStandardIcons::getIcon (RKStandardIcons::ActionExpandDown);
diff --git a/rkward/misc/rkparsedversion.h b/rkward/misc/rkparsedversion.h
index 3d105e9fa..8a1e14123 100644
--- a/rkward/misc/rkparsedversion.h
+++ b/rkward/misc/rkparsedversion.h
@@ -13,7 +13,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
Anything else (everything after the fourth dot, or after the first character that is neither dot, nor digit) is stored as a string, and compared lexically. */
class RKParsedVersion {
public:
- RKParsedVersion(const QString& from_string);
+ explicit RKParsedVersion(const QString& from_string);
RKParsedVersion() : version_numeric(0) {};
/** Create a null version that will always compare as higher than other (non-null) versions */
static RKParsedVersion maxVersion() {
diff --git a/rkward/plugin/rkcomponentmap.h b/rkward/plugin/rkcomponentmap.h
index 57fbda1bd..aa18b0305 100644
--- a/rkward/plugin/rkcomponentmap.h
+++ b/rkward/plugin/rkcomponentmap.h
@@ -145,8 +145,8 @@ public:
RKContextHandler *makeContextHandler (QObject *parent, bool create_actions=true);
QStringList components () { return component_menus.keys (); };
protected:
- RKComponentGUIXML (const QString &context_id);
- virtual ~RKComponentGUIXML ();
+ explicit RKComponentGUIXML(const QString &context_id);
+ virtual ~RKComponentGUIXML();
/** reset the xml file */
void clearGUIDescription ();
diff --git a/rkward/plugin/rkmatrixinput.h b/rkward/plugin/rkmatrixinput.h
index 4dc00bf23..0f75029c6 100644
--- a/rkward/plugin/rkmatrixinput.h
+++ b/rkward/plugin/rkmatrixinput.h
@@ -94,8 +94,8 @@ private:
class RKMatrixInputModel : public QAbstractTableModel {
private:
friend class RKMatrixInput;
- RKMatrixInputModel (RKMatrixInput *matrix);
- virtual ~RKMatrixInputModel ();
+ explicit RKMatrixInputModel(RKMatrixInput *matrix);
+ virtual ~RKMatrixInputModel();
int rowCount (const QModelIndex &parent = QModelIndex()) const override; // implemented for QAbstractTableModel
int columnCount (const QModelIndex &parent = QModelIndex()) const override; // implemented for QAbstractTableModel
QVariant data (const QModelIndex &index, int role = Qt::DisplayRole) const override; // re-implemented for QAbstractTableModel
diff --git a/rkward/plugin/rkoptionset.h b/rkward/plugin/rkoptionset.h
index f8f430b1d..0553a1ab1 100644
--- a/rkward/plugin/rkoptionset.h
+++ b/rkward/plugin/rkoptionset.h
@@ -85,7 +85,7 @@ friend class RKOptionSetDisplayModel;
QMap<RKComponentPropertyStringList *, ColumnInfo> column_map;
QList<RKComponentPropertyStringList*> visible_columns;
struct RowInfo {
- RowInfo (PropertyValueMap initial_values) : valid (false), finished (false), full_row_map (initial_values) {};
+ explicit RowInfo(PropertyValueMap initial_values) : valid(false), finished(false), full_row_map(initial_values) {};
bool valid; /**< has finished processing and is known to be valid */
bool finished; /**< has finished processing */
PropertyValueMap full_row_map; /**< complete status representation of this row, (see RKComponent::fetchPropertyValuesRecursive()) */
diff --git a/rkward/rbackend/rksessionvars.h b/rkward/rbackend/rksessionvars.h
index e672d63d6..c60ba3809 100644
--- a/rkward/rbackend/rksessionvars.h
+++ b/rkward/rbackend/rksessionvars.h
@@ -39,7 +39,7 @@ Q_SIGNALS:
void installedPackagesChanged ();
protected:
friend class RInterface;
- RKSessionVars (RInterface *parent);
+ explicit RKSessionVars(RInterface *parent);
~RKSessionVars ();
private:
static RKSessionVars* _instance;
diff --git a/rkward/rkconsole.h b/rkward/rkconsole.h
index 011681a55..85ccde2b3 100644
--- a/rkward/rkconsole.h
+++ b/rkward/rkconsole.h
@@ -181,7 +181,7 @@ friend class RKConsole;
protected:
/** constructor. Protected. Meant to the created by the RKConsole itself
@param console The console for this part */
- RKConsolePart (RKConsole *console);
+ explicit RKConsolePart(RKConsole *console);
/** destructor */
~RKConsolePart ();
diff --git a/rkward/settings/rkrecenturls.h b/rkward/settings/rkrecenturls.h
index 7fdade413..738e217f1 100644
--- a/rkward/settings/rkrecenturls.h
+++ b/rkward/settings/rkrecenturls.h
@@ -34,7 +34,7 @@ public:
Q_SIGNALS:
void recentUrlsChanged();
private:
- RKRecentUrls(QObject* parent);
+ explicit RKRecentUrls(QObject* parent);
~RKRecentUrls();
void notifyChange();
static void notifyChangeProxy();
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index d747d57cc..6779587bd 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -161,7 +161,7 @@ void RKSettingsModulePlugins::RKPluginMapList::readFromConfig(KConfigGroup& cg)
else inf.state = (PluginMapState) ppmg.readEntry("State", (int) Working);
inf.last_modified = ppmg.readEntry ("timestamp", QDateTime ());
inf.id = ppmg.readEntry ("id");
- inf.version = ppmg.readEntry ("version");
+ inf.version = RKParsedVersion(ppmg.readEntry("version"));
inf.priority = ppmg.readEntry ("priority", (int) PriorityMedium);
addMap(inf, ppmg.readEntry("Active", false) ? ForceActivate : DoNotActivate);
}
@@ -371,7 +371,7 @@ void RKSettingsModulePlugins::registerPluginMaps (const QStringList &maps, AddMo
QStringList added;
for (const QString &map : maps) {
if (map.isEmpty ()) continue;
- if (known_plugin_maps.addMap(map, add_mode)) {
+ if (known_plugin_maps.addMap(PluginMapStoredInfo(map), add_mode)) {
added.append(map);
}
}
@@ -391,7 +391,7 @@ RKSettingsModulePlugins::PluginMapStoredInfo RKSettingsModulePlugins::parsePlugi
inf.id = RKPluginMapFile::parseId(de, xml);
inf.priority = xml.getMultiChoiceAttribute(de, "priority", "hidden;low;medium;high", (int) PriorityMedium, DL_WARNING);
auto about = xml.getChildElement(de, "about", DL_WARNING);
- inf.version = xml.getStringAttribute(about, "version", QString(), DL_WARNING);
+ inf.version = RKParsedVersion(xml.getStringAttribute(about, "version", QString(), DL_WARNING));
return inf;
}
diff --git a/rkward/settings/rksettingsmoduleplugins.h b/rkward/settings/rksettingsmoduleplugins.h
index e0658f8b2..e6ce6f458 100644
--- a/rkward/settings/rksettingsmoduleplugins.h
+++ b/rkward/settings/rksettingsmoduleplugins.h
@@ -71,7 +71,7 @@ public:
/** Helper struct used by RKSettingsModulePlugins to keep track of plugin map files. */
struct PluginMapStoredInfo {
- PluginMapStoredInfo (const QString &_filename) : filename (_filename), state(Working) {};
+ explicit PluginMapStoredInfo(const QString &_filename) : filename(_filename), state(Working) {};
QString filename;
PluginMapState state;
int priority;
diff --git a/rkward/windows/katepluginintegration.cpp b/rkward/windows/katepluginintegration.cpp
index 9534a0880..d5de3405a 100644
--- a/rkward/windows/katepluginintegration.cpp
+++ b/rkward/windows/katepluginintegration.cpp
@@ -40,7 +40,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
class KatePluginWindow : public RKMDIWindow {
Q_OBJECT
public:
- KatePluginWindow(QWidget *parent, bool tool_window=true) : RKMDIWindow(parent, RKMDIWindow::KatePluginWindow, tool_window) {
+ explicit KatePluginWindow(QWidget *parent, bool tool_window=true) : RKMDIWindow(parent, RKMDIWindow::KatePluginWindow, tool_window) {
RK_TRACE (APP);
QVBoxLayout *layout = new QVBoxLayout(this);
diff --git a/rkward/windows/katepluginintegration.h b/rkward/windows/katepluginintegration.h
index 81873854d..4307f4952 100644
--- a/rkward/windows/katepluginintegration.h
+++ b/rkward/windows/katepluginintegration.h
@@ -27,7 +27,7 @@ class RKMDIWindow;
class KatePluginIntegrationApp : public QObject {
Q_OBJECT
public:
- KatePluginIntegrationApp(QObject *parent);
+ explicit KatePluginIntegrationApp(QObject *parent);
~KatePluginIntegrationApp();
QObject* loadPlugin(const QString& identifier);
/** Loads the given plugins, *and* unloads all others. */
@@ -69,7 +69,7 @@ class KatePluginWindow;
class KatePluginIntegrationWindow : public QObject, public KXMLGUIClient {
Q_OBJECT
public:
- KatePluginIntegrationWindow(KatePluginIntegrationApp *parent);
+ explicit KatePluginIntegrationWindow(KatePluginIntegrationApp *parent);
~KatePluginIntegrationWindow();
KTextEditor::MainWindow *mainWindow() const { return main; };
KXMLGUIClient* persistentGuiClient() { return this; }
diff --git a/rkward/windows/rkcodecompletion.cpp b/rkward/windows/rkcodecompletion.cpp
index 99f28a262..9b9453db0 100644
--- a/rkward/windows/rkcodecompletion.cpp
+++ b/rkward/windows/rkcodecompletion.cpp
@@ -31,7 +31,7 @@ SPDX-License-Identifier: GPL-2.0-or-later
class RKCompletionNotifierModel : public RKCompletionModelBase {
public:
- RKCompletionNotifierModel (RKCompletionManager *manager) : RKCompletionModelBase (manager) {};
+ explicit RKCompletionNotifierModel(RKCompletionManager *manager) : RKCompletionModelBase(manager) {};
KTextEditor::Range completionRange (KTextEditor::View *, const KTextEditor::Cursor &position) override {
return KTextEditor::Range (position, position);
}
diff --git a/rkward/windows/rkcodecompletion.h b/rkward/windows/rkcodecompletion.h
index 62f8cc6b8..581096d71 100644
--- a/rkward/windows/rkcodecompletion.h
+++ b/rkward/windows/rkcodecompletion.h
@@ -205,7 +205,7 @@ private:
class RKDynamicCompletionsAddition : public QObject {
Q_OBJECT
public:
- RKDynamicCompletionsAddition(RKCompletionModelBase *parent);
+ explicit RKDynamicCompletionsAddition(RKCompletionModelBase *parent);
~RKDynamicCompletionsAddition();
void update(const QString &mode, const QString &fragment, const QString &filterprefix, const QStringList &filterlist);
const QStringList results() const { return filtered_results; };
diff --git a/rkward/windows/rkcommandeditorwindow.cpp b/rkward/windows/rkcommandeditorwindow.cpp
index 3924d6de2..75ca903c5 100644
--- a/rkward/windows/rkcommandeditorwindow.cpp
+++ b/rkward/windows/rkcommandeditorwindow.cpp
@@ -676,9 +676,9 @@ QUrl RKCommandEditorWindow::url () const {
return (m_doc->url ());
}
-bool RKCommandEditorWindow::isModified () {
+bool RKCommandEditorWindow::isModified() const {
RK_TRACE (COMMANDEDITOR);
- return m_doc->isModified ();
+ return m_doc->isModified();
}
bool RKCommandEditorWindow::save () {
diff --git a/rkward/windows/rkcommandeditorwindow.h b/rkward/windows/rkcommandeditorwindow.h
index ad5921d59..d2ee97273 100644
--- a/rkward/windows/rkcommandeditorwindow.h
+++ b/rkward/windows/rkcommandeditorwindow.h
@@ -40,7 +40,7 @@ class KActionCollection;
class RKCommandEditorWindowPart : public KParts::Part {
protected:
friend class RKCommandEditorWindow;
- RKCommandEditorWindowPart (QWidget *parent);
+ explicit RKCommandEditorWindowPart(QWidget *parent);
~RKCommandEditorWindowPart ();
};
@@ -84,7 +84,7 @@ public:
/** destructor */
~RKCommandEditorWindow ();
/** returns, whether the document was modified since the last save */
- bool isModified () override;
+ bool isModified() const override;
/** saves the document, returns true on success */
bool save () override;
/** insert the given text into the document at the current cursor position. Additionally, focuses the view */
diff --git a/rkward/windows/rkhtmlwindow.cpp b/rkward/windows/rkhtmlwindow.cpp
index 845fa7179..7e3b51118 100644
--- a/rkward/windows/rkhtmlwindow.cpp
+++ b/rkward/windows/rkhtmlwindow.cpp
@@ -180,7 +180,7 @@ friend class RKHTMLWindow;
class RKWebView : public QWebEngineView {
public:
- RKWebView (QWidget *parent) : QWebEngineView (parent) {};
+ explicit RKWebView(QWidget *parent) : QWebEngineView(parent) {};
void print(QPrinter *printer) {
if (!page()) return;
QWebEngineView::forPage(page())->print(printer);
@@ -209,7 +209,7 @@ protected:
class RKWebEngineKIOForwarder : public QWebEngineUrlSchemeHandler {
public:
- RKWebEngineKIOForwarder (QObject *parent) : QWebEngineUrlSchemeHandler (parent) {}
+ explicit RKWebEngineKIOForwarder(QObject *parent) : QWebEngineUrlSchemeHandler(parent) {}
void requestStarted (QWebEngineUrlRequestJob *request) override {
KIO::StoredTransferJob *job = KIO::storedGet(request->requestUrl (), KIO::NoReload, KIO::HideProgressInfo);
connect (job, &KIO::StoredTransferJob::result, this, [this, job](){ kioJobFinished(job); });
@@ -331,11 +331,6 @@ QUrl RKHTMLWindow::restorableUrl () {
return ::restorableUrl(current_url);
}
-bool RKHTMLWindow::isModified () {
- RK_TRACE (APP);
- return false;
-}
-
void RKHTMLWindow::makeContextMenu (const QPoint& pos) {
RK_TRACE (APP);
diff --git a/rkward/windows/rkhtmlwindow.h b/rkward/windows/rkhtmlwindow.h
index 0ea5cbb30..5c7b4a01d 100644
--- a/rkward/windows/rkhtmlwindow.h
+++ b/rkward/windows/rkhtmlwindow.h
@@ -65,8 +65,6 @@ public:
*/
static bool handleRKWardURL(const QUrl &url, RKHTMLWindow *window=nullptr);
void openRKHPage (const QUrl &url);
-
- bool isModified () override;
/** Return current url */
QUrl url () const { return current_url; };
/** Return current url in a restorable way, i.e. for help pages, abstract the session specific part of the path */
diff --git a/rkward/windows/rkmdiwindow.h b/rkward/windows/rkmdiwindow.h
index 59c071ebd..79ac4f56b 100644
--- a/rkward/windows/rkmdiwindow.h
+++ b/rkward/windows/rkmdiwindow.h
@@ -73,7 +73,7 @@ public Q_SLOTS:
void setCaption (const QString &caption);
public:
/** @returns true, if the window's document was modified (and would need to be saved) */
- virtual bool isModified () { return false; };
+ virtual bool isModified () const { return false; };
/** Ask the window's document to save itself.
@returns true on success, _or_ if the document cannot be saved at all (in which case isModified() should return false, too. False, if saving failed / was cancelled */
virtual bool save () { return true; };
diff --git a/rkward/windows/rkwindowcatcher.h b/rkward/windows/rkwindowcatcher.h
index b85b61c96..ae6d93173 100644
--- a/rkward/windows/rkwindowcatcher.h
+++ b/rkward/windows/rkwindowcatcher.h
@@ -115,8 +115,6 @@ public:
RKCaughtX11Window (RKGraphicsDevice *rkward_device, int device_number);
/** dtor */
~RKCaughtX11Window ();
-/** TODO? */
- bool isModified () override { return false; };
/** reimplemented from RKMDIWindow to switch to fixed size mode, and disable the dynamic_size_action */
void prepareToBeAttached () override;
More information about the rkward-tracker
mailing list