shared,gui: SearchResult: remove page vector
Since the previous commit we don't group the results anymore, making the vector redundant
Tento commit je obsažen v:
rodič
eef0fae137
revize
10d61acbd0
@ -944,12 +944,8 @@ void MainWindow::makePreviews(int page)
|
|||||||
}
|
}
|
||||||
RenderTarget renderTarget;
|
RenderTarget renderTarget;
|
||||||
renderTarget.path = sr.fileData.absPath;
|
renderTarget.path = sr.fileData.absPath;
|
||||||
|
renderTarget.page = (int)sr.page;
|
||||||
for(unsigned int pagenum : sr.pages)
|
targets.append(renderTarget);
|
||||||
{
|
|
||||||
renderTarget.page = (int)pagenum;
|
|
||||||
targets.append(renderTarget);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
int numpages = ceil(static_cast<double>(targets.size()) / previewsPerPage);
|
int numpages = ceil(static_cast<double>(targets.size()) / previewsPerPage);
|
||||||
ui->spinPreviewPage->setMaximum(numpages);
|
ui->spinPreviewPage->setMaximum(numpages);
|
||||||
|
@ -6,7 +6,7 @@ class SearchResult
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
FileData fileData;
|
FileData fileData;
|
||||||
QVector<unsigned int> pages;
|
unsigned int page;
|
||||||
bool wasContentSearch = false;
|
bool wasContentSearch = false;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -194,7 +194,7 @@ QSqlQuery SqliteSearch::makeSqlQuery(const LooqsQuery &query)
|
|||||||
sortSql = "ORDER BY rank";
|
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 " +
|
"file.filetype AS filetype FROM file INNER JOIN content ON file.id = content.fileid " +
|
||||||
joinSql + " WHERE 1=1 AND " + whereSql + " " + sortSql;
|
joinSql + " WHERE 1=1 AND " + whereSql + " " + sortSql;
|
||||||
}
|
}
|
||||||
@ -204,7 +204,7 @@ QSqlQuery SqliteSearch::makeSqlQuery(const LooqsQuery &query)
|
|||||||
{
|
{
|
||||||
sortSql = "ORDER BY file.mtime DESC";
|
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 " +
|
"filetype FROM file WHERE 1=1 AND " +
|
||||||
whereSql + " " + sortSql;
|
whereSql + " " + sortSql;
|
||||||
}
|
}
|
||||||
@ -247,15 +247,7 @@ QVector<SearchResult> SqliteSearch::search(const LooqsQuery &query)
|
|||||||
result.fileData.mtime = dbQuery.value("mtime").toUInt();
|
result.fileData.mtime = dbQuery.value("mtime").toUInt();
|
||||||
result.fileData.size = dbQuery.value("size").toUInt();
|
result.fileData.size = dbQuery.value("size").toUInt();
|
||||||
result.fileData.filetype = dbQuery.value("filetype").toChar();
|
result.fileData.filetype = dbQuery.value("filetype").toChar();
|
||||||
QString pages = dbQuery.value("pages").toString();
|
result.page = dbQuery.value("page").toUInt();
|
||||||
QStringList pagesList = pages.split(",");
|
|
||||||
for(QString &page : pagesList)
|
|
||||||
{
|
|
||||||
if(page != "")
|
|
||||||
{
|
|
||||||
result.pages.append(page.toUInt());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
result.wasContentSearch = contentSearch;
|
result.wasContentSearch = contentSearch;
|
||||||
results.append(result);
|
results.append(result);
|
||||||
}
|
}
|
||||||
|
Načítá se…
Odkázat v novém úkolu
Zablokovat Uživatele