From dcefa4afb1c0cf56e869f129719c34f3f0a4b1fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20=C3=96nnerby?= Date: Mon, 21 Apr 2008 19:22:23 +0000 Subject: [PATCH] - Fixed sending the "clear" flag even when empty results are send from the musik::core::Query::ListSelection (issue 15). - Fixed a small bug in the MetadataFilter. --- src/core/Query/ListSelection.cpp | 5 +++++ src/cube/MetadataFilterModel.cpp | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/core/Query/ListSelection.cpp b/src/core/Query/ListSelection.cpp index c98c03682..8f8a47665 100644 --- a/src/core/Query/ListSelection.cpp +++ b/src/core/Query/ListSelection.cpp @@ -540,6 +540,11 @@ void Query::ListSelection::QueryForMetadata(const char *metakey,const char *sql, tempMetadataValues.reserve(10); int row(0); + { + boost::mutex::scoped_lock lock(oLibrary->oResultMutex); + this->metadataResults[metakey]; + } + while(metaValueStmt.Step()==db::ReturnCode::Row){ tempMetadataValues.push_back( MetadataValuePtr( diff --git a/src/cube/MetadataFilterModel.cpp b/src/cube/MetadataFilterModel.cpp index 1015e1950..368b8208c 100644 --- a/src/cube/MetadataFilterModel.cpp +++ b/src/cube/MetadataFilterModel.cpp @@ -67,7 +67,7 @@ uistring MetadataFilterModel::CellValueToString(int rowIndex, ListView::Colum return (format(_T("All (%1% %2%)")) % this->metadata.size() % this->controller->metadataKey).str(); } - if(rowIndexmetadata.size()){ + if(rowIndex<=this->metadata.size()){ return win32cpp::Escape(this->metadata[rowIndex-1]->value); }else{ return uistring();