added new view for empty folders in YACReaderLibrary that shows a list with all the subfolders

TODO ?use a special case for the root folder?
This commit is contained in:
Luis Ángel San Martín
2014-07-09 17:38:12 +02:00
parent 9f53ae6efc
commit 1b2f33d0c6
14 changed files with 322 additions and 122 deletions

View File

@ -671,5 +671,18 @@ ComicInfo DBHelper::loadComicInfo(QString hash, QSqlDatabase & db)
else
comicInfo.existOnDb = false;
return comicInfo;
return comicInfo;
}
QList<QString> DBHelper::loadSubfoldersNames(qulonglong folderId, QSqlDatabase &db)
{
QList<QString> result;
QSqlQuery selectQuery(db);
selectQuery.prepare("SELECT name FROM folder WHERE parentId = :parentId AND id <> 1"); //do not select the root folder
selectQuery.bindValue(":parentId", folderId);
selectQuery.exec();
while(selectQuery.next()){
result << selectQuery.record().value("name").toString();
}
return result;
}