From 65429a862a1a183c099790e6c28ce0374da8c60b Mon Sep 17 00:00:00 2001 From: elektrahesse Date: Tue, 7 Sep 2010 19:35:00 +0200 Subject: Fixed local textures on mac --- linden/indra/newview/floaterlocalassetbrowse.cpp | 29 +++++++++++++++++++----- 1 file changed, 23 insertions(+), 6 deletions(-) (limited to 'linden') diff --git a/linden/indra/newview/floaterlocalassetbrowse.cpp b/linden/indra/newview/floaterlocalassetbrowse.cpp index 0ff24ca..0d94e5b 100644 --- a/linden/indra/newview/floaterlocalassetbrowse.cpp +++ b/linden/indra/newview/floaterlocalassetbrowse.cpp @@ -122,11 +122,21 @@ LocalBitmap::LocalBitmap(std::string fullpath) else if (temp_exten == "jpg" || temp_exten == "jpeg") { this->extension = IMG_EXTEN_JPG; } else if (temp_exten == "png") { this->extension = IMG_EXTEN_PNG; } 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 ) ); + + std::time_t time; + +#ifdef LL_DARWIN + struct stat temp_stat; + stat(fullpath.c_str(), &temp_stat); + time = temp_stat.st_mtime; +#else + time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); +#endif + this->last_modified = asctime( localtime(&time) ); - + /* checking if the bitmap is valid && decoding if it is */ LLImageRaw* raw_image = new LLImageRaw(); if ( this->decodeSelf(raw_image) ) @@ -161,7 +171,14 @@ void LocalBitmap::updateSelf() if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; } /* exists, let's check if it's lastmod has changed */ - const std::time_t temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); + 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 LLSD new_last_modified = asctime( localtime(&temp_time) ); if ( this->last_modified.asString() == new_last_modified.asString() ) { return; } @@ -463,11 +480,11 @@ void LocalAssetBrowser::AddBitmap() LocalBitmap* unit = new LocalBitmap( filename ); if ( unit->getIfValidBool() ) - { + { loaded_bitmaps.push_back( unit ); change_happened = true; } - + filename = picker.getNextFile(); } -- cgit v1.1