All pastes #1709104 Raw Edit

Someone

public diff v1 · immutable
#1709104 ·published 2009-12-10 02:38 UTC
rendered paste body
diff --git a/xbmc/FileItem.cpp b/xbmc/FileItem.cppindex 1bbd405..8534e01 100644--- a/xbmc/FileItem.cpp+++ b/xbmc/FileItem.cpp@@ -2079,6 +2079,7 @@ void CFileItemList::Stack()     int64_t               size        = 0;     size_t                offset      = 0;     CStdString            stackName;+    CStdString            firstVolume;     CStdString            file1;     CStdString            filePath;     vector<int>           stack;@@ -2143,6 +2144,7 @@ void CFileItemList::Stack()                   if (stack.size() == 0)                   {                     stackName = Title1 + Ignore1 + Extension1;+                    firstVolume = Volume1;                     stack.push_back(i);                     size += item1->m_dwSize;                   }@@ -2193,26 +2195,30 @@ void CFileItemList::Stack()       }       if (stack.size() > 1)       {-        // have a stack, remove the items and add the stacked item-        CStackDirectory dir;-        // dont actually stack a multipart rar set, just remove all items but the first-        CStdString stackPath;-        if (Get(stack[0])->IsRAR())-          stackPath = Get(stack[0])->m_strPath;-        else-          stackPath = dir.ConstructStackPath(*this, stack);-        item1->m_strPath = stackPath;-        // clean up list-        for (unsigned k = 1; k < stack.size(); k++)-          Remove(i+1);-        // item->m_bIsFolder = true;  // don't treat stacked files as folders-        // the label may be in a different char set from the filename (eg over smb-        // the label is converted from utf8, but the filename is not)-        if (!g_guiSettings.GetBool("filelists.showextensions"))-          CUtil::RemoveExtension(stackName);-        item1->SetLabel(stackName);-        item1->m_dwSize = size;-        break;+        size_t needle;+        if ((needle = firstVolume.find_last_of("123456789")) == string::npos || firstVolume[needle] == '1')+        {+          // have a stack, remove the items and add the stacked item+          CStackDirectory dir;+          // dont actually stack a multipart rar set, just remove all items but the first+          CStdString stackPath;+          if (Get(stack[0])->IsRAR())+            stackPath = Get(stack[0])->m_strPath;+          else+            stackPath = dir.ConstructStackPath(*this, stack);+          item1->m_strPath = stackPath;+          // clean up list+          for (unsigned k = 1; k < stack.size(); k++)+            Remove(i+1);+          // item->m_bIsFolder = true;  // don't treat stacked files as folders+          // the label may be in a different char set from the filename (eg over smb+          // the label is converted from utf8, but the filename is not)+          if (!g_guiSettings.GetBool("filelists.showextensions"))+            CUtil::RemoveExtension(stackName);+          item1->SetLabel(stackName);+          item1->m_dwSize = size;+          break;+        }       }     }     i++;