mirror of
https://github.com/clangen/musikcube.git
synced 2025-03-14 04:18:36 +00:00
Added ILibrary::IsConfigured()
This commit is contained in:
parent
c15033c77d
commit
4cfe49a061
@ -67,6 +67,7 @@ namespace musik { namespace core {
|
||||
virtual const std::string& Name() = 0;
|
||||
virtual void SetMessageQueue(musik::core::runtime::IMessageQueue& queue) = 0;
|
||||
virtual musik::core::runtime::IMessageQueue& GetMessageQueue() = 0;
|
||||
virtual bool IsConfigured() = 0;
|
||||
virtual void Close() = 0;
|
||||
};
|
||||
|
||||
|
@ -134,6 +134,12 @@ void LocalLibrary::Close() {
|
||||
}
|
||||
}
|
||||
|
||||
bool LocalLibrary::IsConfigured() {
|
||||
std::vector<std::string> paths;
|
||||
Indexer()->GetPaths(paths);
|
||||
return paths.size() > 0;
|
||||
}
|
||||
|
||||
std::string LocalLibrary::GetLibraryDirectory() {
|
||||
std::string directory(musik::core::GetDataDirectory());
|
||||
|
||||
|
@ -76,6 +76,7 @@ namespace musik { namespace core { namespace library {
|
||||
virtual const std::string& Name() override;
|
||||
virtual void SetMessageQueue(musik::core::runtime::IMessageQueue& queue) override;
|
||||
virtual musik::core::runtime::IMessageQueue& GetMessageQueue() override { return *messageQueue; }
|
||||
virtual bool IsConfigured() override;
|
||||
virtual void Close() override;
|
||||
|
||||
/* IMessageTarget */
|
||||
|
@ -130,6 +130,10 @@ void RemoteLibrary::Close() {
|
||||
}
|
||||
}
|
||||
|
||||
bool RemoteLibrary::IsConfigured() {
|
||||
return LibraryFactory::Instance().Default()->IsConfigured(); /* CAL TODO FIXME */
|
||||
}
|
||||
|
||||
int RemoteLibrary::Enqueue(QueryPtr query, unsigned int options, Callback callback) {
|
||||
if (QueryRegistry::IsLocalOnlyQuery(query->Name())) {
|
||||
auto defaultLocalLibrary = LibraryFactory::Instance().Default();
|
||||
|
@ -71,6 +71,7 @@ namespace musik { namespace core { namespace library {
|
||||
virtual const std::string& Name() override;
|
||||
virtual void SetMessageQueue(musik::core::runtime::IMessageQueue& queue) override;
|
||||
virtual musik::core::runtime::IMessageQueue& GetMessageQueue() override { return *messageQueue; }
|
||||
virtual bool IsConfigured() override;
|
||||
virtual void Close() override;
|
||||
|
||||
/* IMessageTarget */
|
||||
|
@ -112,9 +112,7 @@ MainLayout::MainLayout(
|
||||
|
||||
/* take user to settings if they don't have a valid configuration. otherwise,
|
||||
switch to the library view immediately */
|
||||
std::vector<std::string> paths;
|
||||
library->Indexer()->GetPaths(paths);
|
||||
this->SetLayout(paths.size() > 0 ? libraryLayout : settingsLayout);
|
||||
this->SetLayout(library->IsConfigured() ? libraryLayout : settingsLayout);
|
||||
this->SetAutoHideCommandBar(this->prefs->GetBool(prefs::keys::AutoHideCommandBar, false));
|
||||
|
||||
this->RunUpdateCheck();
|
||||
|
Loading…
x
Reference in New Issue
Block a user