The KatzeNet is always a singleton, no need to pass it around.
GtkWidget* webview;
GtkWidget* delete;
GdkPixbuf* pixbuf;
- KatzeNet* net;
};
struct _FeedPanelClass
FeedPanel* panel = FEED_PANEL (object);
g_object_unref (panel->pixbuf);
- g_object_unref (panel->net);
}
static void
gtk_icon_factory_add_default (factory);
g_object_unref (factory);
- panel->net = katze_net_new ();
-
model = gtk_tree_store_new (1, KATZE_TYPE_ITEM);
treeview = gtk_tree_view_new_with_model (GTK_TREE_MODEL (model));
panel->treeview = treeview;
MidoriExtension* extension;
GtkWidget* panel;
KatzeArray* feeds;
- KatzeNet* net;
GSList* parsers;
guint source_id;
g_source_remove (priv->source_id);
g_slist_foreach (priv->parsers, (GFunc)g_free, NULL);
g_slist_free (priv->parsers);
- if (priv->feeds)
- g_object_unref (priv->net);
if (priv->feeds)
g_object_unref (priv->feeds);
gtk_widget_destroy (priv->panel);
netpriv->extension = priv->extension;
netpriv->feed = KATZE_ARRAY (feed);
- katze_net_load_uri (priv->net,
+ katze_net_load_uri (NULL,
katze_item_get_uri (feed),
(KatzeNetStatusCb) feed_status_cb,
(KatzeNetTransferCb) feed_transfer_cb,
GtkWidget* addon;
GtkActionGroup* action_group;
GtkAction* action;
- KatzeNet* net;
KatzeArray* feeds;
KatzeArray* feed;
FeedPrivate* priv;
midori_panel_append_page (MIDORI_PANEL (panel), MIDORI_VIEWABLE (addon));
g_object_unref (panel);
- net = katze_net_new ();
feeds = katze_array_new (KATZE_TYPE_ARRAY);
feed_panel_add_feeds (FEED_PANEL (addon), KATZE_ITEM (feeds));
priv->extension = extension;
priv->browser = browser;
priv->panel = addon;
- priv->net = net;
priv->feeds = feeds;
priv->parsers = g_slist_prepend (priv->parsers, atom_init_parser ());
priv->parsers = g_slist_prepend (priv->parsers, rss_init_parser ());
* Instantiates a new #KatzeNet instance.
*
* Return value: a new #KatzeNet
+ *
+ * Deprecated: 0.2.7
**/
KatzeNet*
katze_net_new (void)
*
* Return value: a session, or %NULL
*
- * Since: 0.1.3
+ * Deprecated: 0.2.7: Use webkit_get_default_session ().
**/
gpointer
katze_net_get_session (KatzeNet* net)
{
g_return_val_if_fail (KATZE_IS_NET (net), NULL);
- return net->session;
+ return webkit_get_default_session ();
}
typedef struct
gchar* cached_filename;
gchar* cached_path;
+ if (!net)
+ net = katze_net_new ();
+
if (subfolder)
cache_path = g_build_filename (net->cache_path, subfolder, NULL);
else
/**
* katze_net_load_uri:
- * @net: a #KatzeNet
+ * @net: a #KatzeNet, or %NULL
* @uri: an URI string
* @status_cb: function to call for status information
* @transfer_cb: function to call upon transfer
KatzeNetPriv* priv;
SoupMessage* msg;
- g_return_if_fail (KATZE_IS_NET (net));
g_return_if_fail (uri != NULL);
if (!status_cb && !transfer_cb)
return;
+ if (net == NULL)
+ net = katze_net_new ();
+
request = g_new0 (KatzeNetRequest, 1);
request->uri = g_strdup (uri);
request->mime_type = NULL;
KatzeArray* history;
gboolean show_tabs;
- KatzeNet* net;
-
gboolean show_navigationbar;
gboolean show_statusbar;
gboolean speed_dial_in_new_tabs;
webkit_download_start (download);
g_free (destination);
#else
- katze_net_load_uri (browser->net, uri, NULL,
+ katze_net_load_uri (NULL, uri, NULL,
(KatzeNetTransferCb)midori_browser_save_transfer_cb, filename);
#endif
GtkWidget* source;
GtkWidget* web_view;
- source = midori_view_new (browser->net);
+ source = midori_view_new (NULL);
midori_view_set_settings (MIDORI_VIEW (source), browser->settings);
midori_view_set_uri (MIDORI_VIEW (source), "");
web_view = midori_view_get_web_view (MIDORI_VIEW (source));
g_free (filename);
return;
}
- katze_net_load_uri (browser->net, uri, NULL,
+ katze_net_load_uri (NULL, uri, NULL,
(KatzeNetTransferCb)midori_browser_source_transfer_cb, browser);
g_free (text_editor);
}
button = g_object_get_data (G_OBJECT (dialog), "cookies");
if (gtk_toggle_button_get_active (button))
{
- SoupSession* session = katze_net_get_session (browser->net);
+ SoupSession* session = webkit_get_default_session ();
SoupSessionFeature* jar = soup_session_get_feature (session,
SOUP_TYPE_COOKIE_JAR);
GSList* cookies = soup_cookie_jar_all_cookies (SOUP_COOKIE_JAR (jar));
view = g_object_new (MIDORI_TYPE_VIEW,
"settings", browser->settings,
- "net", browser->net, NULL);
+ NULL);
midori_view_set_uri (MIDORI_VIEW (view), "");
gtk_widget_show (view);
g_object_set_data (G_OBJECT (view), "midori-view-append", (void*)1);
GtkWidget* scrolled;
GtkWidget* icon;
- browser->net = katze_net_new ();
-
browser->settings = midori_web_settings_new ();
browser->proxy_array = katze_array_new (KATZE_TYPE_ARRAY);
browser->bookmarks = NULL;
katze_object_assign (browser->search_engines, NULL);
katze_object_assign (browser->history, NULL);
- katze_object_assign (browser->net, NULL);
-
katze_assign (browser->news_aggregator, NULL);
G_OBJECT_CLASS (midori_browser_parent_class)->finalize (object);
view = g_object_new (MIDORI_TYPE_VIEW,
"title", title,
"settings", browser->settings,
- "net", browser->net,
NULL);
midori_view_set_uri (MIDORI_VIEW (view), uri);
gtk_widget_show (view);
g_return_val_if_fail (uri != NULL, -1);
view = g_object_new (MIDORI_TYPE_VIEW, "settings", browser->settings,
- "net", browser->net, NULL);
+ NULL);
midori_view_set_uri (MIDORI_VIEW (view), uri);
gtk_widget_show (view);
icon_uri = g_strdup_printf ("%s/favicon.ico", view->uri);
}
- icon_file = katze_net_get_cached_path (view->net, icon_uri, "icons");
+ icon_file = katze_net_get_cached_path (NULL, icon_uri, "icons");
if (g_hash_table_lookup_extended (view->memory,
icon_file, NULL, (gpointer)&pixbuf))
{
priv->icon_uri = icon_uri;
priv->view = view;
- katze_net_load_uri (view->net, icon_uri,
+ katze_net_load_uri (NULL, icon_uri,
(KatzeNetStatusCb)katze_net_icon_status_cb,
(KatzeNetTransferCb)katze_net_icon_transfer_cb, priv);
}
else
{
new_view = g_object_new (MIDORI_TYPE_VIEW,
- "net", view->net,
"settings", view->settings,
NULL);
midori_view_construct_web_view (new_view);
break;
case PROP_NET:
katze_object_assign (view->net, g_value_dup_object (value));
- if (!view->net)
- view->net = katze_net_new ();
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
/**
* midori_view_new:
- * @net: a #KatzeNet
+ * @net: a #KatzeNet, or %NULL
*
* Creates a new view.
*
GtkWidget*
midori_view_new (KatzeNet* net)
{
- g_return_val_if_fail (!net || KATZE_IS_NET (net), NULL);
-
- return g_object_new (MIDORI_TYPE_VIEW, "net", net, NULL);
+ return g_object_new (MIDORI_TYPE_VIEW, NULL);
}
static void
{
MidoriNewView where = MIDORI_NEW_VIEW_TAB;
GtkWidget* new_view = g_object_new (MIDORI_TYPE_VIEW,
- "net", view->net, "settings", view->settings, NULL);
+ "settings", view->settings, NULL);
midori_view_set_uri (MIDORI_VIEW (new_view),
midori_view_get_display_uri (view));
gtk_widget_show (new_view);