title filter

This commit is contained in:
2019-04-01 21:43:52 +02:00
parent 7bccf8fb19
commit b11d4d19e5
2 changed files with 13 additions and 2 deletions
+10 -1
View File
@@ -55,7 +55,7 @@ cMainWindow::cMainWindow(cSplashScreen* lpSplashScreen, QWidget *parent) :
QSettings settings;
m_szOldPath = settings.value("file/lastPath", QDir::homePath()).toString();
m_pictureLibrary.openDatabase(m_szOldPath);
loadData(true);
loadData(false);
updateRecentFileActions();
showCount();
@@ -709,6 +709,7 @@ void cMainWindow::onChangeTitle()
}
m_lpFolderSortFilterProxyModel->sort(0);
m_lpThumbnailSortFilterProxyModel->invalidate();
showCount();
}
void cMainWindow::onChangeDate()
@@ -766,6 +767,7 @@ void cMainWindow::onChangeDate()
}
m_lpFolderSortFilterProxyModel->sort(0);
m_lpThumbnailSortFilterProxyModel->invalidate();
showCount();
}
void cMainWindow::onChangeDateTime()
@@ -806,6 +808,7 @@ void cMainWindow::onChangeDateTime()
m_lpThumbnailSortFilterProxyModel->invalidate();
}
showCount();
}
}
@@ -898,6 +901,7 @@ void cMainWindow::onTagEdited(cTag* /*lpTag*/)
void cMainWindow::onTagListChanged()
{
m_lpFilterPanel->updateTagList();
showCount();
}
void cMainWindow::onPersonAdded(cPerson* /*lpPerson*/)
@@ -915,6 +919,7 @@ void cMainWindow::onPersonEdited(cPerson* /*lpPerson*/)
void cMainWindow::onPersonListChanged()
{
m_lpFilterPanel->updatePersonList();
showCount();
}
void cMainWindow::onLocationAdded(cLocation* /*lpLocation*/)
@@ -940,6 +945,7 @@ void cMainWindow::onFilterTitleChanged(QStringList titleList)
return;
m_lpThumbnailSortFilterProxyModel->setTitleList(titleList);
showCount();
}
void cMainWindow::onFilterPersonChanged(QList<qint32> idList, bool bAnd)
@@ -948,6 +954,7 @@ void cMainWindow::onFilterPersonChanged(QList<qint32> idList, bool bAnd)
return;
m_lpThumbnailSortFilterProxyModel->setPersonList(idList, bAnd);
showCount();
}
void cMainWindow::onFilterLocationChanged(QList<qint32> idList, bool bAnd)
@@ -956,6 +963,7 @@ void cMainWindow::onFilterLocationChanged(QList<qint32> idList, bool bAnd)
return;
m_lpThumbnailSortFilterProxyModel->setLocationList(idList, bAnd);
showCount();
}
void cMainWindow::onFilterTagChanged(QList<qint32> idList, bool bAnd)
@@ -964,4 +972,5 @@ void cMainWindow::onFilterTagChanged(QList<qint32> idList, bool bAnd)
return;
m_lpThumbnailSortFilterProxyModel->setTagList(idList, bAnd);
showCount();
}
+3 -1
View File
@@ -33,6 +33,8 @@ QStringList cThumbnailSortFilterProxyModel::titleList()
void cThumbnailSortFilterProxyModel::setTitleList(const QStringList& titleList)
{
m_titleList = titleList;
invalidateFilter();
}
QList<qint32> cThumbnailSortFilterProxyModel::personList()
@@ -103,7 +105,7 @@ bool cThumbnailSortFilterProxyModel::filterAcceptsRow(int sourceRow, const QMode
if(!bValid)
return(false);
if(!m_titleList.contains(lpPicture->title()))
if(!m_titleList.contains(lpPicture->title()) && !m_titleList.isEmpty())
return(false);
if(!m_personList.isEmpty())