diff --git a/sleepyhead/Graphs/gGraphView.cpp b/sleepyhead/Graphs/gGraphView.cpp index 72789842..a0a3df71 100644 --- a/sleepyhead/Graphs/gGraphView.cpp +++ b/sleepyhead/Graphs/gGraphView.cpp @@ -1011,7 +1011,7 @@ void gGraphView::updateScale() void gGraphView::resizeEvent(QResizeEvent *e) { -#if QT_VERSION >= QT_VERSION_CHECK(5,4,0) +#if QT_VERSION >= QT_VERSION_CHECK(5,4,0) && !defined(BROKEN_OPENGL_BUILD) // This ques a needed redraw event.. QOpenGLWidget::resizeEvent(e); #endif diff --git a/sleepyhead/main.cpp b/sleepyhead/main.cpp index 75af6027..8955b6b3 100644 --- a/sleepyhead/main.cpp +++ b/sleepyhead/main.cpp @@ -149,11 +149,17 @@ int main(int argc, char *argv[]) //////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Detection //////////////////////////////////////////////////////////////////////////////////////////// - float glversion = getOpenGLVersion(); + float glversion = 0.0; +#ifndef NO_OPENGL_BUILD + glversion = getOpenGLVersion(); +#endif bool opengl2supported = glversion >= 2.0; bool bad_graphics = !opengl2supported; - bool intel_graphics = getOpenGLVersionString().contains("INTEL", Qt::CaseInsensitive); + bool intel_graphics = false; +#ifndef NO_OPENGL_BUILD + getOpenGLVersionString().contains("INTEL", Qt::CaseInsensitive); +#endif //#if defined(Q_OS_WIN) // bool angle_supported = getGraphicsEngine().contains(CSTR_GFX_ANGLE, Qt::CaseInsensitive) && (QSysInfo::windowsVersion() >= QSysInfo::WV_VISTA); diff --git a/sleepyhead/mainwindow.cpp b/sleepyhead/mainwindow.cpp index 4a1bd824..228ccd5c 100644 --- a/sleepyhead/mainwindow.cpp +++ b/sleepyhead/mainwindow.cpp @@ -782,6 +782,8 @@ void MainWindow::importCPAPBackups() # if defined(Q_OS_MAC) || defined(Q_OS_BSD4) # include +# elif defined(Q_OS_HAIKU) +// nothing needed # else # include # include @@ -809,7 +811,7 @@ QStringList getDriveList() } } -#elif defined(Q_OS_UNIX) +#elif defined(Q_OS_UNIX) && !defined(Q_OS_HAIKU) // Unix / Linux (except BSD) FILE *mtab = setmntent("/etc/mtab", "r"); struct mntent *m; @@ -833,7 +835,7 @@ QStringList getDriveList() } endmntent(mtab); -#elif defined(Q_OS_WIN) +#elif defined(Q_OS_WIN) || defined(Q_OS_HAIKU) QFileInfoList list = QDir::drives(); for (int i = 0; i < list.size(); ++i) { @@ -1588,7 +1590,7 @@ void MainWindow::DelayedScreenshot() h /= pr; #endif -#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX) +#if defined(Q_OS_WIN32) || defined(Q_OS_LINUX) || defined(Q_OS_HAIKU) //QRect rec = QApplication::desktop()->screenGeometry(); // grab the whole screen diff --git a/sleepyhead/sleepyhead.pro b/sleepyhead/sleepyhead.pro index fe6abbab..22921641 100644 --- a/sleepyhead/sleepyhead.pro +++ b/sleepyhead/sleepyhead.pro @@ -18,6 +18,10 @@ greaterThan(QT_MAJOR_VERSION,4) { contains(DEFINES, BrokenGL) { message("Building with QWidget gGraphView") DEFINES += BROKEN_OPENGL_BUILD +} else:contains(DEFINES, NoGL) { + message("Building with QWidget gGraphView (No GL at all)") + DEFINES += BROKEN_OPENGL_BUILD + DEFINES += NO_OPENGL_BUILD } else { message("Building with QGLWidget gGraphView") } @@ -39,7 +43,7 @@ CONFIG += rtti #} TARGET = SleepyHead -unix:!macx { +unix:!macx:!haiku { TARGET.path=/usr/bin } @@ -64,7 +68,7 @@ exists(../.git):{ DEFINES += TEST_BUILD -unix:!macx { +unix:!macx:!haiku { LIBS += -lX11 -lz -lGLU DEFINES += _TTY_POSIX_ } @@ -76,6 +80,11 @@ macx { ICON = icons/iconfile.icns } +haiku { + LIBS += -lz -lGLU + DEFINES += _TTY_POSIX_ +} + win32 { DEFINES += WINVER=0x0501 # needed for mingw to pull in appropriate dbt business...probably a better way to do this RC_FILE += win_icon.rc diff --git a/sleepyhead/version.h b/sleepyhead/version.h index ec9d2ec1..66c327f7 100644 --- a/sleepyhead/version.h +++ b/sleepyhead/version.h @@ -34,6 +34,8 @@ const QString PlatformString = "MacOSX"; const QString PlatformString = "Win32"; #elif defined(Q_OS_LINUX) const QString PlatformString = "Linux"; +#elif defined(Q_OS_HAIKU) +const QString PlatformString = "Haiku"; #endif #endif // VERSION_H