patches for Haiku OS, thanks to mmu_man

This commit is contained in:
Mark Watkins 2016-01-05 16:06:32 +10:00
parent 1e20707edf
commit 63345a108e
5 changed files with 27 additions and 8 deletions

View File

@ -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

View File

@ -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);

View File

@ -782,6 +782,8 @@ void MainWindow::importCPAPBackups()
# if defined(Q_OS_MAC) || defined(Q_OS_BSD4)
# include <sys/mount.h>
# elif defined(Q_OS_HAIKU)
// nothing needed
# else
# include <sys/statfs.h>
# include <mntent.h>
@ -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

View File

@ -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

View File

@ -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