From e06ab7e8e6acd094d354bd5d383abc5c8869bfc9 Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Tue, 7 Sep 2010 22:34:40 +0200 Subject: Made the texture fix cross platform and removed boost::filesystem dep for loaterlocalassetbrowse.cpp --- linden/indra/newview/floaterlocalassetbrowse.cpp | 25 +++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/floaterlocalassetbrowse.cpp b/linden/indra/newview/floaterlocalassetbrowse.cpp index 0ff24ca..0c313fb 100644 --- a/linden/indra/newview/floaterlocalassetbrowse.cpp +++ b/linden/indra/newview/floaterlocalassetbrowse.cpp @@ -40,12 +40,6 @@ this feature is still a work in progress. #include "llviewerprecompiledheaders.h" #include "lluictrlfactory.h" -/* boost madness from hell */ -#ifdef equivalent - #undef equivalent -#endif -#include - /* own class header && upload floater header */ #include "floaterlocalassetbrowse.h" //#include "floaterlocaluploader.h" <- in development. @@ -65,6 +59,7 @@ this feature is still a work in progress. #include "llfilepicker.h" #include "llviewermenufile.h" #include "llfloaterimagepreview.h" +#include "llfile.h" /* repeated in header */ #include "lltexturectrl.h" @@ -124,7 +119,11 @@ LocalBitmap::LocalBitmap(std::string fullpath) else { return; } // no valid extension. /* getting file's last modified */ - const std::time_t time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); + + llstat temp_stat; + LLFile::stat(this->filename, &temp_stat); + std::time_t time = temp_stat.st_mtime; + this->last_modified = asctime( localtime(&time) ); /* checking if the bitmap is valid && decoding if it is */ @@ -161,7 +160,19 @@ void LocalBitmap::updateSelf() if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; } /* exists, let's check if it's lastmod has changed */ + std::time_t temp_time; +#ifdef LL_DARWIN + struct stat temp_stat; + stat(this->filename.c_str(), &temp_stat); + temp_time = temp_stat.st_mtime; +#else + temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); +#endif const std::time_t temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); + llstat temp_stat; + LLFile::stat(this->filename, &temp_stat); + std::time_t temp_time = temp_stat.st_mtime; + LLSD new_last_modified = asctime( localtime(&temp_time) ); if ( this->last_modified.asString() == new_last_modified.asString() ) { return; } -- cgit v1.1