From c35393655f86677990348eeca36caf1680289329 Mon Sep 17 00:00:00 2001 From: Michel Mastriani Date: Sat, 14 Mar 2020 15:40:56 -0300 Subject: [PATCH] Mac adjustments --- Data/fractorium-sh | 23 +++++++++++++++++++++++ Source/Fractorium/Main.cpp | 16 ++++++++++++++++ archive/build.sh | 1 + 3 files changed, 40 insertions(+) create mode 100644 Data/fractorium-sh diff --git a/Data/fractorium-sh b/Data/fractorium-sh new file mode 100644 index 0000000..2d4b9c1 --- /dev/null +++ b/Data/fractorium-sh @@ -0,0 +1,23 @@ +#!/bin/bash + +CONFIG_PATH=~/.config/fractorium +DARK_MAC=~/.config/fractorium/dark_mac.qss +LIGHT_DARK=~/.config/fractorium/lightdark.qss +URANIUM=~/.config/fractorium/uranium.qss + +#./fractorium + +if [ ! -e "$DARK_LINUX" ] ; then + mkdir -p $CONFIG_PATH + cp dark_mac.qss $CONFIG_PATH +fi + +if [ ! -e "$LIGHT_DARK" ] ; then + mkdir -p $CONFIG_PATH + cp lightdark.qss $CONFIG_PATH +fi + +if [ ! -e "$URANIUM" ] ; then + mkdir -p $CONFIG_PATH + cp uranium.qss $CONFIG_PATH +fi diff --git a/Source/Fractorium/Main.cpp b/Source/Fractorium/Main.cpp index ae8b1e6..b5dc392 100644 --- a/Source/Fractorium/Main.cpp +++ b/Source/Fractorium/Main.cpp @@ -2,6 +2,18 @@ #include "Fractorium.h" #include +#ifdef __APPLE__ +/// +/// Export default user data to ./config/fractorium +/// +void ExportUserData() +{ + QProcess exec; + exec.setWorkingDirectory(QCoreApplication::applicationDirPath()); + exec.start("/bin/sh", QStringList() << "fractorium-sh"); +} +#endif + /// /// Main program entry point for Fractorium.exe. /// @@ -43,6 +55,10 @@ int main(int argc, char* argv[]) #endif Fractorium w; w.show(); +#ifdef __APPLE__ + // exporting user data + ExportUserData(); +#endif a.installEventFilter(&w); rv = a.exec(); } diff --git a/archive/build.sh b/archive/build.sh index 5989d3c..0c51862 100755 --- a/archive/build.sh +++ b/archive/build.sh @@ -54,6 +54,7 @@ cp uranium.qss $FRACTORIUM_FINAL_ROOT cp flam3-palettes.xml $FRACTORIUM_FINAL_ROOT cp *.gradient $FRACTORIUM_FINAL_ROOT cp *.ugr $FRACTORIUM_FINAL_ROOT +cp fractorium-sh $FRACTORIUM_FINAL_ROOT cp Info.plist $FRACTORIUM_FINAL_ROOT/../ cp -r Bench $FRACTORIUM_FINAL_ROOT cp -r examples $FRACTORIUM_FINAL_ROOT