aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-11 12:55:48 +0300
committerGravatar Lubomir I. Ivanov <neolit123@gmail.com>2013-07-11 12:55:48 +0300
commit3aae3ff5472d6deada4908fe599714ecdd7e6b61 (patch)
treee5d3ccf1fb6294952f074d00483807c29a3896c4
parenta4982c93cd4481dd3d587f1d927121f026f61c50 (diff)
downloadsubsurface-3aae3ff5472d6deada4908fe599714ecdd7e6b61.tar.gz
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>
-rw-r--r--qt-ui/printlayout.cpp14
-rw-r--r--qt-ui/printlayout.h14
2 files changed, 14 insertions, 14 deletions
diff --git a/qt-ui/printlayout.cpp b/qt-ui/printlayout.cpp
index f33b372e1..6b81dd616 100644
--- a/qt-ui/printlayout.cpp
+++ b/qt-ui/printlayout.cpp
@@ -80,17 +80,17 @@ void PrintLayout::setup()
scaleY = (qreal)printerDpi/(qreal)screenDpiY;
}
-void PrintLayout::printSixDives()
+void PrintLayout::printSixDives() const
{
// nop
}
-void PrintLayout::printTwoDives()
+void PrintLayout::printTwoDives() const
{
// nop
}
-void PrintLayout::printTable()
+void PrintLayout::printTable() const
{
QTextDocument doc;
QSizeF pageSize;
@@ -149,7 +149,7 @@ void PrintLayout::printTable()
doc.print(printer);
}
-QString PrintLayout::insertTableHeadingRow()
+QString PrintLayout::insertTableHeadingRow() const
{
int i;
QString ret("<tr>");
@@ -159,7 +159,7 @@ QString PrintLayout::insertTableHeadingRow()
return ret;
}
-QString PrintLayout::insertTableHeadingCol(int col)
+QString PrintLayout::insertTableHeadingCol(int col) const
{
QString ret("<th align='left' width='");
ret += tableColumnWidths.at(col);
@@ -169,7 +169,7 @@ QString PrintLayout::insertTableHeadingCol(int col)
return ret;
}
-QString PrintLayout::insertTableDataRow(struct dive *dive)
+QString PrintLayout::insertTableDataRow(struct dive *dive) const
{
// use the DiveItem class
struct DiveItem di;
@@ -188,7 +188,7 @@ QString PrintLayout::insertTableDataRow(struct dive *dive)
return ret;
}
-QString PrintLayout::insertTableDataCol(QString data)
+QString PrintLayout::insertTableDataCol(QString data) const
{
return "<td>" + data + "</td>";
}
diff --git a/qt-ui/printlayout.h b/qt-ui/printlayout.h
index c55778dd8..cbb1e42ac 100644
--- a/qt-ui/printlayout.h
+++ b/qt-ui/printlayout.h
@@ -27,13 +27,13 @@ private:
QStringList tableColumnWidths;
void setup();
- void printSixDives();
- void printTwoDives();
- void printTable();
- QString insertTableHeadingRow();
- QString insertTableHeadingCol(int);
- QString insertTableDataRow(struct dive *);
- QString insertTableDataCol(QString);
+ void printSixDives() const;
+ void printTwoDives() const;
+ void printTable() const;
+ QString insertTableHeadingRow() const;
+ QString insertTableHeadingCol(int) const;
+ QString insertTableDataRow(struct dive *) const;
+ QString insertTableDataCol(QString) const;
};
#endif