MCPcopy Create free account
hub / github.com/YACReader/yacreader / getFolderName

Method getFolderName

YACReaderLibrary/db_helper.cpp:171–193  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

169}
170
171QString DBHelper::getFolderName(qulonglong libraryId, qulonglong id)
172{
173 QString libraryPath = DBHelper::getLibraries().getPath(libraryId);
174
175 QString name = "";
176 QString connectionName = "";
177
178 {
179 QSqlDatabase db = DataBaseManagement::loadDatabase(LibraryPaths::libraryDataPath(libraryPath));
180 QSqlQuery selectQuery(db); // TODO check
181 selectQuery.prepare("SELECT name FROM folder WHERE id = :id");
182 selectQuery.bindValue(":id", id);
183 selectQuery.exec();
184
185 if (selectQuery.next()) {
186 name = selectQuery.value(0).toString();
187 }
188 connectionName = db.connectionName();
189 }
190
191 QSqlDatabase::removeDatabase(connectionName);
192 return name;
193}
194
195Folder DBHelper::getFolder(qulonglong libraryId, qulonglong id)
196{

Callers

nothing calls this directly

Calls 5

getPathMethod · 0.80
bindValueMethod · 0.80
execMethod · 0.80
toStringMethod · 0.80
nextMethod · 0.45

Tested by

no test coverage detected