Back to index

unity  6.0.0
Public Member Functions | Static Public Member Functions | Public Attributes
unity::dash::LensDirectoryReader::LensFileData Struct Reference

#include <FilesystemLenses.h>

Collaboration diagram for unity::dash::LensDirectoryReader::LensFileData:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 LensFileData (GKeyFile *file, const gchar *lens_id)

Static Public Member Functions

static bool IsValid (GKeyFile *file, glib::Error &error)

Public Attributes

glib::String id
glib::String domain
glib::String dbus_name
glib::String dbus_path
glib::String name
glib::String icon
glib::String description
glib::String search_hint
bool visible
glib::String shortcut

Detailed Description

Definition at line 37 of file FilesystemLenses.h.


Constructor & Destructor Documentation

unity::dash::LensDirectoryReader::LensFileData::LensFileData ( GKeyFile *  file,
const gchar *  lens_id 
)

Definition at line 50 of file FilesystemLenses.cpp.

  : id(g_strdup(lens_id))
  , domain(g_key_file_get_string(file, G_KEY_FILE_DESKTOP_GROUP, "X-Ubuntu-Gettext-Domain", NULL))
  , dbus_name(g_key_file_get_string(file, GROUP, "DBusName", NULL))
  , dbus_path(g_key_file_get_string(file, GROUP, "DBusPath", NULL))
  , name(g_strdup(g_dgettext(domain.Value(), glib::String(g_key_file_get_string(file, GROUP, "Name", NULL)))))
  , icon(g_key_file_get_string(file, GROUP, "Icon", NULL))
  , description(g_key_file_get_locale_string(file, GROUP, "Description", NULL, NULL))
  , search_hint(g_key_file_get_locale_string(file, GROUP, "SearchHint", NULL, NULL))
  , visible(true)
  , shortcut(g_key_file_get_string(file, GROUP, "Shortcut", NULL))
{
  if (g_key_file_has_key(file, GROUP, "Visible", NULL))
  {
    visible = g_key_file_get_boolean(file, GROUP, "Visible", NULL) != FALSE;
  }
}

Member Function Documentation

bool unity::dash::LensDirectoryReader::LensFileData::IsValid ( GKeyFile *  file,
glib::Error error 
) [static]

Definition at line 69 of file FilesystemLenses.cpp.

{
  return (g_key_file_has_group(file, GROUP) &&
          g_key_file_has_key(file, GROUP, "DBusName", &error) &&
          g_key_file_has_key(file, GROUP, "DBusPath", &error) &&
          g_key_file_has_key(file, GROUP, "Name", &error) &&
          g_key_file_has_key(file, GROUP, "Icon", &error));
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 44 of file FilesystemLenses.h.

Definition at line 45 of file FilesystemLenses.h.

Definition at line 48 of file FilesystemLenses.h.

Definition at line 43 of file FilesystemLenses.h.

Definition at line 47 of file FilesystemLenses.h.

Definition at line 42 of file FilesystemLenses.h.

Definition at line 46 of file FilesystemLenses.h.

Definition at line 49 of file FilesystemLenses.h.

Definition at line 51 of file FilesystemLenses.h.

Definition at line 50 of file FilesystemLenses.h.


The documentation for this struct was generated from the following files: