MCPcopy Create free account
hub / github.com/bumptop/BumpTop / setFilePath

Method setFilePath

trunk/win/Source/BT_FileSystemActor.cpp:337–544  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

335}
336
337void 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

Callers 15

pileizeMethod · 0.45
addToPileMethod · 0.45
removeFromPileMethod · 0.45
convertMethod · 0.45
onFileAddedMethod · 0.45
onFileNameChangedMethod · 0.45
onFileAddedMethod · 0.45
onFileNameChangedMethod · 0.45
onFileModifiedMethod · 0.45
CreateStickyNoteFunction · 0.45
OnTimerMethod · 0.45

Calls 15

GLTextureObjectClass · 0.85
hideTextFunction · 0.85
getFileNameFunction · 0.85
GetShortPathNameMethod · 0.80
getFileExtensionMethod · 0.80
hasTextureMethod · 0.80
getFileAttributesMethod · 0.80
removeAnimationMethod · 0.80
getShortcutTargetMethod · 0.80

Tested by

no test coverage detected