shared,gui: SearchResult: remove page vector
Since the previous commit we don't group the results anymore, making the vector redundant
这个提交包含在:
父节点
eef0fae137
当前提交
10d61acbd0
@ -944,12 +944,8 @@ void MainWindow::makePreviews(int page)
|
||||
}
|
||||
RenderTarget renderTarget;
|
||||
renderTarget.path = sr.fileData.absPath;
|
||||
|
||||
for(unsigned int pagenum : sr.pages)
|
||||
{
|
||||
renderTarget.page = (int)pagenum;
|
||||
targets.append(renderTarget);
|
||||
}
|
||||
renderTarget.page = (int)sr.page;
|
||||
targets.append(renderTarget);
|
||||
}
|
||||
int numpages = ceil(static_cast<double>(targets.size()) / previewsPerPage);
|
||||
ui->spinPreviewPage->setMaximum(numpages);
|
||||
|
@ -6,7 +6,7 @@ class SearchResult
|
||||
{
|
||||
public:
|
||||
FileData fileData;
|
||||
QVector<unsigned int> pages;
|
||||
unsigned int page;
|
||||
bool wasContentSearch = false;
|
||||
};
|
||||
|
||||
|
@ -194,7 +194,7 @@ QSqlQuery SqliteSearch::makeSqlQuery(const LooqsQuery &query)
|
||||
sortSql = "ORDER BY rank";
|
||||
}
|
||||
}
|
||||
prepSql = "SELECT file.path AS path, content.page AS pages, file.mtime AS mtime, file.size AS size, "
|
||||
prepSql = "SELECT file.path AS path, content.page AS page, file.mtime AS mtime, file.size AS size, "
|
||||
"file.filetype AS filetype FROM file INNER JOIN content ON file.id = content.fileid " +
|
||||
joinSql + " WHERE 1=1 AND " + whereSql + " " + sortSql;
|
||||
}
|
||||
@ -204,7 +204,7 @@ QSqlQuery SqliteSearch::makeSqlQuery(const LooqsQuery &query)
|
||||
{
|
||||
sortSql = "ORDER BY file.mtime DESC";
|
||||
}
|
||||
prepSql = "SELECT file.path AS path, '0' as pages, file.mtime AS mtime, file.size AS size, file.filetype AS "
|
||||
prepSql = "SELECT file.path AS path, '0' as page, file.mtime AS mtime, file.size AS size, file.filetype AS "
|
||||
"filetype FROM file WHERE 1=1 AND " +
|
||||
whereSql + " " + sortSql;
|
||||
}
|
||||
@ -247,15 +247,7 @@ QVector<SearchResult> SqliteSearch::search(const LooqsQuery &query)
|
||||
result.fileData.mtime = dbQuery.value("mtime").toUInt();
|
||||
result.fileData.size = dbQuery.value("size").toUInt();
|
||||
result.fileData.filetype = dbQuery.value("filetype").toChar();
|
||||
QString pages = dbQuery.value("pages").toString();
|
||||
QStringList pagesList = pages.split(",");
|
||||
for(QString &page : pagesList)
|
||||
{
|
||||
if(page != "")
|
||||
{
|
||||
result.pages.append(page.toUInt());
|
||||
}
|
||||
}
|
||||
result.page = dbQuery.value("page").toUInt();
|
||||
result.wasContentSearch = contentSearch;
|
||||
results.append(result);
|
||||
}
|
||||
|
正在加载...
在新工单中引用
屏蔽一个用户