Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #2294 from smfontes/14119

Fixes for bug 14119
  • Loading branch information...
commit 406f32d0d2919112e74eedd32049dc38266cfe30 2 parents c1aa24d + fe62d92
ulion ulion authored
2  xbmc/GUIInfoManager.cpp
View
@@ -5012,7 +5012,7 @@ void CGUIInfoManager::SetCurrentSlide(CFileItem &item)
{
if (m_currentSlide->GetPath() != item.GetPath())
{
- if (!item.HasPictureInfoTag() && !item.GetPictureInfoTag()->Loaded())
+ if (!item.GetPictureInfoTag()->Loaded()) // If picture metadata has not been loaded yet, load it now
item.GetPictureInfoTag()->Load(item.GetPath());
*m_currentSlide = item;
}
4 xbmc/interfaces/legacy/ListItem.cpp
View
@@ -442,7 +442,6 @@ namespace XBMCAddon
}
else if (strcmpi(type,"pictures") == 0)
{
- bool pictureTagLoaded = false;
for (Dictionary::const_iterator it = infoLabels.begin(); it != infoLabels.end(); it++)
{
CStdString key = it->first;
@@ -468,11 +467,8 @@ namespace XBMCAddon
if (!exifkey.Left(5).Equals("exif:") || exifkey.length() < 6) continue;
int info = CPictureInfoTag::TranslateString(exifkey.Mid(5));
item->GetPictureInfoTag()->SetInfo(info, value);
- pictureTagLoaded = true;
}
}
- if (pictureTagLoaded)
- item->GetPictureInfoTag()->SetLoaded(true);
}
} // end ListItem::setInfo
14 xbmc/pictures/PictureInfoTag.cpp
View
@@ -31,6 +31,7 @@ void CPictureInfoTag::Reset()
memset(&m_exifInfo, 0, sizeof(m_exifInfo));
memset(&m_iptcInfo, 0, sizeof(m_iptcInfo));
m_isLoaded = false;
+ m_isInfoSetExternally = false;
}
const CPictureInfoTag& CPictureInfoTag::operator=(const CPictureInfoTag& right)
@@ -39,6 +40,7 @@ const CPictureInfoTag& CPictureInfoTag::operator=(const CPictureInfoTag& right)
memcpy(&m_exifInfo, &right.m_exifInfo, sizeof(m_exifInfo));
memcpy(&m_iptcInfo, &right.m_iptcInfo, sizeof(m_iptcInfo));
m_isLoaded = right.m_isLoaded;
+ m_isInfoSetExternally = right.m_isInfoSetExternally;
return *this;
}
@@ -61,6 +63,7 @@ void CPictureInfoTag::Archive(CArchive& ar)
if (ar.IsStoring())
{
ar << m_isLoaded;
+ ar << m_isInfoSetExternally;
ar << m_exifInfo.ApertureFNumber;
ar << CStdString(m_exifInfo.CameraMake);
ar << CStdString(m_exifInfo.CameraModel);
@@ -124,6 +127,7 @@ void CPictureInfoTag::Archive(CArchive& ar)
else
{
ar >> m_isLoaded;
+ ar >> m_isInfoSetExternally;
ar >> m_exifInfo.ApertureFNumber;
GetStringFromArchive(ar, m_exifInfo.CameraMake, sizeof(m_exifInfo.CameraMake));
GetStringFromArchive(ar, m_exifInfo.CameraModel, sizeof(m_exifInfo.CameraModel));
@@ -267,7 +271,7 @@ void CPictureInfoTag::GetStringFromArchive(CArchive &ar, char *string, size_t le
const CStdString CPictureInfoTag::GetInfo(int info) const
{
- if (!m_isLoaded)
+ if (!m_isLoaded && !m_isInfoSetExternally) // If no metadata has been loaded from the picture file or set with SetInfo(), just return
return "";
CStdString value;
@@ -590,21 +594,17 @@ void CPictureInfoTag::SetInfo(int info, const CStdString& value)
{
m_exifInfo.Width = atoi(dimension[0].c_str());
m_exifInfo.Height = atoi(dimension[1].c_str());
+ m_isInfoSetExternally = true; // Set the internal state to show metadata has been set by call to SetInfo
}
break;
}
case SLIDE_EXIF_DATE_TIME:
{
strcpy(m_exifInfo.DateTime, value.c_str());
+ m_isInfoSetExternally = true; // Set the internal state to show metadata has been set by call to SetInfo
break;
}
default:
break;
}
}
-
-void CPictureInfoTag::SetLoaded(bool loaded)
-{
- m_isLoaded = loaded;
-}
-
4 xbmc/pictures/PictureInfoTag.h
View
@@ -100,12 +100,12 @@ class CPictureInfoTag : public IArchivable, public ISerializable, public ISortab
static int TranslateString(const CStdString &info);
void SetInfo(int info, const CStdString& value);
- void SetLoaded(bool loaded = true);
private:
void GetStringFromArchive(CArchive &ar, char *string, size_t length);
ExifInfo_t m_exifInfo;
IPTCInfo_t m_iptcInfo;
- bool m_isLoaded;
+ bool m_isLoaded; // Set to true if metadata has been loaded from the picture file successfully
+ bool m_isInfoSetExternally; // Set to true if metadata has been set by an external call to SetInfo
};
Please sign in to comment.
Something went wrong with that request. Please try again.