From 49c386fa4bd03dfe7e102c1d0635743d966b75b7 Mon Sep 17 00:00:00 2001
From: "Arfonzo J. Coward" <art@poorcoding.com>
Date: Thu, 5 Dec 2013 00:04:04 +0000
Subject: QupZilla sources and build definitions modified for Haiku.


diff --git a/src/defines.pri b/src/defines.pri
index 18a234a..7c33ba5 100644
--- a/src/defines.pri
+++ b/src/defines.pri
@@ -19,6 +19,13 @@ win32-msvc* {
     LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib
 }
 
+#DEFINES *= QUPZILLA_PREFIX="`finddir B_USER_APPS_DIRECTORY`/QupZilla/"
+DEFINES *= QUPZILLA_PREFIX="/boot/home/config/apps/QupZilla/"
+DEFINES *= DISABLE_DBUS
+DEFINES *= NO_SYSTEM_DATAPATH
+DEFINES *= NO_X11
+
+
 # Check for pkg-config availability
 !mac:unix:system(pkg-config --version > /dev/null) {
     isEqual(QT_MAJOR_VERSION, 5) {
diff --git a/src/lib/3rdparty/processinfo.cpp b/src/lib/3rdparty/processinfo.cpp
index 6131d62..ba96c63 100644
--- a/src/lib/3rdparty/processinfo.cpp
+++ b/src/lib/3rdparty/processinfo.cpp
@@ -30,6 +30,10 @@
 #include <cstdarg>
 #endif
 
+#ifdef __HAIKU__
+#define DT_DIR	4
+#endif
+
 ProcessInfo::ProcessInfo(const QString &name)
     : m_name(name)
 {
@@ -75,7 +79,8 @@ pid_t ProcessInfo::GetPIDbyName(const char* cchrptr_ProcessName) const
     }
 
     // Loop while not NULL
-    while ((de_DirEntity = readdir(dir_proc))) {
+    while ((de_DirEntity = readdir(dir_proc))) {    	
+#ifndef __HAIKU__    
         if (de_DirEntity->d_type == DT_DIR) {
             if (IsNumeric(de_DirEntity->d_name)) {
                 strcpy(chrarry_CommandLinePath, "/proc/") ;
@@ -104,6 +109,7 @@ pid_t ProcessInfo::GetPIDbyName(const char* cchrptr_ProcessName) const
                 }
             }
         }
+#endif          
     }
 
     closedir(dir_proc) ;
diff --git a/src/main/main.cpp b/src/main/main.cpp
index e6a56ea..e4ac880 100644
--- a/src/main/main.cpp
+++ b/src/main/main.cpp
@@ -20,10 +20,12 @@
 
 #include <QMessageBox> // For QT_REQUIRE_VERSION
 
-#if defined(Q_OS_LINUX) || defined(__GLIBC__)
+#if defined(Q_OS_LINUX) || defined(__GLIBC__) || defined(__HAIKU__)
 #include <iostream>
 #include <signal.h>
+#ifndef __HAIKU__
 #include <execinfo.h>
+#endif
 
 #include "qupzilla.h"
 
@@ -56,6 +58,7 @@ void qupzilla_signal_handler(int s)
         }
         sigSegvServed = true;
 
+#ifndef __HAIKU__
         std::cout << "QupZilla: Crashed :( Saving backtrace in " << qPrintable(mApp->PROFILEDIR) << "crashlog ..." << std::endl;
 
         void* array[100];
@@ -105,6 +108,9 @@ void qupzilla_signal_handler(int s)
         file.close();
 
         std::cout << "Backtrace successfuly saved in " << qPrintable(dir.absoluteFilePath(file.fileName())) << std::endl;
+#else
+		std::cout << "QupZilla: Crashed :(" << std::endl;
+#endif        
     }
 
     default:
-- 
1.8.3.4


From 002f7d5e1da83f0e0db8129ae05ebf805abec4fe Mon Sep 17 00:00:00 2001
From: "Arfonzo J. Coward" <art@poorcoding.com>
Date: Thu, 5 Dec 2013 08:00:47 +0000
Subject: Remove QUPZILLA_PREFIX definition. We set thisbuild time instead.


diff --git a/src/defines.pri b/src/defines.pri
index 7c33ba5..96093af 100644
--- a/src/defines.pri
+++ b/src/defines.pri
@@ -19,8 +19,6 @@ win32-msvc* {
     LIBS += User32.lib Ole32.lib Shell32.lib ShlWapi.lib Gdi32.lib ComCtl32.lib
 }
 
-#DEFINES *= QUPZILLA_PREFIX="`finddir B_USER_APPS_DIRECTORY`/QupZilla/"
-DEFINES *= QUPZILLA_PREFIX="/boot/home/config/apps/QupZilla/"
 DEFINES *= DISABLE_DBUS
 DEFINES *= NO_SYSTEM_DATAPATH
 DEFINES *= NO_X11
-- 
1.8.3.4

