r24781 by jghali - Code cleanup
scribus-commit
scribus-commit at lists.scribus.net
Sun Dec 26 00:16:23 UTC 2021
Author: jghali
Date: Sun Dec 26 00:16:22 2021
New Revision: 24781
URL: http://scribus.net/websvn/listing.php?repname=Scribus&sc=1&rev=24781
Log:
Code cleanup
Modified:
trunk/Scribus/scribus/ui/pdfversionmodel.cpp
trunk/Scribus/scribus/ui/pdfversionmodel.h
Modified: trunk/Scribus/scribus/ui/pdfversionmodel.cpp
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24781&path=/trunk/Scribus/scribus/ui/pdfversionmodel.cpp
==============================================================================
--- trunk/Scribus/scribus/ui/pdfversionmodel.cpp (original)
+++ trunk/Scribus/scribus/ui/pdfversionmodel.cpp Sun Dec 26 00:16:22 2021
@@ -17,11 +17,6 @@
m_enabledVec << true << true << true << true << false << false << false;
}
-void PdfVersionModel::clear()
-{
- qDebug() << "PdfVersionModel: this model cannot be cleared";
-}
-
int PdfVersionModel::columnCount(const QModelIndex &/*parent*/) const
{
return 1;
@@ -32,7 +27,7 @@
if (!index.isValid())
return QVariant();
- bool* pEnabled = static_cast<bool*>(index.internalPointer());
+ const bool* pEnabled = static_cast<bool*>(index.internalPointer());
if (!pEnabled)
return QVariant();
@@ -75,7 +70,7 @@
if (!hasIndex(row, column, parent))
return QModelIndex();
- bool* pEnabled = static_cast<bool*>(parent.internalPointer());
+ const bool* pEnabled = static_cast<bool*>(parent.internalPointer());
if (pEnabled)
return QModelIndex();
@@ -91,7 +86,7 @@
return QModelIndex();
}
-bool PdfVersionModel::removeRow(int row, const QModelIndex& parent)
+bool PdfVersionModel::removeRow(int /*row*/, const QModelIndex& /*parent*/)
{
qDebug() << "PdfVersionModel: this model cannot have rows removed";
return false;
@@ -108,7 +103,7 @@
if (m_enabledVec.count() == 0)
return 0;
- bool* pEnabled = static_cast<bool*>(parent.internalPointer());
+ const bool* pEnabled = static_cast<bool*>(parent.internalPointer());
if (pEnabled)
return 0;
Modified: trunk/Scribus/scribus/ui/pdfversionmodel.h
URL: http://scribus.net/websvn/diff.php?repname=Scribus&rev=24781&path=/trunk/Scribus/scribus/ui/pdfversionmodel.h
==============================================================================
--- trunk/Scribus/scribus/ui/pdfversionmodel.h (original)
+++ trunk/Scribus/scribus/ui/pdfversionmodel.h Sun Dec 26 00:16:22 2021
@@ -33,38 +33,35 @@
ItemPDFX_4 = 6
};
- //! Remove all colors from list;
- void clear();
-
//! Reimplement QAbstractItemModel columnCount()
- int columnCount(const QModelIndex &parent = QModelIndex()) const;
+ int columnCount(const QModelIndex &parent = QModelIndex()) const override;
//! Reimplement QAbstractItemModel data()
- QVariant data(const QModelIndex &index, int role) const;
+ QVariant data(const QModelIndex &index, int role) const override;
//! Reimplement QAbstractItemModel flags()
- Qt::ItemFlags flags(const QModelIndex &index) const;
+ Qt::ItemFlags flags(const QModelIndex &index) const override;
//! Reimplement QAbstractItemModel index()
- QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const;
+ QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const override;
//! Reimplement QAbstractItemModel parent()
- QModelIndex parent(const QModelIndex &child) const;
+ QModelIndex parent(const QModelIndex &child) const override;
//! Reimplement QAbstractItemModel removeRow()
bool removeRow(int row, const QModelIndex& parent = QModelIndex());
//! Reimplement QAbstractItemModel removeRowz()
- bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex());
+ bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
//! Reimplement QAbstractItemModel rowCount()
- int rowCount(const QModelIndex &parent = QModelIndex()) const;
+ int rowCount(const QModelIndex &parent = QModelIndex()) const override;
//! Allow or disallow no font embedding mode
void setPdfXEnabled(bool enabled);
protected:
- //! The color list
+ //! The enabled/disabled flags
QVector<bool> m_enabledVec;
};
More information about the scribus-commit
mailing list