From a2eea7c2650f922cfb6a027ebd60d0e2a2040979 Mon Sep 17 00:00:00 2001 From: Adam Reichold Date: Sat, 26 Dec 2015 16:22:06 +0100 Subject: [PATCH] Finally fully remove the safegtk module. --- rtengine/CMakeLists.txt | 2 +- rtengine/camconst.cc | 3 +-- rtengine/clutstore.cc | 3 +-- rtengine/dcp.cc | 9 ++++---- rtengine/dfmanager.cc | 1 - rtengine/ffmanager.cc | 1 - rtengine/iccstore.cc | 27 ++++++++++++------------ rtengine/imagedata.cc | 9 ++++---- rtengine/imageio.cc | 7 +++---- rtengine/lcp.cc | 7 +++---- rtengine/myfile.cc | 4 ++-- rtengine/procparams.cc | 7 +++---- rtengine/rawimage.cc | 1 - rtengine/rtthumbnail.cc | 19 ++++++++--------- rtengine/safegtk.cc | 42 ------------------------------------- rtengine/safegtk.h | 11 ---------- rtexif/rtexif.cc | 8 ++++--- rtgui/batchqueue.cc | 3 +-- rtgui/batchqueuepanel.cc | 9 ++++---- rtgui/bayerpreprocess.cc | 1 - rtgui/bayerrawexposure.cc | 1 - rtgui/cacheimagedata.cc | 5 ++--- rtgui/curveeditorgroup.cc | 1 - rtgui/darkframe.cc | 3 +-- rtgui/dirbrowser.cc | 10 ++++----- rtgui/editorpanel.cc | 13 ++++++------ rtgui/filecatalog.cc | 15 +++++++------ rtgui/filepanel.cc | 10 ++++----- rtgui/filmsimulation.cc | 1 - rtgui/flatfield.cc | 3 +-- rtgui/guiutils.cc | 3 +-- rtgui/icmpanel.cc | 3 +-- rtgui/inspector.cc | 3 +-- rtgui/lensprofile.cc | 1 - rtgui/main.cc | 12 +++++------ rtgui/options.cc | 43 +++++++++++++++++++------------------- rtgui/popupcommon.cc | 1 - rtgui/preferences.cc | 9 ++++---- rtgui/preprocess.cc | 1 - rtgui/previewloader.cc | 3 +-- rtgui/profilepanel.cc | 1 - rtgui/profilestore.cc | 5 ++--- rtgui/rawcacorrection.cc | 1 - rtgui/rawexposure.cc | 1 - rtgui/saveasdlg.cc | 3 +-- rtgui/sharpenedge.cc | 1 - rtgui/sharpenmicro.cc | 1 - rtgui/soundman.h | 5 ++++- rtgui/splash.cc | 18 +++++++--------- rtgui/thumbnail.cc | 7 +++---- rtgui/xtransrawexposure.cc | 1 - 51 files changed, 132 insertions(+), 227 deletions(-) delete mode 100644 rtengine/safegtk.cc delete mode 100644 rtengine/safegtk.h diff --git a/rtengine/CMakeLists.txt b/rtengine/CMakeLists.txt index 682d6ff3f..597265bfe 100644 --- a/rtengine/CMakeLists.txt +++ b/rtengine/CMakeLists.txt @@ -7,7 +7,7 @@ link_directories ("${PROJECT_SOURCE_DIR}/rtexif" ${EXTRA_LIBDIR} ${GTHREAD_LIBRA set (CAMCONSTSFILE "camconst.json") -set (RTENGINESOURCEFILES safegtk.cc colortemp.cc curves.cc flatcurves.cc diagonalcurves.cc dcraw.cc iccstore.cc color.cc +set (RTENGINESOURCEFILES colortemp.cc curves.cc flatcurves.cc diagonalcurves.cc dcraw.cc iccstore.cc color.cc dfmanager.cc ffmanager.cc gauss.cc rawimage.cc image8.cc image16.cc imagefloat.cc imagedata.cc imageio.cc improcfun.cc init.cc dcrop.cc loadinitial.cc procparams.cc rawimagesource.cc demosaic_algos.cc shmap.cc simpleprocess.cc refreshmap.cc fast_demo.cc amaze_demosaic_RT.cc CA_correct_RT.cc cfa_linedn_RT.cc green_equil_RT.cc hilite_recon.cc expo_before_b.cc diff --git a/rtengine/camconst.cc b/rtengine/camconst.cc index e45a332e1..8290fe085 100644 --- a/rtengine/camconst.cc +++ b/rtengine/camconst.cc @@ -3,7 +3,6 @@ */ #include "camconst.h" #include "settings.h" -#include "safegtk.h" #include "rt_math.h" #include #include @@ -689,7 +688,7 @@ void CameraConstantsStore::init(Glib::ustring baseDir, Glib::ustring userSetting Glib::ustring userFile(Glib::build_filename(userSettingsDir, "camconst.json")); - if (safe_file_test(userFile, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(userFile, Glib::FILE_TEST_EXISTS)) { parse_camera_constants_file(userFile); } } diff --git a/rtengine/clutstore.cc b/rtengine/clutstore.cc index b36fd7dfb..a0ea5afb4 100644 --- a/rtengine/clutstore.cc +++ b/rtengine/clutstore.cc @@ -1,7 +1,6 @@ #include "clutstore.h" #include "rt_math.h" #include "stdimagesource.h" -#include "safegtk.h" #include "../rtgui/options.h" rtengine::CLUTStore clutStore; @@ -154,7 +153,7 @@ Imagefloat* HaldCLUT::loadFile( Glib::ustring filename, Glib::ustring workingCol Imagefloat *result = 0; StdImageSource imgSrc; - if ( !safe_file_test( filename, Glib::FILE_TEST_EXISTS ) || imgSrc.load(filename) ) { + if ( !Glib::file_test( filename, Glib::FILE_TEST_EXISTS ) || imgSrc.load(filename) ) { return result; } diff --git a/rtengine/dcp.cc b/rtengine/dcp.cc index 9dd01330b..c05230738 100644 --- a/rtengine/dcp.cc +++ b/rtengine/dcp.cc @@ -19,7 +19,6 @@ #include #include "dcp.h" -#include "safegtk.h" #include "iccmatrices.h" #include "iccstore.h" #include "rawimagesource.h" @@ -828,7 +827,7 @@ DCPProfile::DCPProfile(Glib::ustring fname) aDeltas1 = aDeltas2 = aLookTable = NULL; - FILE *pFile = safe_g_fopen(fname, "rb"); + FILE *pFile = g_fopen(fname.c_str (), "rb"); TagDirectory *tagDir = ExifManager::parseTIFF(pFile, false); @@ -1717,7 +1716,7 @@ void DCPStore::init (Glib::ustring rtProfileDir) Glib::Dir* dir = NULL; try { - if (!safe_file_test (dirname, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (dirname, Glib::FILE_TEST_IS_DIR)) { return; } @@ -1733,7 +1732,7 @@ void DCPStore::init (Glib::ustring rtProfileDir) Glib::ustring sname = *i; // ignore directories - if (!safe_file_test (fname, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (fname, Glib::FILE_TEST_IS_DIR)) { size_t lastdot = sname.find_last_of ('.'); if (lastdot != Glib::ustring::npos && lastdot <= sname.size() - 4 && (!sname.casefold().compare (lastdot, 4, ".dcp"))) { @@ -1781,7 +1780,7 @@ DCPProfile* DCPStore::getStdProfile(Glib::ustring camShortName) bool DCPStore::isValidDCPFileName(Glib::ustring filename) const { - if (!safe_file_test (filename, Glib::FILE_TEST_EXISTS) || safe_file_test (filename, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (filename, Glib::FILE_TEST_EXISTS) || Glib::file_test (filename, Glib::FILE_TEST_IS_DIR)) { return false; } diff --git a/rtengine/dfmanager.cc b/rtengine/dfmanager.cc index 2beab3c97..032008d2f 100644 --- a/rtengine/dfmanager.cc +++ b/rtengine/dfmanager.cc @@ -20,7 +20,6 @@ #include "../rtgui/options.h" #include #include "../rtgui/guiutils.h" -#include "safegtk.h" #include "rawimage.h" #include #include diff --git a/rtengine/ffmanager.cc b/rtengine/ffmanager.cc index 6810465c6..04da44048 100644 --- a/rtengine/ffmanager.cc +++ b/rtengine/ffmanager.cc @@ -19,7 +19,6 @@ #include "ffmanager.h" #include "../rtgui/options.h" #include -#include "safegtk.h" #include "rawimage.h" #include #include diff --git a/rtengine/iccstore.cc b/rtengine/iccstore.cc index ff29c72ab..cb5314489 100644 --- a/rtengine/iccstore.cc +++ b/rtengine/iccstore.cc @@ -16,18 +16,21 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ +#include "iccstore.h" + +#include + #ifdef WIN32 #include #else #include #endif -#include "iccstore.h" -#include "iccmatrices.h" -#include -#include "safegtk.h" -#include "../rtgui/options.h" -#include +#include + +#include "iccmatrices.h" + +#include "../rtgui/options.h" namespace { @@ -59,7 +62,7 @@ void loadProfiles (const Glib::ustring& dirName, const Glib::ustring filePath = Glib::build_filename (dirName, fileName); - if (!safe_file_test (filePath, Glib::FILE_TEST_IS_REGULAR)) + if (!Glib::file_test (filePath, Glib::FILE_TEST_IS_REGULAR)) continue; Glib::ustring name = fileName.substr (0, fileName.size() - 4); @@ -356,8 +359,9 @@ cmsHPROFILE ICCStore::getProfile (const Glib::ustring& name) const const ProfileMap::const_iterator r = fileProfiles.find (name); - if (r != fileProfiles.end ()) + if (r != fileProfiles.end ()) { return r->second; + } if (name.compare (0, 5, "file:") == 0) { const ProfileContent content (name.substr (5)); @@ -371,7 +375,7 @@ cmsHPROFILE ICCStore::getProfile (const Glib::ustring& name) const } } - return NULL; + return nullptr; } cmsHPROFILE ICCStore::getStdProfile (const Glib::ustring& name) const @@ -418,7 +422,6 @@ ProfileContent ICCStore::getContent (const Glib::ustring& name) const std::uint8_t ICCStore::getInputIntents (cmsHPROFILE profile) const { - MyMutex::MyLock lock (mutex_); return getSupportedIntents (profile, LCMS_USED_AS_INPUT); @@ -426,7 +429,6 @@ std::uint8_t ICCStore::getInputIntents (cmsHPROFILE profile) const std::uint8_t ICCStore::getOutputIntents (cmsHPROFILE profile) const { - MyMutex::MyLock lock (mutex_); return getSupportedIntents (profile, LCMS_USED_AS_OUTPUT); @@ -434,7 +436,6 @@ std::uint8_t ICCStore::getOutputIntents (cmsHPROFILE profile) const std::uint8_t ICCStore::getProofIntents (cmsHPROFILE profile) const { - MyMutex::MyLock lock (mutex_); return getSupportedIntents (profile, LCMS_USED_AS_PROOF); @@ -503,7 +504,7 @@ void ICCStore::findDefaultMonitorProfile () ProfileContent::ProfileContent (const Glib::ustring& fileName) : data(NULL), length(0) { - FILE* f = safe_g_fopen (fileName, "rb"); + FILE* f = g_fopen (fileName.c_str (), "rb"); if (!f) { return; diff --git a/rtengine/imagedata.cc b/rtengine/imagedata.cc index a506c95fa..9b651a5f0 100644 --- a/rtengine/imagedata.cc +++ b/rtengine/imagedata.cc @@ -19,7 +19,6 @@ #include "imagedata.h" #include "iptcpairs.h" #include -#include "safegtk.h" using namespace rtengine; @@ -53,7 +52,7 @@ ImageData::ImageData (Glib::ustring fname, RawMetaDataLocation* ri) iptc = NULL; if (ri && (ri->exifBase >= 0 || ri->ciffBase >= 0)) { - FILE* f = safe_g_fopen (fname, "rb"); + FILE* f = g_fopen (fname.c_str (), "rb"); if (f) { if (ri->exifBase >= 0) { @@ -74,18 +73,18 @@ ImageData::ImageData (Glib::ustring fname, RawMetaDataLocation* ri) extractInfo (); } } else if ((dotpos < fname.size() - 3 && !fname.casefold().compare (dotpos, 4, ".jpg")) || (dotpos < fname.size() - 4 && !fname.casefold().compare (dotpos, 5, ".jpeg"))) { - FILE* f = safe_g_fopen (fname, "rb"); + FILE* f = g_fopen (fname.c_str (), "rb"); if (f) { root = rtexif::ExifManager::parseJPEG (f); extractInfo (); fclose (f); - FILE* ff = safe_g_fopen (fname, "rb"); + FILE* ff = g_fopen (fname.c_str (), "rb"); iptc = iptc_data_new_from_jpeg_file (ff); fclose (ff); } } else if ((dotpos < fname.size() - 3 && !fname.casefold().compare (dotpos, 4, ".tif")) || (dotpos < fname.size() - 4 && !fname.casefold().compare (dotpos, 5, ".tiff"))) { - FILE* f = safe_g_fopen (fname, "rb"); + FILE* f = g_fopen (fname.c_str (), "rb"); if (f) { root = rtexif::ExifManager::parseTIFF (f); diff --git a/rtengine/imageio.cc b/rtengine/imageio.cc index 3e5c04d87..4fa5a5a93 100644 --- a/rtengine/imageio.cc +++ b/rtengine/imageio.cc @@ -36,7 +36,6 @@ #endif #include "imageio.h" -#include "safegtk.h" #include "iptcpairs.h" #include "iccjpeg.h" #include "color.h" @@ -208,7 +207,7 @@ void png_flush(png_struct_def *png_ptr); int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, IIOSampleArrangement &sArrangement) { - FILE *file = safe_g_fopen (fname, "rb"); + FILE *file = g_fopen (fname.c_str (), "rb"); if (!file) { return IMIO_CANNOTREADFILE; @@ -282,7 +281,7 @@ int ImageIO::getPNGSampleFormat (Glib::ustring fname, IIOSampleFormat &sFormat, int ImageIO::loadPNG (Glib::ustring fname) { - FILE *file = safe_g_fopen (fname, "rb"); + FILE *file = g_fopen (fname.c_str (), "rb"); if (!file) { return IMIO_CANNOTREADFILE; @@ -531,7 +530,7 @@ int ImageIO::loadJPEGFromMemory (const char* buffer, int bufsize) int ImageIO::loadJPEG (Glib::ustring fname) { - FILE *file = safe_g_fopen(fname, "rb"); + FILE *file = g_fopen(fname.c_str (), "rb"); if (!file) { return IMIO_CANNOTREADFILE; diff --git a/rtengine/lcp.cc b/rtengine/lcp.cc index 903e54a0a..1ed601301 100644 --- a/rtengine/lcp.cc +++ b/rtengine/lcp.cc @@ -19,7 +19,6 @@ #include #include "lcp.h" -#include "safegtk.h" #include "iccmatrices.h" #include "iccstore.h" #include "rawimagesource.h" @@ -303,7 +302,7 @@ LCPProfile::LCPProfile(Glib::ustring fname) persModelCount = 0; *inInvalidTag = 0; - FILE *pFile = safe_g_fopen(fname, "rb"); + FILE *pFile = g_fopen(fname.c_str (), "rb"); bool done; @@ -807,7 +806,7 @@ LCPProfile* LCPStore::getProfile (Glib::ustring filename) bool LCPStore::isValidLCPFileName(Glib::ustring filename) const { - if (!safe_file_test (filename, Glib::FILE_TEST_EXISTS) || safe_file_test (filename, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (filename, Glib::FILE_TEST_EXISTS) || Glib::file_test (filename, Glib::FILE_TEST_IS_DIR)) { return false; } @@ -828,7 +827,7 @@ Glib::ustring LCPStore::getDefaultCommonDirectory() const WideCharToMultiByte(CP_UTF8, 0, pathW, -1, pathA, MAX_PATH, 0, 0); Glib::ustring fullDir = Glib::ustring(pathA) + Glib::ustring("\\Adobe\\CameraRaw\\LensProfiles\\1.0"); - if (safe_file_test(fullDir, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (fullDir, Glib::FILE_TEST_IS_DIR)) { dir = fullDir; } } diff --git a/rtengine/myfile.cc b/rtengine/myfile.cc index 729466f79..bcc2a7db7 100644 --- a/rtengine/myfile.cc +++ b/rtengine/myfile.cc @@ -19,7 +19,6 @@ #include "myfile.h" #include #include -#include "safegtk.h" #ifdef BZIP_SUPPORT #include #endif @@ -58,6 +57,7 @@ int munmap(void *start, size_t length) #else // WIN32 +#include #include #include @@ -96,7 +96,7 @@ IMFILE* fopen (const char* fname) if ( fstat(fd, &stat_buffer) < 0 ) { printf("no stat\n"); - close(fd); + close (fd); return 0; } diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index f79f51c91..91922e5e7 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -16,10 +16,9 @@ * You should have received a copy of the GNU General Public License * along with RawTherapee. If not, see . */ -//#include +#include #include "procparams.h" #include "rt_math.h" -#include "safegtk.h" #include "safekeyfile.h" #include "dcp.h" #include "../rtgui/multilangmgr.h" @@ -3385,7 +3384,7 @@ int ProcParams::write (Glib::ustring &fname, Glib::ustring &content) const if (fname.length()) { FILE *f; - f = safe_g_fopen (fname, "wt"); + f = g_fopen (fname.c_str (), "wt"); if (f == NULL) { error = 1; @@ -3414,7 +3413,7 @@ int ProcParams::load (Glib::ustring fname, ParamsEdited* pedited) pedited->set(false); } - FILE* f = safe_g_fopen (fname, "rt"); + FILE* f = g_fopen (fname.c_str (), "rt"); if (!f) { return 1; diff --git a/rtengine/rawimage.cc b/rtengine/rawimage.cc index 040d0276b..3f4b2ac3f 100644 --- a/rtengine/rawimage.cc +++ b/rtengine/rawimage.cc @@ -13,7 +13,6 @@ #else #include #endif -#include "safegtk.h" namespace rtengine { diff --git a/rtengine/rtthumbnail.cc b/rtengine/rtthumbnail.cc index 1f81012ad..739ea9555 100644 --- a/rtengine/rtthumbnail.cc +++ b/rtengine/rtthumbnail.cc @@ -34,7 +34,6 @@ #include #include #include "safekeyfile.h" -#include "safegtk.h" #include "rawimage.h" #include "jpeg.h" #include "../rtgui/ppversion.h" @@ -1653,7 +1652,7 @@ bool Thumbnail::writeImage (const Glib::ustring& fname, int format) Glib::ustring fullFName = fname + ".rtti"; - FILE* f = safe_g_fopen (fullFName, "wb"); + FILE* f = g_fopen (fullFName.c_str (), "wb"); if (!f) { return false; @@ -1692,11 +1691,11 @@ bool Thumbnail::readImage (const Glib::ustring& fname) Glib::ustring fullFName = fname + ".rtti"; - if (!safe_file_test (fullFName, Glib::FILE_TEST_EXISTS)) { + if (!Glib::file_test (fullFName, Glib::FILE_TEST_EXISTS)) { return false; } - FILE* f = safe_g_fopen (fullFName, "rb"); + FILE* f = g_fopen (fullFName.c_str (), "rb"); if (!f) { return false; @@ -1837,7 +1836,7 @@ bool Thumbnail::writeData (const Glib::ustring& fname) MyMutex::MyLock thmbLock(thumbMutex); try { - if( safe_file_test(fname, Glib::FILE_TEST_EXISTS) ) { + if( Glib::file_test(fname, Glib::FILE_TEST_EXISTS) ) { keyFile.load_from_file (fname); } } catch (Glib::Error &err) { @@ -1867,7 +1866,7 @@ bool Thumbnail::writeData (const Glib::ustring& fname) Glib::ArrayHandle cm ((double*)colorMatrix, 9, Glib::OWNERSHIP_NONE); keyFile.set_double_list ("LiveThumbData", "ColorMatrix", cm); - FILE *f = safe_g_fopen (fname, "wt"); + FILE *f = g_fopen (fname.c_str (), "wt"); if (!f) { if (options.rtSettings.verbose) { @@ -1886,7 +1885,7 @@ bool Thumbnail::writeData (const Glib::ustring& fname) bool Thumbnail::readEmbProfile (const Glib::ustring& fname) { - FILE* f = safe_g_fopen (fname, "rb"); + FILE* f = g_fopen (fname.c_str (), "rb"); if (!f) { embProfileData = NULL; @@ -1910,7 +1909,7 @@ bool Thumbnail::writeEmbProfile (const Glib::ustring& fname) { if (embProfileData) { - FILE* f = safe_g_fopen(fname, "wb"); + FILE* f = g_fopen(fname.c_str (), "wb"); if (f) { fwrite (embProfileData, 1, embProfileLength, f); @@ -1925,7 +1924,7 @@ bool Thumbnail::writeEmbProfile (const Glib::ustring& fname) bool Thumbnail::readAEHistogram (const Glib::ustring& fname) { - FILE* f = safe_g_fopen (fname, "rb"); + FILE* f = g_fopen (fname.c_str (), "rb"); if (!f) { aeHistogram(0); @@ -1943,7 +1942,7 @@ bool Thumbnail::writeAEHistogram (const Glib::ustring& fname) { if (aeHistogram) { - FILE* f = safe_g_fopen (fname, "wb"); + FILE* f = g_fopen (fname.c_str (), "wb"); if (f) { fwrite (&aeHistogram[0], 1, (65536 >> aeHistCompression)*sizeof(aeHistogram[0]), f); diff --git a/rtengine/safegtk.cc b/rtengine/safegtk.cc deleted file mode 100644 index b504420a7..000000000 --- a/rtengine/safegtk.cc +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of RawTherapee. - * - * Copyright (c) 2004-2010 Gabor Horvath - * Copyright (c) 2010 Sasha Vasko - * Copyright (c) 2010 Oliver Duis - * - * RawTherapee is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * RawTherapee is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with RawTherapee. If not, see . - */ - -#include "safegtk.h" - -#include -#include -#include - -#include - -#ifdef WIN32 -#include -#endif - -FILE * safe_g_fopen(const Glib::ustring& src, const gchar *mode) -{ - return g_fopen(src.c_str(), mode); -} - -bool safe_file_test (const Glib::ustring& filename, Glib::FileTest test) -{ - return Glib::file_test (filename, test); -} diff --git a/rtengine/safegtk.h b/rtengine/safegtk.h deleted file mode 100644 index 8b3136e86..000000000 --- a/rtengine/safegtk.h +++ /dev/null @@ -1,11 +0,0 @@ -#ifndef SAFE_GTK_H_INCLUDED -#define SAFE_GTK_H_INCLUDED - -#include -#include -#include - -FILE * safe_g_fopen(const Glib::ustring& src, const gchar *mode); -bool safe_file_test (const Glib::ustring& filename, Glib::FileTest test); - -#endif diff --git a/rtexif/rtexif.cc b/rtexif/rtexif.cc index be442945d..af6d6ab5c 100644 --- a/rtexif/rtexif.cc +++ b/rtexif/rtexif.cc @@ -25,9 +25,11 @@ #include #include -#include "../rtgui/cacheimagedata.h" +#include + #include "rtexif.h" -#include "../rtengine/safegtk.h" + +#include "../rtgui/cacheimagedata.h" #include "../rtgui/version.h" #include "../rtgui/ppversion.h" @@ -274,7 +276,7 @@ bool TagDirectory::CPBDump (const Glib::ustring &commFName, const Glib::ustring if (!keyFile) { // open the file in write mode - f = safe_g_fopen (commFName, "wt"); + f = g_fopen (commFName.c_str (), "wt"); if (f == NULL) { printf("TagDirectory::keyFileDump(\"%s\") >>> Error: unable to open file with write access!\n", commFName.c_str()); diff --git a/rtgui/batchqueue.cc b/rtgui/batchqueue.cc index 6c9b791e2..64b4662e0 100644 --- a/rtgui/batchqueue.cc +++ b/rtgui/batchqueue.cc @@ -33,7 +33,6 @@ #include "filecatalog.h" #include "batchqueuebuttonset.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" using namespace std; @@ -861,7 +860,7 @@ Glib::ustring BatchQueue::autoCompleteFileName (const Glib::ustring& fileName, c fname = Glib::ustring::compose ("%1-%2.%3", Glib::build_filename (dstdir, dstfname), tries, format); } - int fileExists = safe_file_test (fname, Glib::FILE_TEST_EXISTS); + int fileExists = Glib::file_test (fname, Glib::FILE_TEST_EXISTS); if (inOverwriteMode && fileExists) { if (::g_remove (fname.c_str ()) != 0) { diff --git a/rtgui/batchqueuepanel.cc b/rtgui/batchqueuepanel.cc index e4400d449..1f9a36280 100644 --- a/rtgui/batchqueuepanel.cc +++ b/rtgui/batchqueuepanel.cc @@ -22,7 +22,6 @@ #include "multilangmgr.h" #include "rtwindow.h" #include "soundman.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" struct BQProcessLoaded { @@ -39,7 +38,7 @@ int processLoadedBatchQueueUIThread (void* data) static Glib::ustring makeFolderLabel(Glib::ustring path) { - if (!safe_file_test (path, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) { return "(" + M("GENERAL_NONE") + ")"; } @@ -115,7 +114,7 @@ BatchQueuePanel::BatchQueuePanel (FileCatalog* aFileCatalog) outdirFolder->signal_current_folder_changed().connect (sigc::mem_fun(*this, &BatchQueuePanel::pathFolderChanged)); outdirFolder->set_tooltip_markup (M("PREFERENCES_OUTDIRFOLDERHINT")); - if (safe_file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (options.savePathFolder, Glib::FILE_TEST_IS_DIR)) { outdirFolder->set_current_folder (options.savePathFolder); } @@ -333,8 +332,8 @@ void BatchQueuePanel::pathFolderButtonPressed () int result = fc.run(); if (result == Gtk::RESPONSE_OK) { - if (safe_file_test(fc.get_filename(), Glib::FILE_TEST_IS_DIR)) { - options.savePathFolder = fc.get_filename(); + if (Glib::file_test(fc.get_current_folder(), Glib::FILE_TEST_IS_DIR)) { + options.savePathFolder = fc.get_filename (); outdirFolderButton->set_label(makeFolderLabel(options.savePathFolder)); } } diff --git a/rtgui/bayerpreprocess.cc b/rtgui/bayerpreprocess.cc index cce51cca3..51a0cb62a 100644 --- a/rtgui/bayerpreprocess.cc +++ b/rtgui/bayerpreprocess.cc @@ -18,7 +18,6 @@ */ #include "bayerpreprocess.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include using namespace rtengine; diff --git a/rtgui/bayerrawexposure.cc b/rtgui/bayerrawexposure.cc index ca376eb64..ee9b4fc4d 100644 --- a/rtgui/bayerrawexposure.cc +++ b/rtgui/bayerrawexposure.cc @@ -18,7 +18,6 @@ */ #include "bayerrawexposure.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include using namespace rtengine; diff --git a/rtgui/cacheimagedata.cc b/rtgui/cacheimagedata.cc index 4b276a03b..c1d23dc11 100644 --- a/rtgui/cacheimagedata.cc +++ b/rtgui/cacheimagedata.cc @@ -20,7 +20,6 @@ #include #include #include "../rtengine/safekeyfile.h" -#include "../rtengine/safegtk.h" #include "version.h" #include @@ -197,7 +196,7 @@ int CacheImageData::save (const Glib::ustring& fname) rtengine::SafeKeyFile keyFile; - if (safe_file_test(fname, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) { try { keyFile.load_from_file (fname); } catch (Glib::Error &err) { @@ -257,7 +256,7 @@ int CacheImageData::save (const Glib::ustring& fname) keyFile.set_integer ("ExtraRawInfo", "ThumbImageOffset", thumbOffset); } - FILE *f = safe_g_fopen (fname, "wt"); + FILE *f = g_fopen (fname.c_str (), "wt"); if (!f) { if (options.rtSettings.verbose) { diff --git a/rtgui/curveeditorgroup.cc b/rtgui/curveeditorgroup.cc index d524e0c4d..ea97b4e9e 100644 --- a/rtgui/curveeditorgroup.cc +++ b/rtgui/curveeditorgroup.cc @@ -24,7 +24,6 @@ #include "diagonalcurveeditorsubgroup.h" #include "flatcurveeditorsubgroup.h" #include "multilangmgr.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" CurveEditorGroup::CurveEditorGroup (Glib::ustring& curveDir, Glib::ustring groupLabel) : curveDir(curveDir), curve_reset(NULL), diff --git a/rtgui/darkframe.cc b/rtgui/darkframe.cc index 9edde1bbc..1e01b4b95 100644 --- a/rtgui/darkframe.cc +++ b/rtgui/darkframe.cc @@ -19,7 +19,6 @@ #include "darkframe.h" #include "options.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include #include "rtimage.h" @@ -81,7 +80,7 @@ void DarkFrame::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi dfAuto->set_inconsistent(!pedited->raw.dfAuto ); } - if (safe_file_test (pp->raw.dark_frame, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (pp->raw.dark_frame, Glib::FILE_TEST_EXISTS)) { darkFrameFile->set_filename (pp->raw.dark_frame); } else { darkFrameReset(); diff --git a/rtgui/dirbrowser.cc b/rtgui/dirbrowser.cc index f9fe48d04..040985e16 100644 --- a/rtgui/dirbrowser.cc +++ b/rtgui/dirbrowser.cc @@ -25,8 +25,6 @@ #include #endif -#include "../rtengine/safegtk.h" - #include "guiutils.h" #include "rtimage.h" #include "multilangmgr.h" @@ -336,8 +334,8 @@ void DirBrowser::updateDir (const Gtk::TreeModel::iterator& iter) change = false; for (Gtk::TreeModel::iterator it = iter->children().begin(); it != iter->children().end(); it++) - if (!safe_file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_EXISTS) - || !safe_file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_EXISTS) + || !Glib::file_test (it->get_value (dtColumns.dirname), Glib::FILE_TEST_IS_DIR)) { GThreadLock lock; dirTreeModel->erase (it); change = true; @@ -381,7 +379,7 @@ void DirBrowser::row_activated (const Gtk::TreeModel::Path& path, Gtk::TreeViewC Glib::ustring dname = dirTreeModel->get_iter (path)->get_value (dtColumns.dirname); - if (safe_file_test (dname, Glib::FILE_TEST_IS_DIR)) + if (Glib::file_test (dname, Glib::FILE_TEST_IS_DIR)) dirSelectionSignal (dname, Glib::ustring()); } @@ -478,7 +476,7 @@ void DirBrowser::open (const Glib::ustring& dirname, const Glib::ustring& fileNa void DirBrowser::file_changed (const Glib::RefPtr& file, const Glib::RefPtr& other_file, Gio::FileMonitorEvent event_type, const Gtk::TreeModel::iterator& iter, const Glib::ustring& dirName) { - if (!file || !safe_file_test (dirName, Glib::FILE_TEST_IS_DIR) || event_type == Gio::FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED) { + if (!file || !Glib::file_test (dirName, Glib::FILE_TEST_IS_DIR) || event_type == Gio::FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED) { return; } diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 2a699edc6..80dc3dfae 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -21,7 +21,6 @@ #include -#include "../rtengine/safegtk.h" #include "../rtengine/imagesource.h" #include "../rtengine/iccstore.h" #include "soundman.h" @@ -492,7 +491,7 @@ EditorPanel::EditorPanel (FilePanel* filePanel) show_all (); /* // save as dialog - if (safe_file_test (options.lastSaveAsPath, Glib::FILE_TEST_IS_DIR)) + if (Glib::file_test (options.lastSaveAsPath, Glib::FILE_TEST_IS_DIR)) saveAsDialog = new SaveAsDialog (options.lastSaveAsPath); else saveAsDialog = new SaveAsDialog (safe_get_user_picture_dir()); @@ -789,7 +788,7 @@ void EditorPanel::close () navigator->previewWindow->setPreviewHandler (NULL); // If the file was deleted somewhere, the openThm.descreaseRef delete the object, but we don't know here - if (safe_file_test(fname, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) { openThm->removeThumbnailListener (this); openThm->decreaseRef (); } @@ -803,7 +802,7 @@ void EditorPanel::saveProfile () } // If the file was deleted, do not generate ghost entries - if (safe_file_test(fname, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) { ProcParams params; ipc->getParams (¶ms); @@ -1543,7 +1542,7 @@ void EditorPanel::saveAsPressed () SaveAsDialog* saveAsDialog; - if (safe_file_test (options.lastSaveAsPath, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (options.lastSaveAsPath, Glib::FILE_TEST_IS_DIR)) { saveAsDialog = new SaveAsDialog (options.lastSaveAsPath); } else { saveAsDialog = new SaveAsDialog (PlacesBrowser::userPicturesDir ()); @@ -1590,7 +1589,7 @@ void EditorPanel::saveAsPressed () fnameTemp = Glib::ustring::compose ("%1-%2.%3", Glib::build_filename (dstdir, dstfname), tries, dstext); } - if (!safe_file_test (fnameTemp, Glib::FILE_TEST_EXISTS)) { + if (!Glib::file_test (fnameTemp, Glib::FILE_TEST_EXISTS)) { fnameOut = fnameTemp; fnameOK = true; break; @@ -1703,7 +1702,7 @@ bool EditorPanel::idle_sendToGimp( ProgressConnector *pc, G int tries = 1; - while (safe_file_test (fileName, Glib::FILE_TEST_EXISTS) && tries < 1000) { + while (Glib::file_test (fileName, Glib::FILE_TEST_EXISTS) && tries < 1000) { fileName = Glib::ustring::compose("%1-%2.%3", fname, tries, sf.format); tries++; } diff --git a/rtgui/filecatalog.cc b/rtgui/filecatalog.cc index 10ecdaaf7..eafef775a 100644 --- a/rtgui/filecatalog.cc +++ b/rtgui/filecatalog.cc @@ -25,7 +25,6 @@ #include #include "../rtengine/rt_math.h" -#include "../rtengine/safegtk.h" #include "guiutils.h" #include "options.h" @@ -1026,7 +1025,7 @@ void FileCatalog::copyMoveRequested (std::vector tbe, bool m while(!filecopymovecomplete) { // check for filename conflicts at destination - prevent overwriting (actually RT will crash on overwriting attempt) - if (!safe_file_test(dest_fPath, Glib::FILE_TEST_EXISTS) && !safe_file_test(dest_fPath_param, Glib::FILE_TEST_EXISTS)) { + if (!Glib::file_test(dest_fPath, Glib::FILE_TEST_EXISTS) && !Glib::file_test(dest_fPath_param, Glib::FILE_TEST_EXISTS)) { // copy/move file to destination Glib::RefPtr dest_file = Gio::File::create_for_path ( dest_fPath ); @@ -1047,12 +1046,12 @@ void FileCatalog::copyMoveRequested (std::vector tbe, bool m // attempt to copy/move paramFile only if it exist next to the src Glib::RefPtr scr_param = Gio::File::create_for_path ( src_fPath + paramFileExtension ); - if (safe_file_test( src_fPath + paramFileExtension, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test( src_fPath + paramFileExtension, Glib::FILE_TEST_EXISTS)) { Glib::RefPtr dest_param = Gio::File::create_for_path ( dest_fPath_param); // copy/move paramFile to destination if (moveRequested) { - if (safe_file_test( dest_fPath + paramFileExtension, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test( dest_fPath + paramFileExtension, Glib::FILE_TEST_EXISTS)) { // profile already got copied to destination from cache after cacheMgr->renameEntry // delete source profile as cleanup ::g_remove ((src_fPath + paramFileExtension).c_str ()); @@ -1257,7 +1256,7 @@ void FileCatalog::renameRequested (std::vector tbe) Glib::ustring nfname = Glib::build_filename (dirName, nBaseName); /* check if filename already exists*/ - if (safe_file_test (nfname, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (nfname, Glib::FILE_TEST_EXISTS)) { Glib::ustring msg_ = Glib::ustring("") + nfname + ": " + M("MAIN_MSG_ALREADYEXISTS") + ""; Gtk::MessageDialog msgd (msg_, true, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true); msgd.run (); @@ -1703,7 +1702,7 @@ void FileCatalog::reparseDirectory () return; } - if (!safe_file_test (selectedDirectory, Glib::FILE_TEST_IS_DIR)) { + if (!Glib::file_test (selectedDirectory, Glib::FILE_TEST_IS_DIR)) { closeDir (); return; } @@ -1715,7 +1714,7 @@ void FileCatalog::reparseDirectory () std::vector fileNamesToDel; for (size_t i = 0; i < t.size(); i++) - if (!safe_file_test (t[i]->filename, Glib::FILE_TEST_EXISTS)) { + if (!Glib::file_test (t[i]->filename, Glib::FILE_TEST_EXISTS)) { fileNamesToDel.push_back (t[i]->filename); } @@ -2049,7 +2048,7 @@ void FileCatalog::buttonBrowsePathPressed () // handle shortcuts in the BrowsePath -- END // validate the path - if (safe_file_test(BrowsePathValue, Glib::FILE_TEST_IS_DIR) && selectDir) { + if (Glib::file_test(BrowsePathValue, Glib::FILE_TEST_IS_DIR) && selectDir) { selectDir (BrowsePathValue); } else // error, likely path not found: show red arrow diff --git a/rtgui/filepanel.cc b/rtgui/filepanel.cc index f13c3f451..fd53db555 100644 --- a/rtgui/filepanel.cc +++ b/rtgui/filepanel.cc @@ -18,8 +18,6 @@ */ #include "filepanel.h" -#include "../rtengine/safegtk.h" - #include "rtwindow.h" #include "inspector.h" #include "placesbrowser.h" @@ -179,7 +177,7 @@ void FilePanel::init () dirBrowser->fillDirTree (); placesBrowser->refreshPlacesList (); - if (argv1 != "" && safe_file_test (argv1, Glib::FILE_TEST_IS_DIR)) { + if (argv1 != "" && Glib::file_test (argv1, Glib::FILE_TEST_IS_DIR)) { dirBrowser->open (argv1); } else { if (options.startupDir == STARTUPDIR_HOME) { @@ -187,7 +185,7 @@ void FilePanel::init () } else if (options.startupDir == STARTUPDIR_CURRENT) { dirBrowser->open (argv0); } else if (options.startupDir == STARTUPDIR_CUSTOM || options.startupDir == STARTUPDIR_LAST) { - if (options.startupPath.length() && safe_file_test(options.startupPath, Glib::FILE_TEST_EXISTS) && safe_file_test(options.startupPath, Glib::FILE_TEST_IS_DIR)) { + if (options.startupPath.length() && Glib::file_test(options.startupPath, Glib::FILE_TEST_EXISTS) && Glib::file_test(options.startupPath, Glib::FILE_TEST_IS_DIR)) { dirBrowser->open (options.startupPath); } else { // Fallback option if the path is empty or the folder doesn't exist @@ -324,9 +322,9 @@ void FilePanel::saveOptions () void FilePanel::open (const Glib::ustring& d) { - if (safe_file_test (d, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (d, Glib::FILE_TEST_IS_DIR)) { dirBrowser->open (d.c_str()); - } else if (safe_file_test (d, Glib::FILE_TEST_EXISTS)) { + } else if (Glib::file_test (d, Glib::FILE_TEST_EXISTS)) { dirBrowser->open (Glib::path_get_dirname(d), Glib::path_get_basename(d)); } } diff --git a/rtgui/filmsimulation.cc b/rtgui/filmsimulation.cc index 93abe18fb..07f85df94 100644 --- a/rtgui/filmsimulation.cc +++ b/rtgui/filmsimulation.cc @@ -4,7 +4,6 @@ #include "options.h" #include "../rtengine/clutstore.h" -#include "../rtengine/safegtk.h" using namespace rtengine; using namespace rtengine::procparams; diff --git a/rtgui/flatfield.cc b/rtgui/flatfield.cc index f23c58adf..da78cda3c 100644 --- a/rtgui/flatfield.cc +++ b/rtgui/flatfield.cc @@ -19,7 +19,6 @@ #include "flatfield.h" #include "options.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include #include "rtimage.h" @@ -140,7 +139,7 @@ void FlatField::read(const rtengine::procparams::ProcParams* pp, const ParamsEdi } } - if (safe_file_test (pp->raw.ff_file, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (pp->raw.ff_file, Glib::FILE_TEST_EXISTS)) { flatFieldFile->set_filename (pp->raw.ff_file); } else { flatFieldFile_Reset(); diff --git a/rtgui/guiutils.cc b/rtgui/guiutils.cc index d3af3c597..c984a03f1 100644 --- a/rtgui/guiutils.cc +++ b/rtgui/guiutils.cc @@ -21,7 +21,6 @@ #include "options.h" #include "../rtengine/rt_math.h" #include "../rtengine/utils.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" #include "multilangmgr.h" @@ -131,7 +130,7 @@ bool confirmOverwrite (Gtk::Window& parent, const std::string& filename) { bool safe = true; - if (safe_file_test (filename, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (filename, Glib::FILE_TEST_EXISTS)) { Glib::ustring msg_ = Glib::ustring ("\"") + Glib::path_get_basename (filename) + "\": " + M("MAIN_MSG_ALREADYEXISTS") + "\n" + M("MAIN_MSG_QOVERWRITE"); Gtk::MessageDialog msgd (parent, msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_YES_NO, true); diff --git a/rtgui/icmpanel.cc b/rtgui/icmpanel.cc index b21ebf751..abee4aa72 100644 --- a/rtgui/icmpanel.cc +++ b/rtgui/icmpanel.cc @@ -20,7 +20,6 @@ #include "icmpanel.h" #include "options.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include "../rtengine/iccstore.h" #include "../rtengine/dcp.h" #include "rtimage.h" @@ -598,7 +597,7 @@ void ICMPanel::write (ProcParams* pp, ParamsEdited* pedited) } else if (icameraICC->get_active ()) { pp->icm.input = "(cameraICC)"; } else { - if (safe_file_test (ipDialog->get_filename (), Glib::FILE_TEST_EXISTS) && !safe_file_test (ipDialog->get_filename (), Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (ipDialog->get_filename (), Glib::FILE_TEST_EXISTS) && !Glib::file_test (ipDialog->get_filename (), Glib::FILE_TEST_IS_DIR)) { pp->icm.input = "file:" + ipDialog->get_filename (); } else { pp->icm.input = ""; // just a directory diff --git a/rtgui/inspector.cc b/rtgui/inspector.cc index 291339414..6c4891249 100644 --- a/rtgui/inspector.cc +++ b/rtgui/inspector.cc @@ -22,14 +22,13 @@ #include "cursormanager.h" #include "guiutils.h" #include "options.h" -#include "../rtengine/safegtk.h" #include "../rtengine/previewimage.h" extern Options options; InspectorBuffer::InspectorBuffer(const Glib::ustring &imagePath) : currTransform(0), fromRaw(false) { - if (!imagePath.empty() && safe_file_test(imagePath, Glib::FILE_TEST_EXISTS) && !safe_file_test(imagePath, Glib::FILE_TEST_IS_DIR)) { + if (!imagePath.empty() && Glib::file_test(imagePath, Glib::FILE_TEST_EXISTS) && !Glib::file_test(imagePath, Glib::FILE_TEST_IS_DIR)) { imgPath = imagePath; // generate thumbnail image diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index f85fb79c0..eda3992c3 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -19,7 +19,6 @@ #include #include "lensprofile.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include "../rtengine/lcp.h" #include #include "rtimage.h" diff --git a/rtgui/main.cc b/rtgui/main.cc index 66f8c9efc..4a4511f34 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -54,8 +54,6 @@ #include "conio.h" #endif -#include "../rtengine/safegtk.h" - extern Options options; // stores path to data files @@ -286,7 +284,7 @@ int main(int argc, char **argv) #ifndef WIN32 // Move the old path to the new one if the new does not exist - if (safe_file_test(Glib::build_filename(options.rtdir, "cache"), Glib::FILE_TEST_IS_DIR) && !safe_file_test(options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test(Glib::build_filename(options.rtdir, "cache"), Glib::FILE_TEST_IS_DIR) && !Glib::file_test(options.cacheBaseDir, Glib::FILE_TEST_IS_DIR)) { g_rename(Glib::build_filename (options.rtdir, "cache").c_str (), options.cacheBaseDir.c_str ()); } @@ -295,7 +293,7 @@ int main(int argc, char **argv) simpleEditor = false; if( !argv1.empty() ) - if( safe_file_test(argv1, Glib::FILE_TEST_EXISTS) && !safe_file_test(argv1, Glib::FILE_TEST_IS_DIR)) { + if( Glib::file_test(argv1, Glib::FILE_TEST_EXISTS) && !Glib::file_test(argv1, Glib::FILE_TEST_IS_DIR)) { simpleEditor = true; } @@ -420,7 +418,7 @@ int processLineParams( int argc, char **argv ) iArg++; outputPath = fname_to_utf8 (argv[iArg]); - if( safe_file_test (outputPath, Glib::FILE_TEST_IS_DIR)) { + if( Glib::file_test (outputPath, Glib::FILE_TEST_IS_DIR)) { outputDirectory = true; } } @@ -739,7 +737,7 @@ int processLineParams( int argc, char **argv ) continue; } - if( !overwriteFiles && safe_file_test( outputFile , Glib::FILE_TEST_EXISTS ) ) { + if( !overwriteFiles && Glib::file_test( outputFile , Glib::FILE_TEST_EXISTS ) ) { std::cerr << outputFile << " already exists: use -Y option to overwrite. This image has been skipped." << std::endl; continue; } @@ -780,7 +778,7 @@ int processLineParams( int argc, char **argv ) Glib::ustring sideProcessingParams = inputFile + paramFileExtension; // the "load" method don't reset the procparams values anymore, so values found in the procparam file override the one of currentParams - if( !safe_file_test( sideProcessingParams, Glib::FILE_TEST_EXISTS ) || currentParams.load ( sideProcessingParams )) { + if( !Glib::file_test( sideProcessingParams, Glib::FILE_TEST_EXISTS ) || currentParams.load ( sideProcessingParams )) { std::cerr << "Warning: sidecar file requested but not found for: " << sideProcessingParams << std::endl; } else { sideCarFound = true; diff --git a/rtgui/options.cc b/rtgui/options.cc index d57741304..96f7fe429 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -24,7 +24,6 @@ #include "../rtengine/safekeyfile.h" #include "addsetids.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include "version.h" #ifdef _OPENMP @@ -70,13 +69,13 @@ inline bool Options::checkProfilePath(Glib::ustring &path) Glib::ustring p = getUserProfilePath(); - if (!p.empty() && safe_file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { return true; } p = getGlobalProfilePath(); - if (!p.empty() && safe_file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test (path + paramFileExtension, Glib::FILE_TEST_EXISTS)) { return true; } else { return false; @@ -85,7 +84,7 @@ inline bool Options::checkProfilePath(Glib::ustring &path) bool Options::checkDirPath(Glib::ustring &path, Glib::ustring errString) { - if (safe_file_test (path, Glib::FILE_TEST_EXISTS) && safe_file_test (path, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (path, Glib::FILE_TEST_EXISTS) && Glib::file_test (path, Glib::FILE_TEST_IS_DIR)) { return true; } else { if (!errString.empty()) { @@ -170,51 +169,51 @@ void Options::updatePaths() Glib::ustring preferredPath = getPreferredProfilePath(); // Paths are updated only if the user or global profile path is set - if (lastRgbCurvesDir.empty() || !safe_file_test (lastRgbCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastRgbCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastRgbCurvesDir.empty() || !Glib::file_test (lastRgbCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastRgbCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastRgbCurvesDir = preferredPath; } - if (lastLabCurvesDir.empty() || !safe_file_test (lastLabCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastLabCurvesDir.empty() || !Glib::file_test (lastLabCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastLabCurvesDir = preferredPath; } - if (lastRetinexDir.empty() || !safe_file_test (lastRetinexDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastRetinexDir.empty() || !Glib::file_test (lastRetinexDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastLabCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastRetinexDir = preferredPath; } - if (lastDenoiseCurvesDir.empty() || !safe_file_test (lastDenoiseCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastDenoiseCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastDenoiseCurvesDir.empty() || !Glib::file_test (lastDenoiseCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastDenoiseCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastDenoiseCurvesDir = preferredPath; } - if (lastWaveletCurvesDir.empty() || !safe_file_test (lastWaveletCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastWaveletCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastWaveletCurvesDir.empty() || !Glib::file_test (lastWaveletCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastWaveletCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastWaveletCurvesDir = preferredPath; } - if (lastPFCurvesDir.empty() || !safe_file_test (lastPFCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastPFCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastPFCurvesDir.empty() || !Glib::file_test (lastPFCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastPFCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastPFCurvesDir = preferredPath; } - if (lastHsvCurvesDir.empty() || !safe_file_test (lastHsvCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastHsvCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastHsvCurvesDir.empty() || !Glib::file_test (lastHsvCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastHsvCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastHsvCurvesDir = preferredPath; } - if (lastToneCurvesDir.empty() || !safe_file_test (lastToneCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastToneCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastToneCurvesDir.empty() || !Glib::file_test (lastToneCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastToneCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastToneCurvesDir = preferredPath; } - if (lastProfilingReferenceDir.empty() || !safe_file_test (lastProfilingReferenceDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastProfilingReferenceDir, Glib::FILE_TEST_IS_DIR)) { + if (lastProfilingReferenceDir.empty() || !Glib::file_test (lastProfilingReferenceDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastProfilingReferenceDir, Glib::FILE_TEST_IS_DIR)) { lastProfilingReferenceDir = preferredPath; } - if (lastVibranceCurvesDir.empty() || !safe_file_test (lastVibranceCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastVibranceCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastVibranceCurvesDir.empty() || !Glib::file_test (lastVibranceCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastVibranceCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastVibranceCurvesDir = preferredPath; } - if (loadSaveProfilePath.empty() || !safe_file_test (loadSaveProfilePath, Glib::FILE_TEST_EXISTS) || !safe_file_test (loadSaveProfilePath, Glib::FILE_TEST_IS_DIR)) { + if (loadSaveProfilePath.empty() || !Glib::file_test (loadSaveProfilePath, Glib::FILE_TEST_EXISTS) || !Glib::file_test (loadSaveProfilePath, Glib::FILE_TEST_IS_DIR)) { loadSaveProfilePath = preferredPath; } - if (lastBWCurvesDir.empty() || !safe_file_test (lastBWCurvesDir, Glib::FILE_TEST_EXISTS) || !safe_file_test (lastBWCurvesDir, Glib::FILE_TEST_IS_DIR)) { + if (lastBWCurvesDir.empty() || !Glib::file_test (lastBWCurvesDir, Glib::FILE_TEST_EXISTS) || !Glib::file_test (lastBWCurvesDir, Glib::FILE_TEST_IS_DIR)) { lastBWCurvesDir = preferredPath; } @@ -255,7 +254,7 @@ Glib::ustring Options::findProfilePath(Glib::ustring &profName) p = getUserProfilePath(); Glib::ustring fullPath = Glib::build_filename(p, profName.substr(5) + paramFileExtension); - if (!p.empty() && safe_file_test (fullPath, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { return Glib::path_get_dirname(fullPath); } } else if (p == "${G}") { @@ -263,7 +262,7 @@ Glib::ustring Options::findProfilePath(Glib::ustring &profName) p = getGlobalProfilePath(); Glib::ustring fullPath = Glib::build_filename(p, profName.substr(5) + paramFileExtension); - if (!p.empty() && safe_file_test (fullPath, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { return Glib::path_get_dirname(fullPath); } } else { @@ -271,7 +270,7 @@ Glib::ustring Options::findProfilePath(Glib::ustring &profName) p = getUserProfilePath(); Glib::ustring fullPath = Glib::build_filename(p, profName + paramFileExtension); - if (!p.empty() && safe_file_test (fullPath, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { // update the profile path profName = Glib::build_filename("${U}", profName); return Glib::path_get_dirname(fullPath); @@ -280,7 +279,7 @@ Glib::ustring Options::findProfilePath(Glib::ustring &profName) p = getGlobalProfilePath(); fullPath = Glib::build_filename(p, profName + paramFileExtension); - if (!p.empty() && safe_file_test (fullPath, Glib::FILE_TEST_EXISTS)) { + if (!p.empty() && Glib::file_test (fullPath, Glib::FILE_TEST_EXISTS)) { profName = Glib::build_filename("${G}", profName); return Glib::path_get_dirname(fullPath); } @@ -729,7 +728,7 @@ int Options::readFromFile (Glib::ustring fname) setlocale(LC_NUMERIC, "C"); // to set decimal point to "." rtengine::SafeKeyFile keyFile; - if( !safe_file_test(fname, Glib::FILE_TEST_EXISTS)) { + if( !Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) { return 1; } @@ -2105,7 +2104,7 @@ int Options::saveToFile (Glib::ustring fname) keyFile.set_string ("Dialogs", "LastVibranceCurvesDir", lastVibranceCurvesDir); keyFile.set_string ("Dialogs", "LastProfilingReferenceDir", lastProfilingReferenceDir); - FILE *f = safe_g_fopen (fname, "wt"); + FILE *f = g_fopen (fname.c_str (), "wt"); if (f == NULL) { if (options.rtSettings.verbose) { diff --git a/rtgui/popupcommon.cc b/rtgui/popupcommon.cc index f7e667219..24af17213 100644 --- a/rtgui/popupcommon.cc +++ b/rtgui/popupcommon.cc @@ -22,7 +22,6 @@ #include #include "multilangmgr.h" #include "popupcommon.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" PopUpCommon::PopUpCommon (Gtk::Button* thisButton, const Glib::ustring& label) diff --git a/rtgui/preferences.cc b/rtgui/preferences.cc index 5f5ececee..78547e9d7 100644 --- a/rtgui/preferences.cc +++ b/rtgui/preferences.cc @@ -25,7 +25,6 @@ #include "../rtengine/dfmanager.h" #include "../rtengine/ffmanager.h" #include -#include "../rtengine/safegtk.h" #include "rtimage.h" #ifdef _OPENMP #include @@ -1357,7 +1356,7 @@ void Preferences::parseDir (Glib::ustring dirname, std::vector& i Glib::ustring sname = *i; // ignore directories - if (!safe_file_test (fname, Glib::FILE_TEST_IS_DIR) && sname.size() >= ext.size() && sname.substr (sname.size() - ext.size(), ext.size()).casefold() == ext) { + if (!Glib::file_test (fname, Glib::FILE_TEST_IS_DIR) && sname.size() >= ext.size() && sname.substr (sname.size() - ext.size(), ext.size()).casefold() == ext) { items.push_back (sname.substr(0, sname.size() - ext.size())); } } @@ -1647,18 +1646,18 @@ void Preferences::fillPreferences () #ifdef WIN32 edPS->set_active (moptions.editorToSendTo == 2); - if (safe_file_test (moptions.gimpDir, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (moptions.gimpDir, Glib::FILE_TEST_IS_DIR)) { gimpDir->set_current_folder (moptions.gimpDir); } - if (safe_file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) { psDir->set_current_folder (moptions.psDir); } #elif defined __APPLE__ edPS->set_active (moptions.editorToSendTo == 2); - if (safe_file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (moptions.psDir, Glib::FILE_TEST_IS_DIR)) { psDir->set_current_folder (moptions.psDir); } diff --git a/rtgui/preprocess.cc b/rtgui/preprocess.cc index 1bfad7cc3..44d054214 100644 --- a/rtgui/preprocess.cc +++ b/rtgui/preprocess.cc @@ -18,7 +18,6 @@ */ #include "preprocess.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include using namespace rtengine; diff --git a/rtgui/previewloader.cc b/rtgui/previewloader.cc index dd090a95e..02082f7a7 100644 --- a/rtgui/previewloader.cc +++ b/rtgui/previewloader.cc @@ -21,7 +21,6 @@ #include "previewloader.h" #include "guiutils.h" #include "threadutils.h" -#include "../rtengine/safegtk.h" #ifdef _OPENMP #include @@ -123,7 +122,7 @@ public: try { Thumbnail* tmb = 0; { - if (safe_file_test(j.dir_entry_, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test(j.dir_entry_, Glib::FILE_TEST_EXISTS)) { tmb = cacheMgr->getEntry(j.dir_entry_); } } diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index d99ffb4b3..42e35c7dc 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -21,7 +21,6 @@ #include "profilestore.h" #include "clipboard.h" #include "multilangmgr.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" using namespace rtengine; diff --git a/rtgui/profilestore.cc b/rtgui/profilestore.cc index fd51699bf..482f83188 100644 --- a/rtgui/profilestore.cc +++ b/rtgui/profilestore.cc @@ -20,7 +20,6 @@ #include "options.h" #include "toolpanel.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" ProfileStore profileStore; @@ -168,7 +167,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath unsigned int folder = 0; // folder's own Id // reload the available profiles from the profile dir - if (!realPath.empty() && safe_file_test(realPath, Glib::FILE_TEST_EXISTS) && safe_file_test (realPath, Glib::FILE_TEST_IS_DIR)) { + if (!realPath.empty() && Glib::file_test(realPath, Glib::FILE_TEST_EXISTS) && Glib::file_test (realPath, Glib::FILE_TEST_IS_DIR)) { // add this entry to the folder list folders.push_back(virtualPath); @@ -199,7 +198,7 @@ bool ProfileStore::parseDir (Glib::ustring& realPath, Glib::ustring& virtualPath Glib::ustring fname = Glib::build_filename(realPath, currDir); - if (safe_file_test (fname, Glib::FILE_TEST_IS_DIR)) { + if (Glib::file_test (fname, Glib::FILE_TEST_IS_DIR)) { Glib::ustring vp(Glib::build_filename(virtualPath, currDir)); Glib::ustring rp(Glib::build_filename(realPath, currDir)); fileFound = parseDir (rp, vp, currDir, folder, level + 1, 0); diff --git a/rtgui/rawcacorrection.cc b/rtgui/rawcacorrection.cc index 0e14182cf..c40aac6b7 100644 --- a/rtgui/rawcacorrection.cc +++ b/rtgui/rawcacorrection.cc @@ -18,7 +18,6 @@ */ #include "rawcacorrection.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include #include "rtimage.h" diff --git a/rtgui/rawexposure.cc b/rtgui/rawexposure.cc index 746b453cf..56fcf7ec9 100644 --- a/rtgui/rawexposure.cc +++ b/rtgui/rawexposure.cc @@ -18,7 +18,6 @@ */ #include "rawexposure.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include using namespace rtengine; diff --git a/rtgui/saveasdlg.cc b/rtgui/saveasdlg.cc index 8a4f69445..c9490f585 100644 --- a/rtgui/saveasdlg.cc +++ b/rtgui/saveasdlg.cc @@ -19,7 +19,6 @@ #include "saveasdlg.h" #include "multilangmgr.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include "rtimage.h" extern Options options; @@ -224,7 +223,7 @@ void SaveAsDialog::okPressed () // checking if the filename field is empty. The user have to click Cancel if he don't want to specify a filename // NB: There seem to be a bug in Gtkmm2.22 / FileChooserWidget : if you suppress the filename entry and // click on a folder in the list, the filename field is empty but get_filename will return the folder's path :/ - if (!fname.length() || safe_file_test (fname, Glib::FILE_TEST_IS_DIR)) { + if (!fname.length() || Glib::file_test (fname, Glib::FILE_TEST_IS_DIR)) { Glib::ustring msg_ = Glib::ustring("") + M("MAIN_MSG_EMPTYFILENAME") + ""; Gtk::MessageDialog msgd (*this, msg_, true, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_OK, true); msgd.run (); diff --git a/rtgui/sharpenedge.cc b/rtgui/sharpenedge.cc index 880240f04..d21fe54aa 100644 --- a/rtgui/sharpenedge.cc +++ b/rtgui/sharpenedge.cc @@ -18,7 +18,6 @@ */ #include "sharpenedge.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include #include diff --git a/rtgui/sharpenmicro.cc b/rtgui/sharpenmicro.cc index 49c36e99f..2ca0ddf44 100644 --- a/rtgui/sharpenmicro.cc +++ b/rtgui/sharpenmicro.cc @@ -18,7 +18,6 @@ */ #include "sharpenmicro.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include #include diff --git a/rtgui/soundman.h b/rtgui/soundman.h index a778a006a..dd8e515fc 100644 --- a/rtgui/soundman.h +++ b/rtgui/soundman.h @@ -21,7 +21,10 @@ #ifndef _SOUNDMAN_ #define _SOUNDMAN_ -#include "../rtengine/safegtk.h" +namespace Glib +{ +class ustring; +} class SoundManager { diff --git a/rtgui/splash.cc b/rtgui/splash.cc index 6e0849b99..c936639f7 100644 --- a/rtgui/splash.cc +++ b/rtgui/splash.cc @@ -20,8 +20,6 @@ #include -#include "../rtengine/safegtk.h" - #include "multilangmgr.h" #include "rtimage.h" @@ -109,8 +107,8 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t // Tab 2: the informations about the current version std::string buildFileName = Glib::build_filename (creditsPath, "AboutThisBuild.txt"); - if ( safe_file_test(buildFileName, (Glib::FILE_TEST_EXISTS)) ) { - FILE *f = safe_g_fopen (buildFileName, "rt"); + if ( Glib::file_test(buildFileName, (Glib::FILE_TEST_EXISTS)) ) { + FILE *f = g_fopen (buildFileName.c_str (), "rt"); if (f != NULL) { char* buffer = new char[1024]; @@ -139,8 +137,8 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t // Tab 3: the credits std::string creditsFileName = Glib::build_filename (creditsPath, "AUTHORS.txt"); - if ( safe_file_test(creditsFileName, (Glib::FILE_TEST_EXISTS)) ) { - FILE *f = safe_g_fopen (creditsFileName, "rt"); + if ( Glib::file_test(creditsFileName, (Glib::FILE_TEST_EXISTS)) ) { + FILE *f = g_fopen (creditsFileName.c_str (), "rt"); if (f != NULL) { char* buffer = new char[1024]; @@ -170,8 +168,8 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t // Tab 4: the license std::string licenseFileName = Glib::build_filename (licensePath, "LICENSE.txt"); - if ( safe_file_test(licenseFileName, (Glib::FILE_TEST_EXISTS)) ) { - FILE *f = safe_g_fopen (licenseFileName, "rt"); + if ( Glib::file_test(licenseFileName, (Glib::FILE_TEST_EXISTS)) ) { + FILE *f = g_fopen (licenseFileName.c_str (), "rt"); if (f != NULL) { char* buffer = new char[1024]; @@ -207,8 +205,8 @@ Splash::Splash (Gtk::Window& parent) : Gtk::Dialog(M("GENERAL_ABOUT"), parent, t // Tab 5: the Release Notes std::string releaseNotesFileName = Glib::build_filename (creditsPath, "RELEASE_NOTES.txt"); - if ( safe_file_test(releaseNotesFileName, (Glib::FILE_TEST_EXISTS)) ) { - FILE *f = safe_g_fopen (releaseNotesFileName, "rt"); + if ( Glib::file_test(releaseNotesFileName, (Glib::FILE_TEST_EXISTS)) ) { + FILE *f = g_fopen (releaseNotesFileName.c_str (), "rt"); if (f != NULL) { char* buffer = new char[1024]; diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index ac6240435..673c49efe 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -30,7 +30,6 @@ #include "profilestore.h" #include "batchqueue.h" #include "extprog.h" -#include "../rtengine/safegtk.h" using namespace rtengine::procparams; @@ -942,7 +941,7 @@ bool Thumbnail::openDefaultViewer(int destination) if (destination == 1) { openFName = Glib::ustring::compose ("%1.%2", BatchQueue::calcAutoFileNameBase(fname), options.saveFormatBatch.format); - if (safe_file_test (openFName, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (openFName, Glib::FILE_TEST_EXISTS)) { wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (openFName.c_str(), -1, NULL, NULL, NULL); ShellExecuteW(NULL, L"open", wfilename, NULL, NULL, SW_SHOWMAXIMIZED ); g_free(wfilename); @@ -956,7 +955,7 @@ bool Thumbnail::openDefaultViewer(int destination) printf("Opening %s\n", openFName.c_str()); - if (safe_file_test (openFName, Glib::FILE_TEST_EXISTS)) { + if (Glib::file_test (openFName, Glib::FILE_TEST_EXISTS)) { // Output file exists, so open explorer and select output file wchar_t* org = (wchar_t*)g_utf8_to_utf16 (Glib::ustring::compose("/select,\"%1\"", openFName).c_str(), -1, NULL, NULL, NULL); wchar_t* par = new wchar_t[wcslen(org) + 1]; @@ -977,7 +976,7 @@ bool Thumbnail::openDefaultViewer(int destination) delete[] par; g_free(org); - } else if (safe_file_test (Glib::path_get_dirname(openFName), Glib::FILE_TEST_EXISTS)) { + } else if (Glib::file_test (Glib::path_get_dirname(openFName), Glib::FILE_TEST_EXISTS)) { // Out file does not exist, but directory wchar_t *wfilename = (wchar_t*)g_utf8_to_utf16 (Glib::path_get_dirname(openFName).c_str(), -1, NULL, NULL, NULL); ShellExecuteW(NULL, L"explore", wfilename, NULL, NULL, SW_SHOWNORMAL ); diff --git a/rtgui/xtransrawexposure.cc b/rtgui/xtransrawexposure.cc index ccf1e621b..84fae9032 100644 --- a/rtgui/xtransrawexposure.cc +++ b/rtgui/xtransrawexposure.cc @@ -18,7 +18,6 @@ */ #include "xtransrawexposure.h" #include "guiutils.h" -#include "../rtengine/safegtk.h" #include using namespace rtengine;