Back to index

unity  6.0.0
Public Member Functions | Public Attributes
unity::dash::FilesystemLenses::Impl Class Reference
Collaboration diagram for unity::dash::FilesystemLenses::Impl:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 Impl (FilesystemLenses *owner, LensDirectoryReader::Ptr const &reader)
 ~Impl ()
void OnLoadingFinished ()
LensList GetLenses () const
Lens::Ptr GetLens (std::string const &lens_id) const
Lens::Ptr GetLensAtIndex (std::size_t index) const
Lens::Ptr GetLensForShortcut (std::string const &lens_shortcut) const
std::size_t count () const

Public Attributes

FilesystemLensesowner_
LensDirectoryReader::Ptr reader_
LensList lenses_
sigc::connection finished_slot_
glib::Source::UniquePtr load_idle_

Detailed Description

Definition at line 349 of file FilesystemLenses.cpp.


Constructor & Destructor Documentation

Definition at line 373 of file FilesystemLenses.cpp.

  : owner_(owner)
  , reader_(reader)
{
  finished_slot_ = reader_->load_finished.connect(sigc::mem_fun(this, &Impl::OnLoadingFinished));
  if (reader_->IsDataLoaded())
  {
    // we won't get any signal, so let's just emit our signals after construction
    load_idle_.reset(new glib::Idle([&] () {
      OnLoadingFinished();
      return false;
    }, glib::Source::Priority::DEFAULT));
  }
}

Here is the call graph for this function:

Definition at line 353 of file FilesystemLenses.cpp.

  {
    finished_slot_.disconnect();
  }

Member Function Documentation

Definition at line 455 of file FilesystemLenses.cpp.

{
  return lenses_.size();
}

Here is the caller graph for this function:

Lens::Ptr unity::dash::FilesystemLenses::Impl::GetLens ( std::string const &  lens_id) const

Definition at line 416 of file FilesystemLenses.cpp.

{
  for (auto lens: lenses_)
  {
    if (lens->id == lens_id)
    {
      return lens;
    }
  }

  return Lens::Ptr();
}

Here is the caller graph for this function:

Definition at line 429 of file FilesystemLenses.cpp.

{
  try
  {
    return lenses_.at(index);
  }
  catch (std::out_of_range& error)
  {
    LOG_WARN(logger) << error.what();
  }
  return Lens::Ptr();
}

Here is the caller graph for this function:

Definition at line 411 of file FilesystemLenses.cpp.

{
  return lenses_;
}

Here is the caller graph for this function:

Lens::Ptr unity::dash::FilesystemLenses::Impl::GetLensForShortcut ( std::string const &  lens_shortcut) const

Definition at line 442 of file FilesystemLenses.cpp.

{
  for (auto lens: lenses_)
  {
    if (lens->shortcut == lens_shortcut)
    {
      return lens;
    }
  }

  return Lens::Ptr();
}

Here is the caller graph for this function:

Definition at line 388 of file FilesystemLenses.cpp.

{
  // FIXME: clear lenses_ first?
  for (auto lens_data : reader_->GetLensData())
  {
    Lens::Ptr lens(new Lens(lens_data->id,
                            lens_data->dbus_name,
                            lens_data->dbus_path,
                            lens_data->name,
                            lens_data->icon,
                            lens_data->description,
                            lens_data->search_hint,
                            lens_data->visible,
                            lens_data->shortcut));
    lenses_.push_back (lens);
  }

  for (Lens::Ptr& lens: lenses_)
    owner_->lens_added.emit(lens);

  owner_->lenses_loaded.emit();
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 369 of file FilesystemLenses.cpp.

Definition at line 368 of file FilesystemLenses.cpp.

Definition at line 370 of file FilesystemLenses.cpp.

Definition at line 366 of file FilesystemLenses.cpp.

Definition at line 367 of file FilesystemLenses.cpp.


The documentation for this class was generated from the following file: