aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden
diff options
context:
space:
mode:
authorelektrahesse2010-09-07 19:35:00 +0200
committerelektrahesse2010-09-07 19:35:00 +0200
commit65429a862a1a183c099790e6c28ce0374da8c60b (patch)
tree97334a0a52dd5e41e18fa69a2486c1b2b8fdef3d /linden
parentMerge branch 'weekly' of git://github.com/mccabe/imprudence into weekly (diff)
downloadmeta-impy-65429a862a1a183c099790e6c28ce0374da8c60b.zip
meta-impy-65429a862a1a183c099790e6c28ce0374da8c60b.tar.gz
meta-impy-65429a862a1a183c099790e6c28ce0374da8c60b.tar.bz2
meta-impy-65429a862a1a183c099790e6c28ce0374da8c60b.tar.xz
Fixed local textures on mac
Diffstat (limited to '')
-rw-r--r--linden/indra/newview/floaterlocalassetbrowse.cpp29
1 files changed, 23 insertions, 6 deletions
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)
122 else if (temp_exten == "jpg" || temp_exten == "jpeg") { this->extension = IMG_EXTEN_JPG; } 122 else if (temp_exten == "jpg" || temp_exten == "jpeg") { this->extension = IMG_EXTEN_JPG; }
123 else if (temp_exten == "png") { this->extension = IMG_EXTEN_PNG; } 123 else if (temp_exten == "png") { this->extension = IMG_EXTEN_PNG; }
124 else { return; } // no valid extension. 124 else { return; } // no valid extension.
125 125
126 /* getting file's last modified */ 126 /* getting file's last modified */
127 const std::time_t time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); 127
128 std::time_t time;
129
130#ifdef LL_DARWIN
131 struct stat temp_stat;
132 stat(fullpath.c_str(), &temp_stat);
133 time = temp_stat.st_mtime;
134#else
135 time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) );
136#endif
137
128 this->last_modified = asctime( localtime(&time) ); 138 this->last_modified = asctime( localtime(&time) );
129 139
130 /* checking if the bitmap is valid && decoding if it is */ 140 /* checking if the bitmap is valid && decoding if it is */
131 LLImageRaw* raw_image = new LLImageRaw(); 141 LLImageRaw* raw_image = new LLImageRaw();
132 if ( this->decodeSelf(raw_image) ) 142 if ( this->decodeSelf(raw_image) )
@@ -161,7 +171,14 @@ void LocalBitmap::updateSelf()
161 if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; } 171 if ( !gDirUtilp->fileExists(this->filename) ) { this->linkstatus = LINK_BROKEN; return; }
162 172
163 /* exists, let's check if it's lastmod has changed */ 173 /* exists, let's check if it's lastmod has changed */
164 const std::time_t temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) ); 174 std::time_t temp_time;
175#ifdef LL_DARWIN
176 struct stat temp_stat;
177 stat(this->filename.c_str(), &temp_stat);
178 temp_time = temp_stat.st_mtime;
179#else
180 temp_time = boost::filesystem::last_write_time( boost::filesystem::path( this->filename ) );
181#endif
165 LLSD new_last_modified = asctime( localtime(&temp_time) ); 182 LLSD new_last_modified = asctime( localtime(&temp_time) );
166 if ( this->last_modified.asString() == new_last_modified.asString() ) { return; } 183 if ( this->last_modified.asString() == new_last_modified.asString() ) { return; }
167 184
@@ -463,11 +480,11 @@ void LocalAssetBrowser::AddBitmap()
463 LocalBitmap* unit = new LocalBitmap( filename ); 480 LocalBitmap* unit = new LocalBitmap( filename );
464 481
465 if ( unit->getIfValidBool() ) 482 if ( unit->getIfValidBool() )
466 { 483 {
467 loaded_bitmaps.push_back( unit ); 484 loaded_bitmaps.push_back( unit );
468 change_happened = true; 485 change_happened = true;
469 } 486 }
470 487
471 filename = picker.getNextFile(); 488 filename = picker.getNextFile();
472 } 489 }
473 490