Window 32bit build fixes, variable cleanups

This commit is contained in:
Mark Watkins 2014-10-02 20:02:33 +10:00
parent ffeb0149c0
commit 1ade0e7b04
8 changed files with 37 additions and 39 deletions

View File

@ -68,7 +68,7 @@ class gFlagsLine: public Layer
void setLineNum(int i) { line_num = i; } void setLineNum(int i) { line_num = i; }
virtual Layer * Clone() { virtual Layer * Clone() {
gFlagsLine * layer = new gFlagsLine(nullptr); //ouchie.. gFlagsLine * layer = new gFlagsLine(NoChannel); //ouchie..
Layer::CloneInto(layer); Layer::CloneInto(layer);
CloneInto(layer); CloneInto(layer);
return layer; return layer;

View File

@ -298,7 +298,8 @@ void gGraph::paint(QPainter &painter, const QRegion &region)
//m_marginbottom=5; //m_marginbottom=5;
left = marginLeft()*printScaleX(), right = marginRight()*printScaleX(), top = marginTop(), bottom = marginBottom() * printScaleY(); left = marginLeft()*printScaleX(), right = marginRight()*printScaleX(), top = marginTop(), bottom = marginBottom() * printScaleY();
int x = 0, y = 0; //int x;
int y;
if (m_showTitle) { if (m_showTitle) {
int title_x, yh; int title_x, yh;
@ -309,7 +310,7 @@ void gGraph::paint(QPainter &painter, const QRegion &region)
yh = fm.height(); yh = fm.height();
//GetTextExtent("Wy@",x,yh,mediumfont); // This gets a better consistent height. should be cached. //GetTextExtent("Wy@",x,yh,mediumfont); // This gets a better consistent height. should be cached.
y = yh; y = yh;
x = fm.width(title()); //x = fm.width(title());
//GetTextExtent(title(),x,y,mediumfont); //GetTextExtent(title(),x,y,mediumfont);
title_x = float(yh) ; title_x = float(yh) ;
@ -716,7 +717,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
int y = event->y(); int y = event->y();
int x = event->x(); int x = event->x();
bool doredraw = false; //bool doredraw = false;
timedRedraw(0); timedRedraw(0);
@ -796,7 +797,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
int offset = (x >= x2) ? 20 : - 20; int offset = (x >= x2) ? 20 : - 20;
ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align); ToolTip(m_selDurString, m_rect.left() + x + offset, m_rect.top() + y + 20, align);
doredraw = true; //doredraw = true;
} else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging } else if (event->buttons() & Qt::RightButton) { // Right Mouse button dragging
m_graphview->setPointClicked(event->pos()); m_graphview->setPointClicked(event->pos());
x -= left; x -= left;
@ -822,7 +823,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
} }
m_graphview->SetXBounds(min_x, max_x, m_group, false); m_graphview->SetXBounds(min_x, max_x, m_group, false);
doredraw = true; // doredraw = true;
} else { } else {
qint64 qq = rmax_x - rmin_x; qint64 qq = rmax_x - rmin_x;
xx = max_x - min_x; xx = max_x - min_x;
@ -845,7 +846,7 @@ void gGraph::mouseMoveEvent(QMouseEvent *event)
} }
m_graphview->SetXBounds(min_x, max_x, m_group, false); m_graphview->SetXBounds(min_x, max_x, m_group, false);
doredraw = true; //doredraw = true;
} }
} }
} }
@ -1180,7 +1181,7 @@ void gGraph::ZoomX(double mult, int origin_px)
min = max - q; min = max - q;
} }
extern const int max_history; //extern const int max_history;
m_graphview->SetXBounds(min, max, m_group); m_graphview->SetXBounds(min, max, m_group);
//updateSelectionTime(max-min); //updateSelectionTime(max-min);

View File

@ -81,7 +81,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
qint64 clockdrift = qint64(p_profile->cpap->clockDrift()) * 1000L; qint64 clockdrift = qint64(p_profile->cpap->clockDrift()) * 1000L;
qint64 drift = 0; qint64 drift = 0;
bool hover = false; //bool hover = false;
// For each session, process it's eventlist // For each session, process it's eventlist
for (QList<Session *>::iterator s = m_day->begin(); s != m_day->end(); s++) { for (QList<Session *>::iterator s = m_day->begin(); s != m_day->end(); s++) {
@ -125,7 +125,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
// FT_Span // FT_Span
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
for (; dptr < eptr; dptr++) { for (; dptr < eptr; dptr++) {
hover = false; //hover = false;
X = stime + *tptr++; X = stime + *tptr++;
raw = *dptr; raw = *dptr;
@ -154,9 +154,9 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
QRect rect(x2, start_py, x1-x2, height); QRect rect(x2, start_py, x1-x2, height);
QColor col = m_flag_color; QColor col = m_flag_color;
if (rect.contains(mouse)) { // if (rect.contains(mouse)) {
hover = true; // hover = true;
} // }
painter.fillRect(rect, QBrush(col)); painter.fillRect(rect, QBrush(col));
} }
@ -195,7 +195,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
// FT_Bar // FT_Bar
//////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////
for (; dptr < eptr; dptr++) { for (; dptr < eptr; dptr++) {
hover = false; // hover = false;
X = stime + *tptr++; X = stime + *tptr++;
raw = *dptr; raw = *dptr;
@ -249,7 +249,7 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
// painter.drawLine(rect.x(), top, rect.x(), bottom); // painter.drawLine(rect.x(), top, rect.x(), bottom);
// col = COLOR_Gold; // col = COLOR_Gold;
hover = true; // hover = true;
painter.setPen(QPen(col,3)); painter.setPen(QPen(col,3));
} else { } else {
painter.setPen(QPen(col,1)); painter.setPen(QPen(col,1));
@ -266,11 +266,11 @@ void gLineOverlayBar::paint(QPainter &painter, gGraph &w, const QRegion &region)
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
// Top and bottom markers // Top and bottom markers
////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////
bool b = false; //bool b = false;
if (!w.selectingArea() && !m_blockhover && QRect(x1-2, topp, 6, height).contains(mouse) && !m_hover) { if (!w.selectingArea() && !m_blockhover && QRect(x1-2, topp, 6, height).contains(mouse) && !m_hover) {
// only want to draw the highlight/label once per frame // only want to draw the highlight/label once per frame
m_hover = true; m_hover = true;
b = true; //b = true;
// Draw text label // Draw text label
QString lab = QString("%1 (%2)").arg(schema::channel[m_code].fullname()).arg(raw); QString lab = QString("%1 (%2)").arg(schema::channel[m_code].fullname()).arg(raw);

View File

@ -439,12 +439,12 @@ bool Machine::Purge(int secret)
QList<Session *> sessions = sessionlist.values(); QList<Session *> sessions = sessionlist.values();
// Clean up any loaded sessions from memory first.. // Clean up any loaded sessions from memory first..
bool success = true; //bool success = true;
for (int i=0; i < sessions.size(); ++i) { for (int i=0; i < sessions.size(); ++i) {
Session * sess = sessions[i]; Session * sess = sessions[i];
if (!sess->Destroy()) { if (!sess->Destroy()) {
qDebug() << "Could not destroy "+ info.loadername +" ("+info.serial+") session" << sess->session(); qDebug() << "Could not destroy "+ info.loadername +" ("+info.serial+") session" << sess->session();
success = false; // success = false;
} else { } else {
// sessionlist.remove(sess->session()); // sessionlist.remove(sess->session());
} }
@ -482,7 +482,7 @@ bool Machine::Purge(int secret)
qDebug() << "Deleting " << QDir::toNativeSeparators(fullpath); qDebug() << "Deleting " << QDir::toNativeSeparators(fullpath);
if (!dir.remove(fullpath)) { if (!dir.remove(fullpath)) {
qDebug() << "Could not purge file" << fullpath; qDebug() << "Could not purge file" << fullpath;
success=false; //success=false;
could_not_kill++; could_not_kill++;
} }
} else { } else {

View File

@ -1156,9 +1156,9 @@ QString Daily::getStatisticsInfo(Day * day)
{ {
if (!day) return QString(); if (!day) return QString();
Machine *cpap = day->machine(MT_CPAP), Machine *cpap = day->machine(MT_CPAP);
*oxi = day->machine(MT_OXIMETER), // *oxi = day->machine(MT_OXIMETER),
*pos = day->machine(MT_POSITION); // *pos = day->machine(MT_POSITION);
int mididx=p_profile->general->prefCalcMiddle(); int mididx=p_profile->general->prefCalcMiddle();
@ -1351,13 +1351,13 @@ void Daily::Load(QDate date)
Day * day = p_profile->GetDay(date); Day * day = p_profile->GetDay(date);
Machine *cpap = nullptr, Machine *cpap = nullptr,
*oxi = nullptr, *oxi = nullptr,
*stage = nullptr, //*stage = nullptr,
*posit = nullptr; *posit = nullptr;
if (day) { if (day) {
cpap = day->machine(MT_CPAP); cpap = day->machine(MT_CPAP);
oxi = day->machine(MT_OXIMETER); oxi = day->machine(MT_OXIMETER);
stage = day->machine(MT_SLEEPSTAGE); // stage = day->machine(MT_SLEEPSTAGE);
posit = day->machine(MT_POSITION); posit = day->machine(MT_POSITION);
} }
@ -2004,7 +2004,7 @@ void Daily::on_LineCursorUpdate(double time)
} else dateDisplay->setText(QString(GraphView->emptyText())); } else dateDisplay->setText(QString(GraphView->emptyText()));
} }
void Daily::on_RangeUpdate(double minx, double maxx) void Daily::on_RangeUpdate(double minx, double /*maxx*/)
{ {
if (minx > 1) { if (minx > 1) {
dateDisplay->setText(GraphView->getRangeString()); dateDisplay->setText(GraphView->getRangeString());

View File

@ -304,10 +304,10 @@ retry_directory:
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
// Check when last checked for updates.. // Check when last checked for updates..
//////////////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////////////
bool check_updates = false; //bool check_updates = false;
if (PREF[STR_GEN_UpdatesAutoCheck].toBool()) { if (PREF[STR_GEN_UpdatesAutoCheck].toBool()) {
int update_frequency = PREF[STR_GEN_UpdateCheckFrequency].toInt(); //int update_frequency = PREF[STR_GEN_UpdateCheckFrequency].toInt();
int days = 1000; int days = 1000;
lastchecked = PREF[STR_GEN_UpdatesLastChecked].toDateTime(); lastchecked = PREF[STR_GEN_UpdatesLastChecked].toDateTime();
@ -316,9 +316,9 @@ retry_directory:
days /= 86400; days /= 86400;
}; };
if (days > update_frequency) { // if (days > update_frequency) {
check_updates = true; // check_updates = true;
} // }
} }
if (!Profiles::profiles.size()) { if (!Profiles::profiles.size()) {
@ -337,7 +337,7 @@ retry_directory:
if (vc < 0) { if (vc < 0) {
release_notes(); release_notes();
check_updates = false; //check_updates = false;
} else if (vc > 0) { } else if (vc > 0) {
if (QMessageBox::warning(nullptr, STR_MessageBox_Error, QObject::tr("The version of SleepyHead you just ran is OLDER than the one used to create this data (%1).").arg(PREF[STR_PREF_VersionString].toString()) +"\n\n"+ if (QMessageBox::warning(nullptr, STR_MessageBox_Error, QObject::tr("The version of SleepyHead you just ran is OLDER than the one used to create this data (%1).").arg(PREF[STR_PREF_VersionString].toString()) +"\n\n"+
QObject::tr("It is likely that doing this will cause data corruption, are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) { QObject::tr("It is likely that doing this will cause data corruption, are you sure you want to do this?"), QMessageBox::Yes | QMessageBox::No, QMessageBox::No) == QMessageBox::No) {

View File

@ -6,7 +6,8 @@
* License. See the file COPYING in the main directory of the Linux * License. See the file COPYING in the main directory of the Linux
* distribution for more details. */ * distribution for more details. */
#include <QGLFormat> #include <QGLContext>
#include <QFileDialog> #include <QFileDialog>
#include <QMessageBox> #include <QMessageBox>
#include <QResource> #include <QResource>
@ -1563,7 +1564,7 @@ void MainWindow::DelayedScreenshot()
#endif #endif
#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX) #if defined(Q_OS_WIN32) || defined(Q_OS_LINUX)
QRect rec = QApplication::desktop()->screenGeometry(); //QRect rec = QApplication::desktop()->screenGeometry();
// grab the whole screen // grab the whole screen
QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId()); QPixmap desktop = QPixmap::grabWindow(QApplication::desktop()->winId());
@ -2041,10 +2042,6 @@ void MainWindow::on_actionPurge_Current_Day_triggered()
} }
day = p_profile->GetDay(date, MT_CPAP); day = p_profile->GetDay(date, MT_CPAP);
if (day != nullptr) {
int i = 5;
}
getDaily()->clearLastDay(); getDaily()->clearLastDay();
getDaily()->LoadDate(date); getDaily()->LoadDate(date);
} }

View File

@ -20,8 +20,8 @@ contains(DEFINES, BrokenGL) {
DEFINES += BROKEN_OPENGL_BUILD DEFINES += BROKEN_OPENGL_BUILD
} else { } else {
message("Building with QGLWidget gGraphView") message("Building with QGLWidget gGraphView")
QT += opengl
} }
QT += opengl
#The following forces ResMed session locking.. it *may* not be necessary.. I'm still trying to assess this properly. #The following forces ResMed session locking.. it *may* not be necessary.. I'm still trying to assess this properly.
DEFINES += LOCK_RESMED_SESSIONS DEFINES += LOCK_RESMED_SESSIONS