MCPcopy Create free account
hub / github.com/KangLin/RabbitRemoteControl / IsExist

Method IsExist

Src/Database/Database.cpp:859–879  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

857}
858
859bool CDatabaseFile::IsExist(const QString &szFile)
860{
861 QSqlQuery query(GetDatabase());
862 bool ok = query.prepare("SELECT * from " + m_szTableName +
863 " WHERE `file`=:file");
864 if(!ok) {
865 SetError("Failed to prepare: " + query.executedQuery()
866 + "; Error: " + query.lastError().text());
867 qCritical(log) << GetError();
868 return false;
869 }
870 query.bindValue(":file", szFile);
871 ok = query.exec();
872 if(!ok) {
873 SetError("Failed to exec: " + query.executedQuery()
874 + "; Error: " + query.lastError().text());
875 qCritical(log) << GetError();
876 return false;
877 }
878 return query.next();
879}
880
881QString CDatabaseFile::GetFile(const QString &szFile)
882{

Callers 1

HasFileContentsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected