From b5e76bca01b1436622c3164ce5db368dd4d79df5 Mon Sep 17 00:00:00 2001 From: shun-iwasawa Date: May 24 2018 07:45:18 +0000 Subject: fix sequential check (#1997) --- diff --git a/toonz/sources/common/tsystem/tfilepath.cpp b/toonz/sources/common/tsystem/tfilepath.cpp index 4ca7c80..a095427 100644 --- a/toonz/sources/common/tsystem/tfilepath.cpp +++ b/toonz/sources/common/tsystem/tfilepath.cpp @@ -20,6 +20,7 @@ const char wauxslash = '\\'; #include "tfilepath.h" #include "tconvert.h" +#include "tfiletype.h" #include #include #include @@ -73,12 +74,13 @@ bool isNumbers(std::wstring str, int fromSeg, int toSeg) { } bool checkForSeqNum(QString type) { - if (type == "myb" || type == "tlv" || type == "pli" || type == "tpl" || - type == "tnz") + TFileType::Type typeInfo = TFileType::getInfoFromExtension(type); + if ((typeInfo & TFileType::IMAGE) && !(typeInfo & TFileType::LEVEL)) + return true; + else return false; - return true; } -}; +}; // namespace // TFrameId::operator string() const std::string TFrameId::expand(FrameFormat format) const { @@ -285,10 +287,9 @@ void TFilePath::setPath(std::wstring path) { m_path.length() > 1 && m_path[m_path.length() - 1] == wslash) m_path.erase(m_path.length() - 1, 1); - if (isUncName && - !(m_path.find_last_of(L'\\') > 1 || - m_path.find_last_of(L'/') > - 1)) // e' indicato solo il nome della macchina... + if (isUncName && !(m_path.find_last_of(L'\\') > 1 || + m_path.find_last_of(L'/') > + 1)) // e' indicato solo il nome della macchina... m_path.append(1, wslash); } @@ -631,8 +632,9 @@ TFilePath TFilePath::getParentDir() const // noSlash! { int i = getLastSlash(m_path); // cerco l'ultimo slash if (i < 0) { - if (m_path.length() >= 2 && ('a' <= m_path[0] && m_path[0] <= 'z' || - 'A' <= m_path[0] && m_path[0] <= 'Z') && + if (m_path.length() >= 2 && + ('a' <= m_path[0] && m_path[0] <= 'z' || + 'A' <= m_path[0] && m_path[0] <= 'Z') && m_path[1] == ':') return TFilePath(m_path.substr(0, 2)); else @@ -683,7 +685,7 @@ TFrameId TFilePath::getFrame() const { digits++; number = number * 10 + str[k] - L'0'; } - char letter = '\0'; + char letter = '\0'; if (iswalpha(str[k])) letter = str[k++] + ('a' - L'a'); if (number == 0 || k < i) // || letter!='\0')