From cd872221182725b4961da64af2950f6829ff898f Mon Sep 17 00:00:00 2001 From: Casey Langen Date: Sun, 26 Jun 2016 16:40:14 -0700 Subject: [PATCH] - Removed bootstrap.sh, not used anymore - Wired up automatic updating in browse view while syncing - Fixed bug where BrowseView may still have contents in the TrackListView after clearing the library. --- CMakeLists.txt | 9 +++++++-- bootstrap.sh | 19 ------------------- src/musikbox/app/layout/BrowseLayout.cpp | 9 +++++++++ src/musikbox/app/layout/BrowseLayout.h | 1 + src/musikbox/app/window/TrackListView.cpp | 2 +- 5 files changed, 18 insertions(+), 22 deletions(-) delete mode 100755 bootstrap.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index bc01482a3..383136b4e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,3 +1,6 @@ +#cmake -DCMAKE_BUILD_TYPE=Release . +#cmake -DCMAKE_BUILD_TYPE=Debug . + cmake_minimum_required(VERSION 3.0) project(musikbox) @@ -16,7 +19,9 @@ ExternalProject_Add(taglib INSTALL_COMMAND make install ) -set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -fpermissive -g") +set(CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} "-std=c++11 -fpermissive") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -g") +set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} -O2") set (BOOST_LIBS system @@ -45,7 +50,7 @@ set (BOOST_LINK_LIBS set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/Modules) -SET (CMAKE_BUILD_TYPE DEBUG) +# SET (CMAKE_BUILD_TYPE DEBUG) set (LIBRARY_OUTPUT_PATH ${musikbox_SOURCE_DIR}/bin/plugins) set (EXECUTABLE_OUTPUT_PATH ${musikbox_SOURCE_DIR}/bin) diff --git a/bootstrap.sh b/bootstrap.sh deleted file mode 100755 index 2921de730..000000000 --- a/bootstrap.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/bash - -rm CMakeCache.txt - -rm -rf build -rm -rf bin - -mkdir -p bin/plugins -mkdir build - -mkdir build/release -cd build/release/ -cmake -DCMAKE_BUILD_TYPE=Release ../../ -cd ../../ - -mkdir build/debug -cd build/debug/ -cmake -DCMAKE_BUILD_TYPE=Debug ../../ -cd ../../ diff --git a/src/musikbox/app/layout/BrowseLayout.cpp b/src/musikbox/app/layout/BrowseLayout.cpp index 09d2f99cd..cb7f0dc8f 100755 --- a/src/musikbox/app/layout/BrowseLayout.cpp +++ b/src/musikbox/app/layout/BrowseLayout.cpp @@ -59,6 +59,8 @@ BrowseLayout::BrowseLayout( : LayoutBase() , playback(playback) { this->library = library; + this->library->Indexer()->TrackRefreshed.connect(this, &BrowseLayout::OnIndexerProgress); + this->library->Indexer()->SynchronizeEnd.connect(this, &BrowseLayout::OnIndexerProgress); this->InitializeWindows(); } @@ -118,6 +120,10 @@ void BrowseLayout::OnVisibilityChanged(bool visible) { } } +void BrowseLayout::OnIndexerProgress() { + this->categoryList->Requery(); +} + void BrowseLayout::RequeryTrackList(ListWindow *view) { if (view == this->categoryList.get()) { DBID selectedId = this->categoryList->GetSelectedId(); @@ -128,6 +134,9 @@ void BrowseLayout::RequeryTrackList(ListWindow *view) { this->categoryList->GetFieldName(), selectedId))); } + else { + this->trackList->Clear(); + } } } diff --git a/src/musikbox/app/layout/BrowseLayout.h b/src/musikbox/app/layout/BrowseLayout.h index 2c90bee45..024041a37 100755 --- a/src/musikbox/app/layout/BrowseLayout.h +++ b/src/musikbox/app/layout/BrowseLayout.h @@ -71,6 +71,7 @@ namespace musik { private: void InitializeWindows(); + void OnIndexerProgress(); void RequeryTrackList(ListWindow *view); void OnCategoryViewSelectionChanged( diff --git a/src/musikbox/app/window/TrackListView.cpp b/src/musikbox/app/window/TrackListView.cpp index 635681cdf..f960afdef 100755 --- a/src/musikbox/app/window/TrackListView.cpp +++ b/src/musikbox/app/window/TrackListView.cpp @@ -215,4 +215,4 @@ IScrollAdapter::EntryPtr TrackListView::Adapter::GetEntry(size_t index) { entry->SetAttrs(attrs); return entry; } -} \ No newline at end of file +}