Skip to content

Commit

Permalink
osx compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
coryo committed Jun 14, 2015
1 parent a0e0f1c commit bdc3a18
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions Amphetype2.pro
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ FORMS += mainwindow.ui \
performancehistory.ui \
statisticswidget.ui

QMAKE_CXXFLAGS += -std=c++1y -stdlib=libc++

macx {
message("mac build")
INCLUDEPATH += /usr/local/Cellar/boost/1.58.0/include
Expand Down
2 changes: 1 addition & 1 deletion performancehistory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void PerformanceHistory::doubleClicked(const QModelIndex& idx)
{
int row = idx.row();

QModelIndex& f = modelb->index(row, 0);
const QModelIndex& f = modelb->index(row, 0);

QSqlQuery q;
q.prepare("select id, source, text from text where id = :textid");
Expand Down
4 changes: 2 additions & 2 deletions quizzer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ void Quizzer::done()
"values (:time,:visc,:when,:count,:mistakes,:type,:data)");
for (QStringRef k : keys) {
// get the median time
QList<double>& timeValues = stats.values(k);
const QList<double>& timeValues = stats.values(k);
if (timeValues.length() > 1)
q.bindValue(":time", ((timeValues[timeValues.length()/2] + (timeValues[timeValues.length()/2 - 1]))/2.0));
else if (timeValues.length() == 1)
Expand All @@ -275,7 +275,7 @@ void Quizzer::done()
q.bindValue(":time", timeValues.first());

// get the median viscosity
QList<double>& viscValues = visc.values(k);
const QList<double>& viscValues = visc.values(k);
if (viscValues.length() > 1)
q.bindValue(":visc", ((viscValues[viscValues.length()/2]+viscValues[viscValues.length()/2-1])/2.0) * 100.0);
else if (viscValues.length() == 1)
Expand Down

0 comments on commit bdc3a18

Please sign in to comment.