Skip to content
Snippets Groups Projects
Commit 5048b387 authored by Andrey Kleshchev's avatar Andrey Kleshchev
Browse files

SL-20101 Fix ThumbnailDimentionsLimit poping up on success

parent 87c33704
No related branches found
No related tags found
No related merge requests found
......@@ -546,12 +546,21 @@ struct ImageLoadedData
LLUUID mThumbnailId;
LLUUID mObjectId;
LLHandle<LLFloater> mFloaterHandle;
bool mSilent;
};
void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id, bool silent)
{
LLPointer<LLViewerFetchedTexture> texturep = LLViewerTextureManager::getFetchedTexture(asset_id);
if (texturep->getFullWidth() == 0 && !texturep->isFullyLoaded() && !texturep->isMissingAsset())
if (texturep->isMissingAsset())
{
LL_WARNS() << "Attempted to assign missing asset " << asset_id << LL_ENDL;
if (!silent)
{
LLNotificationsUtil::add("ThumbnailDimentionsLimit");
}
}
else if (texturep->getFullWidth() == 0)
{
if (silent)
{
......@@ -566,9 +575,10 @@ void LLFloaterChangeItemThumbnail::assignAndValidateAsset(const LLUUID &asset_id
data->mObjectId = mItemId;
data->mThumbnailId = asset_id;
data->mFloaterHandle = getHandle();
data->mSilent = silent;
texturep->setLoadedCallback(onImageLoaded,
MAX_DISCARD_LEVEL, // don't actually need max one, 3 or 4 should be enough
MAX_DISCARD_LEVEL, // Don't need full image, just size data
FALSE,
FALSE,
(void*)data,
......@@ -648,16 +658,20 @@ void LLFloaterChangeItemThumbnail::onImageLoaded(
{
setThumbnailId(data->mThumbnailId, data->mObjectId);
}
else if (!data->mSilent)
{
// Should this only appear if floater is alive?
LLNotificationsUtil::add("ThumbnailDimentionsLimit");
}
}
// Update floater
if (!data->mFloaterHandle.isDead())
// Update floater
if (!data->mSilent && !data->mFloaterHandle.isDead())
{
LLFloaterChangeItemThumbnail* self = static_cast<LLFloaterChangeItemThumbnail*>(data->mFloaterHandle.get());
if (self && self->mExpectingAssetId == data->mThumbnailId)
{
LLFloaterChangeItemThumbnail* self = static_cast<LLFloaterChangeItemThumbnail*>(data->mFloaterHandle.get());
if (self && self->mExpectingAssetId == data->mThumbnailId)
{
LLNotificationsUtil::add("ThumbnailDimentionsLimit");
self->mExpectingAssetId = LLUUID::null;
}
self->mExpectingAssetId = LLUUID::null;
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment