| 335 | } |
| 336 | |
| 337 | void FileSystemActor::setFilePath(QString fullPath, bool skipTextureResolution /*=false*/) |
| 338 | { |
| 339 | if (_isAnimatedTexture) |
| 340 | _animatedTextureSource.setPath(fullPath); |
| 341 | |
| 342 | // Save the Path (or Virtual Folder Name) |
| 343 | filePath = fullPath; |
| 344 | winOS->GetShortPathName(fullPath, shortPath); |
| 345 | if (skipTextureResolution) |
| 346 | return; |
| 347 | |
| 348 | // resolve the texture to load for this file if there is one |
| 349 | QString ext = fsManager->getFileExtension(fullPath); |
| 350 | QString texId; |
| 351 | GLTextureDetail detail = FileIcon; |
| 352 | GLTextureLoadPriority priority = NormalPriority; |
| 353 | |
| 354 | bool isVista = winOS->IsWindowsVersionGreaterThanOrEqualTo(WindowsVista); |
| 355 | bool overrideSystemTextures = GLOBAL(settings).useThemeIconOverrides; |
| 356 | int virtualIconId = winOS->GetIconTypeFromFileName(fullPath); |
| 357 | if (virtualIconId > -1) |
| 358 | { |
| 359 | // mark this is a virtual icon |
| 360 | pushFileSystemType(Virtual); |
| 361 | pushFileSystemType(Folder); |
| 362 | |
| 363 | // check if we are overloading any virtual icons (only My Computer for now) |
| 364 | if (overrideSystemTextures && |
| 365 | (virtualIconId == MyComputer) && |
| 366 | texMgr->hasTexture("override.virtual.mycomputer")) |
| 367 | { |
| 368 | texId = QT_NT("override.virtual.mycomputer"); |
| 369 | detail = HiResImage; |
| 370 | } |
| 371 | else |
| 372 | { |
| 373 | // otherwise, we will just load the icon later |
| 374 | texId = fullPath; |
| 375 | |
| 376 | // NOTE: we force load these icons here because we do not do so if the |
| 377 | // texture id is set below |
| 378 | loadThumbnailTexture(GLTextureObject(Load, texId, texId, FileIcon, priority, false)); |
| 379 | } |
| 380 | } |
| 381 | else |
| 382 | { |
| 383 | // not a virtual icon, just a random icon then |
| 384 | unsigned int fileAttributes = fsManager->getFileAttributes(fullPath); |
| 385 | |
| 386 | // delete this object if it doesn't exist (and it's not a photo frame or volume) |
| 387 | if (!fileAttributes && |
| 388 | !(isFileSystemType(PhotoFrame) || isFileSystemType(LogicalVolume))) |
| 389 | { |
| 390 | animManager->addAnimation(AnimationEntry(this, (FinishedCallBack) DeleteActorAfterAnim)); |
| 391 | setAlpha(0.0f); |
| 392 | return; |
| 393 | } |
| 394 |
no test coverage detected