mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Print: mark some functions in PrintLayout as 'const'
It might be a good practice to declare certain class 'helper' functions as constant members. But I don't think there are performance benefits to that other than the readability ones. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
This commit is contained in:
parent
a4982c93cd
commit
3aae3ff547
2 changed files with 14 additions and 14 deletions
|
@ -80,17 +80,17 @@ void PrintLayout::setup()
|
||||||
scaleY = (qreal)printerDpi/(qreal)screenDpiY;
|
scaleY = (qreal)printerDpi/(qreal)screenDpiY;
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintLayout::printSixDives()
|
void PrintLayout::printSixDives() const
|
||||||
{
|
{
|
||||||
// nop
|
// nop
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintLayout::printTwoDives()
|
void PrintLayout::printTwoDives() const
|
||||||
{
|
{
|
||||||
// nop
|
// nop
|
||||||
}
|
}
|
||||||
|
|
||||||
void PrintLayout::printTable()
|
void PrintLayout::printTable() const
|
||||||
{
|
{
|
||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
QSizeF pageSize;
|
QSizeF pageSize;
|
||||||
|
@ -149,7 +149,7 @@ void PrintLayout::printTable()
|
||||||
doc.print(printer);
|
doc.print(printer);
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PrintLayout::insertTableHeadingRow()
|
QString PrintLayout::insertTableHeadingRow() const
|
||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
QString ret("<tr>");
|
QString ret("<tr>");
|
||||||
|
@ -159,7 +159,7 @@ QString PrintLayout::insertTableHeadingRow()
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PrintLayout::insertTableHeadingCol(int col)
|
QString PrintLayout::insertTableHeadingCol(int col) const
|
||||||
{
|
{
|
||||||
QString ret("<th align='left' width='");
|
QString ret("<th align='left' width='");
|
||||||
ret += tableColumnWidths.at(col);
|
ret += tableColumnWidths.at(col);
|
||||||
|
@ -169,7 +169,7 @@ QString PrintLayout::insertTableHeadingCol(int col)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PrintLayout::insertTableDataRow(struct dive *dive)
|
QString PrintLayout::insertTableDataRow(struct dive *dive) const
|
||||||
{
|
{
|
||||||
// use the DiveItem class
|
// use the DiveItem class
|
||||||
struct DiveItem di;
|
struct DiveItem di;
|
||||||
|
@ -188,7 +188,7 @@ QString PrintLayout::insertTableDataRow(struct dive *dive)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString PrintLayout::insertTableDataCol(QString data)
|
QString PrintLayout::insertTableDataCol(QString data) const
|
||||||
{
|
{
|
||||||
return "<td>" + data + "</td>";
|
return "<td>" + data + "</td>";
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,13 +27,13 @@ private:
|
||||||
QStringList tableColumnWidths;
|
QStringList tableColumnWidths;
|
||||||
|
|
||||||
void setup();
|
void setup();
|
||||||
void printSixDives();
|
void printSixDives() const;
|
||||||
void printTwoDives();
|
void printTwoDives() const;
|
||||||
void printTable();
|
void printTable() const;
|
||||||
QString insertTableHeadingRow();
|
QString insertTableHeadingRow() const;
|
||||||
QString insertTableHeadingCol(int);
|
QString insertTableHeadingCol(int) const;
|
||||||
QString insertTableDataRow(struct dive *);
|
QString insertTableDataRow(struct dive *) const;
|
||||||
QString insertTableDataCol(QString);
|
QString insertTableDataCol(QString) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue