Beispiel #1
0
bool CThumbIndex::OpenThumb(const CString& strFileName, const QString& strVersion)
{
    if (m_dbThumb.IsOpened())
        return true;

    try {
        m_dbThumb.open(strFileName);

        // need rebuild thumb index
        if (strVersion.isEmpty() || strVersion.toInt() < QString(WIZNOTE_THUMB_VERSION).toInt()) {
            if (m_dbThumb.tableExists("WIZ_ABSTRACT")) {
                m_dbThumb.execDML("drop table WIZ_ABSTRACT");
            }
        }

        if (!InitThumbDB())
            return false;

        return true;
    }
    catch (const CppSQLite3Exception& e)
    {
        TOLOG(e.errorMessage());
        return false;
    }
    catch (...) {
        TOLOG("Unknown exception while close DB");
        return false;
    }
}
Beispiel #2
0
bool CThumbIndex::OpenThumb(const CString& strFileName)
{
    if (m_dbThumb.IsOpened())
		return true;
	//
	try {
        m_dbThumb.open(strFileName);
		//
        if (!InitThumbDB())
			return false;
		//
		return true;
	}
	catch (const CppSQLite3Exception& e)
	{
		TOLOG(e.errorMessage());
		return false;
	}
	catch (...) {
		TOLOG("Unknown exception while close DB");
		return false;
	}
}