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

Method GetId

Plugins/WebBrowser/DatabaseUrl.cpp:294–316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

292}
293
294int CDatabaseUrl::GetId(const QString& url)
295{
296 if (url.isEmpty()) return 0;
297 QSqlQuery query(GetDatabase());
298 bool bRet = query.prepare("SELECT id, title, icon FROM " + m_szTableName +
299 " WHERE url = :url");
300 if(!bRet) {
301 SetError("Failed to get id prepare: " + query.lastError().text() + "; url: " + url);
302 qCritical(log) << GetError();
303 return 0;
304 }
305 query.bindValue(":url", url);
306 bRet = query.exec();
307 if (!bRet) {
308 SetError("Failed to get id: " + query.lastError().text()
309 + "; Sql: " + query.executedQuery() + "; url: " + url);
310 qCritical(log) << GetError();
311 }
312 if(query.next()) {
313 return query.value(0).toInt();
314 }
315 return 0;
316}
317
318QList<int> CDatabaseUrl::GetDomain(const QString &szDomain)
319{

Callers 6

getBookmarkMethod · 0.45
BookmarkToTreeMethod · 0.45
TreeToBookmarkMethod · 0.45
addHistoryEntryMethod · 0.45
updateHistoryEntryMethod · 0.45
deleteHistoryEntryMethod · 0.45

Calls 1

isEmptyMethod · 0.45

Tested by

no test coverage detected