示例#1
0
static void
ephy_sqlite_connection_finalize (GObject *self)
{
  g_free (EPHY_SQLITE_CONNECTION (self)->database_path);
  ephy_sqlite_connection_close (EPHY_SQLITE_CONNECTION (self));
  G_OBJECT_CLASS (ephy_sqlite_connection_parent_class)->finalize (self);
}
示例#2
0
EphySQLiteConnection *
ephy_sqlite_connection_new (EphySQLiteConnectionMode mode, const char *database_path)
{
  return EPHY_SQLITE_CONNECTION (g_object_new (EPHY_TYPE_SQLITE_CONNECTION,
                                               "mode", mode,
                                               "database-path", database_path,
                                               NULL));
}
static void
ephy_sqlite_statement_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec)
{
  EphySQLiteStatement *self = EPHY_SQLITE_STATEMENT (object);

  switch (property_id) {
    case PROP_PREPARED_STATEMENT:
      self->priv->prepared_statement = g_value_get_pointer (value);
      break;
    case PROP_CONNECTION:
      self->priv->connection = EPHY_SQLITE_CONNECTION (g_object_ref (g_value_get_object (value)));
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (self, property_id, pspec);
      break;
  }
}
示例#4
0
static void
ephy_sqlite_connection_set_property (GObject      *object,
                                     guint         property_id,
                                     const GValue *value,
                                     GParamSpec   *pspec)
{
  EphySQLiteConnection *self = EPHY_SQLITE_CONNECTION (object);

  switch (property_id) {
    case PROP_MODE:
      self->mode = g_value_get_enum (value);
      break;
    case PROP_DATABASE_PATH:
      self->database_path = g_value_dup_string (value);
      break;
    default:
      G_OBJECT_WARN_INVALID_PROPERTY_ID (self, property_id, pspec);
      break;
  }
}
示例#5
0
EphySQLiteConnection *
ephy_sqlite_connection_new (void)
{
  return EPHY_SQLITE_CONNECTION (g_object_new (EPHY_TYPE_SQLITE_CONNECTION, NULL));
}