From e3c67a66bf9c8259afbddf7e55387a40803b51bb Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 21 Nov 2020 23:13:49 +1000
Subject: Fix build for Haiku


diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5f9d506..e006ad3 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -146,7 +146,7 @@ message( "Build Adobe profiles creator : ${WITH_ADOBE_PROFILES}\n" )
 
 set( CMAKE_CXX_FLAGS "" )
 set( CMAKE_C_FLAGS "" )
-set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -fopenmp -std=gnu++0x" )
+set( CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -funroll-loops -std=gnu++0x" )
 set( CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} -std=gnu++0x" )
 set( CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -std=gnu++0x" )
 
-- 
2.28.0


From 47ef2716d446eb05899a03d654e749205033a4df Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 21 Nov 2020 23:14:43 +1000
Subject: Disable thumb worker


diff --git a/Sources/filemgmt/ptThumbGenWorker.cpp b/Sources/filemgmt/ptThumbGenWorker.cpp
index a774b1d..1119b15 100644
--- a/Sources/filemgmt/ptThumbGenWorker.cpp
+++ b/Sources/filemgmt/ptThumbGenWorker.cpp
@@ -149,6 +149,9 @@ TThumbPtr ptThumbGenWorker::generateThumb(const TThumbId& AThumbId) {
     const QString hFilePath = AThumbId.FilePath;
     hThumbnail.reset(new ptImage8);
 
+#ifdef __HAIKU__
+    hThumbnail->FromQImage(QImage(QString::fromUtf8(":/dark/icons/image-48px.png")));
+#else
     ptDcRaw     hDcRaw;
     MagickWand* hGMImage = NewMagickWand();
     QSize       hSize;
@@ -184,6 +187,7 @@ TThumbPtr ptThumbGenWorker::generateThumb(const TThumbId& AThumbId) {
     }
 
     DestroyMagickWand(hGMImage);
+#endif
     FThumbCache->insert(AThumbId, hThumbnail);
   }
 
diff --git a/qrc/photivo.qrc b/qrc/photivo.qrc
index 8f4557b..f395ae2 100644
--- a/qrc/photivo.qrc
+++ b/qrc/photivo.qrc
@@ -53,6 +53,7 @@
         <file>patterns/slider-stripe-midgrey.png</file>
         <file>photivo-appicon.png</file>
         <file>photivo-splash.png</file>
+        <file>dark/icons/image-48px.png</file>
         <file>dark/icons/folder-48px.png</file>
         <file>dark/icons/go-up-48px.png</file>
         <file>dark/icons/broken-image-48px.png</file>
-- 
2.28.0


From ce3e470a0be95c475329f2f3913268f103b02ca8 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 21 Nov 2020 23:15:28 +1000
Subject: Set username


diff --git a/Sources/ptMain.cpp b/Sources/ptMain.cpp
index fd40ba5..bae290a 100644
--- a/Sources/ptMain.cpp
+++ b/Sources/ptMain.cpp
@@ -526,6 +526,9 @@ int photivoMain(int Argc, char *Argv[]) {
   InitializeMagick(*Argv);
 
   //QApplication TheApplication(Argc,Argv);
+#ifdef Q_OS_HAIKU
+  QString     user = "Photivo_user";
+#else
   QStringList environment = QProcess::systemEnvironment();
   QString user=environment.filter(QRegExp("^USERNAME=|^USER=",Qt::CaseInsensitive)).first();
   if(!user.isEmpty()){
@@ -533,6 +536,7 @@ int photivoMain(int Argc, char *Argv[]) {
       user="_"+user.right(user.length()-l-1);
   }
   user="photivo"+user;
+#endif
 
 #ifdef Q_OS_MAC
   TheApplication = new MyQApplication(user, Argc,Argv);
-- 
2.28.0


From 287dfcfa4675c08ae9d68abe600dbcdf4b41c8e9 Mon Sep 17 00:00:00 2001
From: Gerasim Troeglazov <3dEyes@gmail.com>
Date: Sat, 21 Nov 2020 23:15:07 +1000
Subject: Disable preview panel by default


diff --git a/Sources/ptSettings.cpp b/Sources/ptSettings.cpp
index 592a76c..9e06823 100644
--- a/Sources/ptSettings.cpp
+++ b/Sources/ptSettings.cpp
@@ -362,7 +362,7 @@ ptSettings::ptSettings(const short InitLevel, const QString Path) {
     {"FileMgrIsOpen"                        ,9    ,0                                     ,0},
     {"LastFileMgrLocation"                  ,1    ,""                                    ,0},
     {"FileMgrShowDirThumbs"                 ,1    ,1                                     ,0},
-    {"FileMgrShowImageView"                 ,1    ,1                                     ,0},
+    {"FileMgrShowImageView"                 ,1    ,0                                     ,0},
     {"FileMgrShowSidebar"                   ,1    ,1                                     ,0},
     {"FileMgrThumbLayoutType"               ,1    ,tlVerticalByRow                       ,0},
     {"FileMgrShowRAWs"                      ,1    ,1                                     ,0},
-- 
2.28.0


