From 746c6f8afe5dc9162ff4c62ebfe906e72c35b471 Mon Sep 17 00:00:00 2001 From: ffsup2 Date: Sun, 29 May 2011 19:12:15 +0200 Subject: [PATCH] Merge --- rtgui/cacheimagedata.cc | 2 +- rtgui/main.cc | 24 ++++++++++---------- rtgui/options.cc | 46 ++++++++++++++++++++------------------- rtgui/rtwindow.cc | 2 +- tools/osx/make-app-bundle | 4 ++++ 5 files changed, 42 insertions(+), 36 deletions(-) diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index 6bd273bf3..8329df89a 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -21,7 +21,7 @@ #include #include #include -#include "version.h" +#include CacheImageData::CacheImageData () : md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false), diff --git a/rtgui/main.cc b/rtgui/main.cc index 25874474a..f253f399f 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -64,25 +64,25 @@ int main(int argc, char **argv) Glib::ustring argv0_; #ifdef WIN32 - - WCHAR exnameU[512] = {0}; - char exname[512] = {0}; - GetModuleFileNameW (NULL, exnameU, 512); - WideCharToMultiByte(CP_UTF8,0,exnameU,-1,exname,512,0,0 ); + + WCHAR exnameU[512] = {0}; + char exname[512] = {0}; + GetModuleFileNameW (NULL, exnameU, 512); + WideCharToMultiByte(CP_UTF8,0,exnameU,-1,exname,512,0,0 ); argv0_ = exname; - - // get the path where the rawtherapee executable is stored - argv0 = Glib::path_get_dirname(argv0_); - + + // get the path where the rawtherapee executable is stored + argv0 = Glib::path_get_dirname(argv0_); + #else // get the path to data (defined in config.h which is generated by cmake) - argv0 = DATA_SEARCH_PATH; + argv0 = DATA_SEARCH_PATH; // check if path exists, otherwise revert back to behavior similar to windows try { Glib::Dir dir(DATA_SEARCH_PATH); } catch (Glib::FileError) { argv0_ = argv[0]; - argv0 = Glib::path_get_dirname(argv0_); + argv0 = Glib::path_get_dirname(argv0_); } #endif @@ -113,7 +113,7 @@ int main(int argc, char **argv) if (!options.useSystemTheme) { - std::vector rcfiles; + std::vector rcfiles; rcfiles.push_back (argv0+"/themes/"+options.theme); // Set the font face and size Gtk::RC::parse_string (Glib::ustring::compose( diff --git a/rtgui/options.cc b/rtgui/options.cc index 32460281b..b1f5a7f66 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -195,14 +195,12 @@ int Options::readFromFile (Glib::ustring fname) { if (keyFile.has_group ("General")) { if (keyFile.has_key ("General", "TabbedEditor")) tabbedUI= keyFile.get_boolean ("General", "TabbedEditor"); - if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "home") - startupDir = STARTUPDIR_HOME; - else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "current") - startupDir = STARTUPDIR_CURRENT; - else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "last") - startupDir = STARTUPDIR_LAST; - else - startupDir = STARTUPDIR_CUSTOM; + if (keyFile.has_key ("General", "StartupDirectory")){ + if( keyFile.get_string ("General", "StartupDirectory") == "home") startupDir = STARTUPDIR_HOME; + else if ( keyFile.get_string ("General", "StartupDirectory") == "current") startupDir = STARTUPDIR_CURRENT; + else if ( keyFile.get_string ("General", "StartupDirectory") == "last") startupDir = STARTUPDIR_LAST; + else if ( keyFile.get_string ("General", "StartupDirectory") == "custom") startupDir = STARTUPDIR_CUSTOM; + } if (keyFile.has_key ("General", "StartupPath")) startupPath = keyFile.get_string ("General", "StartupPath"); if (keyFile.has_key ("General", "DateFormat")) dateFormat = keyFile.get_string ("General", "DateFormat"); @@ -513,24 +511,28 @@ void Options::load () { * * Folder redirection is then fully supported on WinVista/7, but not on Win2000/XP */ + const gchar* dataPath; + Glib::ustring dPath; - WCHAR path[MAX_PATH]; + // ->ODUIS: How to make that commented out code work ? + + /*WCHAR path[MAX_PATH] = {0}; if (SHGetSpecialFolderPathW(NULL, path, CSIDL_LOCAL_APPDATA, false)) { - gchar* pathUTF8=g_utf16_to_utf8((const gunichar2*)path,-1,NULL,NULL,NULL); - rtdir = Glib::ustring(pathUTF8) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); - g_free(pathUTF8); + dPath = path; + printf("SHGetSpecialFolderPathW: \"%s\"\n", dPath.c_str()); } else { - // Should never fail, but old alternative way as backup - const gchar* dataPath = g_getenv("LOCALAPPDATA"); - if (dataPath != NULL) - rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); - else { - dataPath = g_getenv("USERPROFILE"); - if (dataPath != NULL) - rtdir = Glib::ustring(dataPath) + Glib::ustring("\\Local Settings\\Application Data\\") + Glib::ustring(CACHEFOLDERNAME); - } - } + printf("SHGetSpecialFolderPathW: Fail!\n"); + }*/ + + dataPath = g_getenv("LOCALAPPDATA"); + if (dataPath != NULL) + rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); + else { + dataPath = g_getenv("USERPROFILE"); + if (dataPath != NULL) + rtdir = Glib::ustring(dataPath) + Glib::ustring("\\Local Settings\\Application Data\\") + Glib::ustring(CACHEFOLDERNAME); + } #else rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME); #endif diff --git a/rtgui/rtwindow.cc b/rtgui/rtwindow.cc index d91b771f9..bd5a174f1 100644 --- a/rtgui/rtwindow.cc +++ b/rtgui/rtwindow.cc @@ -73,7 +73,7 @@ RTWindow::RTWindow () mainNB->set_scrollable (true); mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) ); - fpanel = Gtk::manage ( new FilePanel () ); + fpanel = new FilePanel () ; fpanel->setParent (this); // decorate tab diff --git a/tools/osx/make-app-bundle b/tools/osx/make-app-bundle index 55b193521..b4f09c701 100755 --- a/tools/osx/make-app-bundle +++ b/tools/osx/make-app-bundle @@ -49,6 +49,7 @@ if [ -d "${APP}" ]; then fi echo "Removing any old disk images..." rm ${RELEASE}/rawtherapee*.dmg +rm ${RELEASE}/rawtherapee*.dmg.zip echo "Making application directory structure..." mkdir -p "${RESOURCES}" @@ -99,4 +100,7 @@ rm -rf ${APP} cd ${RELEASE} zip ${DMG}.zip ${DMG} AboutThisBuild.txt +cd ${RELEASE} +zip ${DMG}.zip ${DMG} AboutThisBuild.txt + echo "All done!"