[education/rkward] rkward: Avoid suspicous parent virtual calls (as pointed out by aacid, clang-tidy)

Thomas Friedrichsmeier null at kde.org
Mon Mar 28 16:08:16 BST 2022


Git commit e59b728bf817f8ea0015e6681ef64c7e2f6546c2 by Thomas Friedrichsmeier.
Committed on 28/03/2022 at 15:06.
Pushed by tfry into branch 'master'.

Avoid suspicous parent virtual calls (as pointed out by aacid, clang-tidy)

None of these we really a problem, but the two table ones did prevent a little optimization.

M  +1    -1    rkward/core/renvironmentobject.cpp
M  +1    -1    rkward/core/rkpseudoobjects.cpp
M  +1    -1    rkward/plugin/rkoptionset.cpp
M  +1    -1    rkward/settings/rksettingsmoduleplugins.cpp

https://invent.kde.org/education/rkward/commit/e59b728bf817f8ea0015e6681ef64c7e2f6546c2

diff --git a/rkward/core/renvironmentobject.cpp b/rkward/core/renvironmentobject.cpp
index 4acf9462..ab6782e5 100644
--- a/rkward/core/renvironmentobject.cpp
+++ b/rkward/core/renvironmentobject.cpp
@@ -153,7 +153,7 @@ bool REnvironmentObject::updateStructure (RData *new_data) {
 	RK_ASSERT (new_data->getDataLength () >= StorageSizeBasicInfo);
 
 	if (!(type & ToplevelEnv)) {
-		if (!RObject::updateStructure (new_data)) return false;
+		if (!RContainerObject::updateStructure(new_data)) return false;
 	}
 
 	RData::RDataStorage new_data_data = new_data->structureVector ();
diff --git a/rkward/core/rkpseudoobjects.cpp b/rkward/core/rkpseudoobjects.cpp
index cd787b25..87fc296c 100644
--- a/rkward/core/rkpseudoobjects.cpp
+++ b/rkward/core/rkpseudoobjects.cpp
@@ -147,7 +147,7 @@ RKNamespaceObject* RKOrphanNamespacesObject::findOrphanNamespace (const QString&
 QString RKOrphanNamespacesObject::getObjectDescription () const {
 	RK_TRACE (OBJECTS);
 
-	QString desc = RObject::getObjectDescription ();
+	QString desc = REnvironmentObject::getObjectDescription ();
 	desc.append (QString ("<p>%1</p>").arg (i18n ("This special object does not actually exist anywhere in R. It is used, here, to list namespaces which are loaded, but not attached to a package on the search path. These are typically 'imported' namespaces.")));
 	return desc;
 }
diff --git a/rkward/plugin/rkoptionset.cpp b/rkward/plugin/rkoptionset.cpp
index 76befe69..6a45eb72 100644
--- a/rkward/plugin/rkoptionset.cpp
+++ b/rkward/plugin/rkoptionset.cpp
@@ -881,7 +881,7 @@ bool RKOptionSetDisplayModel::dropMimeData (const QMimeData* data, Qt::DropActio
 }
 
 Qt::ItemFlags RKOptionSetDisplayModel::flags (const QModelIndex& index) const {
-	return QAbstractItemModel::flags (index) | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
+	return QAbstractTableModel::flags (index) | Qt::ItemIsDragEnabled | Qt::ItemIsDropEnabled;
 }
 
 Qt::DropActions RKOptionSetDisplayModel::supportedDropActions () const {
diff --git a/rkward/settings/rksettingsmoduleplugins.cpp b/rkward/settings/rksettingsmoduleplugins.cpp
index 8d28edf1..771faec4 100644
--- a/rkward/settings/rksettingsmoduleplugins.cpp
+++ b/rkward/settings/rksettingsmoduleplugins.cpp
@@ -483,7 +483,7 @@ QVariant RKSettingsModulePluginsModel::data (const QModelIndex& index, int role)
 
 Qt::ItemFlags RKSettingsModulePluginsModel::flags (const QModelIndex& index) const {
 	// RK_TRACE (SETTINGS);
-	Qt::ItemFlags flags = QAbstractItemModel::flags (index);
+	Qt::ItemFlags flags = QAbstractTableModel::flags (index);
 	if (index.isValid () && (index.column () == COLUMN_CHECKED)) {
 		if (plugin_maps[index.row ()].priority > RKSettingsModulePlugins::PriorityHidden) flags |= Qt::ItemIsUserCheckable | Qt::ItemIsEditable;
 	}


More information about the rkward-tracker mailing list