[pan] All gui directory done
- From: Dominique Dumont <ddumont src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pan] All gui directory done
- Date: Mon, 3 Oct 2022 16:48:33 +0000 (UTC)
commit b9276ab96a02b0949026daa70bb742ead962e669
Author: Thomas Tanner <thosrtanner googlemail com>
Date: Thu Sep 29 20:27:25 2022 +0100
All gui directory done
pan/data-impl/data-impl.h | 26 ++++++------
pan/gui/actions.cc | 8 ++--
pan/gui/body-pane.cc | 78 +++++++++++++++++-----------------
pan/gui/group-pane.cc | 38 ++++++++---------
pan/gui/group-prefs-dialog.cc | 2 +-
pan/gui/group-prefs.cc | 12 +++---
pan/gui/gui.cc | 64 ++++++++++++++--------------
pan/gui/header-pane.cc | 98 +++++++++++++++++++++----------------------
pan/gui/header-pane.h | 4 +-
pan/gui/log-ui.cc | 14 +++----
pan/gui/pan.cc | 30 ++++++-------
11 files changed, 187 insertions(+), 187 deletions(-)
---
diff --git a/pan/data-impl/data-impl.h b/pan/data-impl/data-impl.h
index 718a974..e7d150d 100644
--- a/pan/data-impl/data-impl.h
+++ b/pan/data-impl/data-impl.h
@@ -267,12 +267,12 @@ namespace pan
Server* find_server (const Quark& s) {
servers_t::iterator it (_servers.find (s));
- return it == _servers.end() ? 0 : &it->second;
+ return it == _servers.end() ? nullptr : &it->second;
}
const Server* find_server (const Quark& s) const {
servers_t::const_iterator it (_servers.find (s));
- return it == _servers.end() ? 0 : &it->second;
+ return it == _servers.end() ? nullptr : &it->second;
}
};
@@ -281,19 +281,19 @@ namespace pan
ReadGroup* find_read_group (const Quark& g) {
read_groups_t::iterator it (_read_groups.find (g));
- return it == _read_groups.end() ? 0 : &it->second;
+ return it == _read_groups.end() ? nullptr : &it->second;
}
const ReadGroup* find_read_group (const Quark& g) const {
read_groups_t::const_iterator it (_read_groups.find (g));
- return it == _read_groups.end() ? 0 : &it->second;
+ return it == _read_groups.end() ? nullptr : &it->second;
}
ReadGroup::Server* find_read_group_server (const Quark& g, const Quark& s) {
ReadGroup * read_group = find_read_group (g);
- return read_group ? read_group->find_server (s) : 0;
+ return read_group ? read_group->find_server (s) : nullptr;
}
const ReadGroup::Server* find_read_group_server (const Quark& g, const Quark& s) const {
const ReadGroup * read_group = find_read_group (g);
- return read_group ? read_group->find_server (s) : 0;
+ return read_group ? read_group->find_server (s) : nullptr;
}
void ensure_descriptions_are_loaded () const;
@@ -383,7 +383,7 @@ namespace pan
typedef std::list<ArticleNode*> children_t;
children_t _children;
- ArticleNode(): _article(0), _parent(0) {}
+ ArticleNode(): _article(nullptr), _parent(nullptr) {}
};
typedef std::map<Quark,ArticleNode*> nodes_t;
@@ -479,8 +479,8 @@ namespace pan
const Quark & group,
const Quark & save_path, // for auto-download
const Data::ShowType show_type,
- const FilterInfo * filter_info=0,
- const RulesInfo * rules=0);
+ const FilterInfo * filter_info=nullptr,
+ const RulesInfo * rules=nullptr);
virtual ~MyTree ();
public: // from ArticleTree
@@ -489,9 +489,9 @@ namespace pan
const Article* get_article (const Quark& mid) const override;
size_t size () const override;
void set_filter (const ShowType show_type = SHOW_ARTICLES,
- const FilterInfo * criteria = 0) final override;
+ const FilterInfo * criteria = nullptr) final override;
void set_rules (const ShowType show_type = SHOW_ARTICLES,
- const RulesInfo * rules = 0) final override;
+ const RulesInfo * rules = nullptr) final override;
public:
void articles_changed (const quarks_t& mids, bool do_refilter);
@@ -539,8 +539,8 @@ namespace pan
ArticleTree* group_get_articles (const Quark & group,
const Quark & save_path,
const ShowType show_type = SHOW_ARTICLES,
- const FilterInfo * criteria=0,
- const RulesInfo * rules=0) const override;
+ const FilterInfo * criteria=nullptr,
+ const RulesInfo * rules=nullptr) const override;
void group_clear_articles (const Quark & group) override;
diff --git a/pan/gui/actions.cc b/pan/gui/actions.cc
index 5905198..f91441a 100644
--- a/pan/gui/actions.cc
+++ b/pan/gui/actions.cc
@@ -41,8 +41,8 @@ using pan::PanUI;
namespace pan
{
- PanUI * pan_ui (0);
- Prefs * prefs (0);
+ PanUI * pan_ui (nullptr);
+ Prefs * prefs (nullptr);
struct BuiltinIconInfo
{
@@ -89,7 +89,7 @@ namespace pan
for (int i(0), qty(G_N_ELEMENTS(my_builtin_icons)); i<qty; ++i)
{
- GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, my_builtin_icons[i].raw, false, 0);
+ GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, my_builtin_icons[i].raw, false, nullptr);
const int width (gdk_pixbuf_get_width (pixbuf));
gtk_icon_theme_add_builtin_icon (my_builtin_icons[i].name, width, pixbuf);
@@ -103,7 +103,7 @@ namespace pan
g_object_unref (G_OBJECT (factory));
}
- GtkActionGroup * _group (0);
+ GtkActionGroup * _group (nullptr);
void do_prompt_for_charset (GtkAction*) { pan_ui->do_prompt_for_charset(); }
void do_read_selected_group (GtkAction*) { pan_ui->do_read_selected_group(); }
diff --git a/pan/gui/body-pane.cc b/pan/gui/body-pane.cc
index 9e09541..b6e129c 100644
--- a/pan/gui/body-pane.cc
+++ b/pan/gui/body-pane.cc
@@ -79,8 +79,8 @@ namespace
const guint8 * pixbuf_txt;
GdkPixbuf * pixbuf;
} icons[NUM_ICONS] = {
- { icon_sig_ok, 0 },
- { icon_sig_fail, 0 }
+ { icon_sig_ok, nullptr },
+ { icon_sig_fail, nullptr }
};
}
@@ -173,7 +173,7 @@ namespace
g_object_set_data (G_OBJECT(o), FULLSIZE, GINT_TO_POINTER(b));
}
bool get_fullsize_flag (gpointer o) {
- return g_object_get_data (G_OBJECT(o), FULLSIZE) != 0;
+ return g_object_get_data (G_OBJECT(o), FULLSIZE) != nullptr;
}
bool toggle_fullsize_flag (gpointer o) {
const bool b (!get_fullsize_flag (o));
@@ -195,8 +195,8 @@ namespace
CURSOR_QTY
};
- GdkCursor ** cursors(0);
- GdkCursor * cursor_current(0);
+ GdkCursor ** cursors(nullptr);
+ GdkCursor * cursor_current(nullptr);
void free_cursors (void) {
delete[] cursors;
@@ -345,7 +345,7 @@ namespace
const int nw (size ? size->width : 0);
const int nh (size ? size->height : 0);
- GdkPixbuf * out (0);
+ GdkPixbuf * out (nullptr);
if (nw>=100 && nh>=100)
{
const int ow (gdk_pixbuf_get_width (pixbuf));
@@ -377,12 +377,12 @@ namespace
const int begin_offset (gtk_text_iter_get_offset (iter));
- GdkPixbuf * original (0);
- GdkPixbuf * old_scaled (0);
+ GdkPixbuf * original (nullptr);
+ GdkPixbuf * old_scaled (nullptr);
if (!get_pixbuf_at_offset (buf, begin_offset, original, old_scaled))
return;
- GdkPixbuf * new_scaled (size_to_fit (original, (fullsize ? 0 : size)));
+ GdkPixbuf * new_scaled (size_to_fit (original, (fullsize ? nullptr : size)));
const int old_w (gdk_pixbuf_get_width (old_scaled));
const int new_w (gdk_pixbuf_get_width (new_scaled));
const int old_h (gdk_pixbuf_get_height (old_scaled));
@@ -426,7 +426,7 @@ BodyPane :: mouse_button_pressed (GtkWidget *w, GdkEventButton *event)
/* this is a crude way of making sure that double-click
* doesn't open two or three browser windows. */
static time_t last_url_time (0);
- const time_t this_url_time (time (0));
+ const time_t this_url_time (time (nullptr));
if (this_url_time != last_url_time) {
last_url_time = this_url_time;
URL :: open (_prefs, url.c_str());
@@ -653,12 +653,12 @@ namespace
void create_emoticons()
{
- emoticon_pixbufs[":)"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_smile, false, 0);
- emoticon_pixbufs[":-)"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_smile, false, 0);
- emoticon_pixbufs[";)"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_wink, false, 0);
- emoticon_pixbufs[":("] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_frown, false, 0);
- emoticon_pixbufs[":P"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_tongueout, false, 0);
- emoticon_pixbufs[":O"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_surprised, false, 0);
+ emoticon_pixbufs[":)"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_smile, false, nullptr);
+ emoticon_pixbufs[":-)"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_smile, false, nullptr);
+ emoticon_pixbufs[";)"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_wink, false, nullptr);
+ emoticon_pixbufs[":("] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_frown, false, nullptr);
+ emoticon_pixbufs[":P"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_tongueout, false, nullptr);
+ emoticon_pixbufs[":O"] = gdk_pixbuf_new_from_inline (-1, icon_mozilla_surprised, false, nullptr);
}
enum TagMode { ADD, REPLACE };
@@ -712,7 +712,7 @@ namespace
GdkPixbuf * pixbuf)
{
g_assert (!text.empty());
- g_assert (pixbuf != 0);
+ g_assert (pixbuf != nullptr);
GtkTextTagTable * tags (gtk_text_buffer_get_tag_table (buffer));
GtkTextTag * url_tag (gtk_text_tag_table_lookup (tags, "url"));
@@ -754,7 +754,7 @@ namespace
bool do_urls)
{
- g_return_if_fail (buffer!=0);
+ g_return_if_fail (buffer!=nullptr);
g_return_if_fail (GTK_IS_TEXT_BUFFER(buffer));
// mute the quoted text, if desired
@@ -779,7 +779,7 @@ namespace
gtk_text_buffer_apply_tag_by_name (buffer, "text", &mark_start, &end);
// find where the signature begins...
- const char * sig_point (0);
+ const char * sig_point (nullptr);
int offset (0);
if (GNKSA::find_signature_delimiter (v, offset) != GNKSA::SIG_NONE)
sig_point = v.str + offset;
@@ -861,7 +861,7 @@ namespace
if (e) {
already_processed.insert (e);
- const char * type (0);
+ const char * type (nullptr);
switch (*b) {
case '*': type = "bold"; break;
case '_': type = "underline"; break;
@@ -881,7 +881,7 @@ namespace
StringView march (v_all);
while ((url_find (march, area))) {
set_section_tag (buffer, &start, v_all, area, "url", REPLACE);
- march = march.substr (area.str + area.len, 0);
+ march = march.substr (area.str + area.len, nullptr);
}
}
@@ -904,7 +904,7 @@ namespace
GdkPixbuf* get_pixbuf_from_gmime_part (GMimePart * part)
{
GdkPixbufLoader * l (gdk_pixbuf_loader_new ());
- GError * err (0);
+ GError * err (nullptr);
// populate the loader
GMimeDataWrapper * wrapper (g_mime_part_get_content (part));
@@ -945,7 +945,7 @@ namespace
}
// create the pixbuf
- GdkPixbuf * pixbuf (0);
+ GdkPixbuf * pixbuf (nullptr);
if (!err)
pixbuf = gdk_pixbuf_loader_get_pixbuf (l);
else {
@@ -987,9 +987,9 @@ BodyPane :: append_part (GMimeObject * parent, GMimeObject * obj, GtkAllocation
{
GdkPixbuf * original (get_pixbuf_from_gmime_part (part));
const bool fullsize (!_prefs.get_flag ("size-pictures-to-fit", true));
- GdkPixbuf * scaled (size_to_fit (original, fullsize ? 0 : widget_size));
+ GdkPixbuf * scaled (size_to_fit (original, fullsize ? nullptr : widget_size));
- if (scaled != 0)
+ if (scaled != nullptr)
{
GtkTextIter iter;
@@ -1082,7 +1082,7 @@ namespace
{
const char * val (message ? g_mime_object_get_header ((GMimeObject *)message, key) : "");
const std::string utf8_val (header_to_utf8 (val, fallback_charset));
- char * e (0);
+ char * e (nullptr);
if (strcmp (key, "From"))
e = g_markup_printf_escaped ("<span weight=\"bold\">%s</span>", utf8_val.c_str());
else {
@@ -1127,7 +1127,7 @@ namespace
void
BodyPane :: set_text_from_message (GMimeMessage * message)
{
- const char * fallback_charset (_charset.empty() ? 0 : _charset.c_str());
+ const char * fallback_charset (_charset.empty() ? nullptr : _charset.c_str());
// mandatory headers...
std::string s;
@@ -1197,7 +1197,7 @@ BodyPane :: set_text_from_message (GMimeMessage * message)
// set the x-face...
gtk_image_clear(GTK_IMAGE(_xface));
- const char * pch = message ? g_mime_object_get_header ((GMimeObject *) message, "X-Face") : 0;
+ const char * pch = message ? g_mime_object_get_header ((GMimeObject *) message, "X-Face") : nullptr;
if (pch && gtk_widget_get_window(_xface) )
{
gtk_widget_set_size_request (_xface, FACE_SIZE, FACE_SIZE);
@@ -1211,7 +1211,7 @@ BodyPane :: set_text_from_message (GMimeMessage * message)
// set the face
gtk_image_clear(GTK_IMAGE(_face));
- pch = message ? g_mime_object_get_header ((GMimeObject *) message, "Face") : 0;
+ pch = message ? g_mime_object_get_header ((GMimeObject *) message, "Face") : nullptr;
if (pch && gtk_widget_get_window(_face))
{
gtk_widget_set_size_request (_face, FACE_SIZE, FACE_SIZE);
@@ -1365,7 +1365,7 @@ BodyPane :: clear ()
{
if (_message)
g_object_unref (_message);
- _message = 0;
+ _message = nullptr;
set_cleared(true);
@@ -1615,7 +1615,7 @@ BodyPane :: menu_clicked_all_cb (GtkWidget* w, gpointer ptr)
GtkWidget*
BodyPane :: new_attachment (const char* filename)
{
- if (!filename) return 0;
+ if (!filename) return nullptr;
GtkWidget* w = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 0);
GtkWidget* attachment = gtk_label_new(filename);
@@ -1642,7 +1642,7 @@ BodyPane :: clear_attachments()
_cur_col = 0;
_cur_row = 0;
_attachments = 0;
- _current_attachment = 0;
+ _current_attachment = nullptr;
{
gtk_widget_set_no_show_all (_att_box, TRUE);
@@ -1740,19 +1740,19 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs, GroupPrefs
#endif
_hscroll_visible (false),
_vscroll_visible (false),
- _message (0),
+ _message (nullptr),
#ifdef HAVE_GMIME_CRYPTO
// _gpgerr(GPG_DECODE),
#endif
_attachments(0),
_cleared (true),
- _current_attachment(0)
+ _current_attachment(nullptr)
{
GtkWidget * w, * l, * hbox;
for (guint i=0; i<NUM_ICONS; ++i)
- icons[i].pixbuf = gdk_pixbuf_new_from_inline (-1, icons[i].pixbuf_txt, FALSE, 0);
+ icons[i].pixbuf = gdk_pixbuf_new_from_inline (-1, icons[i].pixbuf_txt, FALSE, nullptr);
create_cursors();
create_emoticons();
@@ -1857,7 +1857,7 @@ BodyPane :: BodyPane (Data& data, ArticleCache& cache, Prefs& prefs, GroupPrefs
_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW(_text));
set_text_buffer_tags (_buffer, _prefs);
- set_text_from_message (0);
+ set_text_from_message (nullptr);
const bool expanded (_prefs.get_flag ("body-pane-headers-expanded", true));
gtk_expander_set_expanded (GTK_EXPANDER(_expander), expanded);
expander_activated_idle (this);
@@ -2039,7 +2039,7 @@ namespace
GMimeMessage*
BodyPane :: create_followup_or_reply (bool is_reply)
{
- GMimeMessage * msg (0);
+ GMimeMessage * msg (nullptr);
if (_message)
{
@@ -2050,7 +2050,7 @@ BodyPane :: create_followup_or_reply (bool is_reply)
// fallback character encodings
const char * group_charset (_charset.c_str());
GMimeContentType * type (g_mime_object_get_content_type (GMIME_OBJECT(_message)));
- const char * message_charset (type ? g_mime_content_type_get_parameter (type, "charset") : 0);
+ const char * message_charset (type ? g_mime_content_type_get_parameter (type, "charset") : nullptr);
///
/// HEADERS
@@ -2169,7 +2169,7 @@ BodyPane :: refresh_fonts ()
const bool monospace_font_enabled = _prefs.get_flag ("monospace-font-enabled", false);
if (!body_pane_font_enabled && !monospace_font_enabled)
- gtk_widget_override_font (_text, 0);
+ gtk_widget_override_font (_text, nullptr);
else {
const std::string str (monospace_font_enabled
? _prefs.get_string ("monospace-font", "Monospace 10")
diff --git a/pan/gui/group-pane.cc b/pan/gui/group-pane.cc
index 3c6437d..0838cde 100644
--- a/pan/gui/group-pane.cc
+++ b/pan/gui/group-pane.cc
@@ -63,9 +63,9 @@ namespace
}
};
- Quark * virtual_title_quark (0);
- Quark * sub_title_quark (0);
- Quark * other_title_quark (0);
+ Quark * virtual_title_quark (nullptr);
+ Quark * sub_title_quark (nullptr);
+ Quark * other_title_quark (nullptr);
bool is_group (const Quark& name) {
return !name.empty() &&
@@ -136,7 +136,7 @@ GroupPane :: get_full_selection () const
quarks_v groups;
// get a list of paths
- GtkTreeModel * model (0);
+ GtkTreeModel * model (nullptr);
GtkTreeSelection * selection (gtk_tree_view_get_selection (GTK_TREE_VIEW(_tree_view)));
GList * list (gtk_tree_selection_get_selected_rows (selection, &model));
@@ -307,7 +307,7 @@ namespace
MyRow tmp;
tmp.groupname = groupname;
rows_t::iterator it = _group_rows.find (&tmp);
- return it==_group_rows.end() ? 0 : *it;
+ return it==_group_rows.end() ? nullptr : *it;
}
void
@@ -439,7 +439,7 @@ namespace
// or if there's no criteria and no subscribed groups (first-time usrs).
// otherwise it's a flood of thousands of groups.
// they can click the expander themselves to get that,
- const bool user_did_search (match != 0);
+ const bool user_did_search (match != nullptr);
if (!unsub.empty() && (user_did_search || sub.empty()))
expandme.push_back (store->get_iter (row));
}
@@ -564,7 +564,7 @@ GroupPane :: set_filter (const std::string& search_text, int mode)
// pmatch will point to a local TextMatch matching on the filter-phrase,
// or be a NULL pointer if the filter-phrase is empty
TextMatch match;
- TextMatch * pmatch (0);
+ TextMatch * pmatch (nullptr);
if (!search_text.empty()) {
if (mode == _GROUP)
match.set (search_text, TextMatch::CONTAINS, false);
@@ -671,7 +671,7 @@ namespace
void entry_icon_released (GtkEntry*, GtkEntryIconPosition icon_pos, GdkEventButton *, gpointer menu)
{
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
- gtk_menu_popup (GTK_MENU(menu), 0, 0, 0, 0, 0, gtk_get_current_event_time());
+ gtk_menu_popup (GTK_MENU(menu), nullptr, nullptr, nullptr, nullptr, 0, gtk_get_current_event_time());
}
void clear_button_clicked_cb (GtkEntry * e, GtkEntryIconPosition icon_pos, GdkEventButton *, gpointer
pane_gpointer)
@@ -801,10 +801,10 @@ GroupPane :: find_next_subscribed_group (bool unread_only)
// find how many subscribed groups the tree's got
GtkTreeIter sub_iter, virtual_iter;
- gtk_tree_model_iter_nth_child (model, &sub_iter, 0, 1); // 'sub' node
+ gtk_tree_model_iter_nth_child (model, &sub_iter, nullptr, 1); // 'sub' node
int n_groups = gtk_tree_model_iter_n_children (model, &sub_iter);
if (n_groups < 1)
- return 0;
+ return nullptr;
// find the index of the current selection
// (or -1 if no subscribed groups are selected)
@@ -829,11 +829,11 @@ GroupPane :: find_next_subscribed_group (bool unread_only)
{
if (++n == n_groups) {
if (start_pos == -1)
- return 0;
+ return nullptr;
n = 0;
}
if (n == start_pos)
- return 0;
+ return nullptr;
GtkTreeIter group_iter;
gtk_tree_model_iter_nth_child (model, &group_iter, &sub_iter, n);
@@ -947,7 +947,7 @@ GroupPane :: create_filter_entry ()
mode = 1;
else
mode = 0;
- GSList * l = 0;
+ GSList * l = nullptr;
for (int i=0, qty=G_N_ELEMENTS(mode_strings); i<qty; ++i)
{
GtkWidget * w = gtk_radio_menu_item_new_with_label (l, _(mode_strings[i]));
@@ -1011,7 +1011,7 @@ GroupPane :: GroupPane (ActionManager& action_manager, Data& data, Prefs& prefs,
_prefs (prefs),
_group_prefs(group_prefs),
_data (data),
- _tree_view (0),
+ _tree_view (nullptr),
_action_manager (action_manager),
_dirty_groups_idle_tag (0)
{
@@ -1038,13 +1038,13 @@ GroupPane :: GroupPane (ActionManager& action_manager, Data& data, Prefs& prefs,
GtkTreeSelection * selection (gtk_tree_view_get_selection (GTK_TREE_VIEW(_tree_view)));
gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE);
- gtk_tree_selection_set_select_function (selection, select_func, 0, 0);
+ gtk_tree_selection_set_select_function (selection, select_func, nullptr, nullptr);
g_signal_connect (selection, "changed", G_CALLBACK(on_selection_changed), this);
on_selection_changed (selection, this);
- g_signal_connect (_tree_view, "row_collapsed", G_CALLBACK(row_collapsed_or_expanded_cb), 0);
- g_signal_connect (_tree_view, "row_expanded", G_CALLBACK(row_collapsed_or_expanded_cb), 0);
+ g_signal_connect (_tree_view, "row_collapsed", G_CALLBACK(row_collapsed_or_expanded_cb), nullptr);
+ g_signal_connect (_tree_view, "row_expanded", G_CALLBACK(row_collapsed_or_expanded_cb), nullptr);
g_signal_connect (_tree_view, "button-press-event", G_CALLBACK(on_button_pressed), this);
g_signal_connect (_tree_view, "button-release-event", G_CALLBACK(on_button_pressed), this);
g_signal_connect (_tree_view, "popup-menu", G_CALLBACK(on_popup_menu), this);
@@ -1067,7 +1067,7 @@ GroupPane :: GroupPane (ActionManager& action_manager, Data& data, Prefs& prefs,
gtk_tree_view_append_column (GTK_TREE_VIEW(_tree_view), col);
gtk_tree_view_set_expander_column (GTK_TREE_VIEW(_tree_view), col);
gtk_tree_view_column_pack_start (col, text_renderer, true);
- gtk_tree_view_column_set_cell_data_func (col, text_renderer, render_group_name, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, text_renderer, render_group_name, this, nullptr);
_root = scroll;
_data.add_listener (this);
@@ -1094,7 +1094,7 @@ void
GroupPane :: refresh_font ()
{
if (!_prefs.get_flag ("group-pane-font-enabled", false))
- gtk_widget_override_font (_tree_view, 0);
+ gtk_widget_override_font (_tree_view, nullptr);
else {
const std::string str (_prefs.get_string ("group-pane-font", "Sans 10"));
PangoFontDescription * pfd (pango_font_description_from_string (str.c_str()));
diff --git a/pan/gui/group-prefs-dialog.cc b/pan/gui/group-prefs-dialog.cc
index c51afe7..880a0cb 100644
--- a/pan/gui/group-prefs-dialog.cc
+++ b/pan/gui/group-prefs-dialog.cc
@@ -119,7 +119,7 @@ GroupPrefsDialog :: save_from_gui ()
if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX(_spellchecker_language), &iter))
return;
- gchar* name(0);
+ gchar* name(nullptr);
GtkTreeModel* model = gtk_combo_box_get_model (GTK_COMBO_BOX(_spellchecker_language));
gtk_tree_model_get (model, &iter, 0, &name, -1);
diff --git a/pan/gui/group-prefs.cc b/pan/gui/group-prefs.cc
index b06a949..d93a21b 100644
--- a/pan/gui/group-prefs.cc
+++ b/pan/gui/group-prefs.cc
@@ -150,7 +150,7 @@ GroupPrefs :: start_element (GMarkupParseContext *context,
if (s == "group")
{
- const char * name(0);
+ const char * name(nullptr);
for (const char **k(attribute_names), **v(attribute_vals); *k; ++k, ++v)
if (!strcmp (*k,"name")) name = *v;
if (name && *name)
@@ -185,12 +185,12 @@ GroupPrefs :: from_string (const StringView& xml)
GMarkupParser p;
p.start_element = start_element;
p.end_element = end_element;
- p.text = 0;
- p.passthrough = 0;
- p.error = 0;
+ p.text = nullptr;
+ p.passthrough = nullptr;
+ p.error = nullptr;
GMarkupParseContext* c (
- g_markup_parse_context_new (&p, (GMarkupParseFlags)0, this, 0));
- GError * gerr (0);
+ g_markup_parse_context_new (&p, (GMarkupParseFlags)0, this, nullptr));
+ GError * gerr (nullptr);
if (g_markup_parse_context_parse (c, xml.str, xml.len, &gerr)) {
// FIXME
}
diff --git a/pan/gui/gui.cc b/pan/gui/gui.cc
index 72c2d44..4bd2178 100644
--- a/pan/gui/gui.cc
+++ b/pan/gui/gui.cc
@@ -97,7 +97,7 @@ namespace pan
void remove_from_parent (GtkWidget * w)
{
GtkWidget *parent = gtk_widget_get_parent(w);
- if (parent != 0)
+ if (parent != nullptr)
gtk_container_remove (GTK_CONTAINER(parent), w);
}
}
@@ -221,17 +221,17 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs):
_certstore(data.get_certstore()),
_root (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)),
_menu_vbox (gtk_box_new (GTK_ORIENTATION_VERTICAL, 0)),
- _group_pane (0),
- _header_pane (0),
- _body_pane (0),
+ _group_pane (nullptr),
+ _header_pane (nullptr),
+ _body_pane (nullptr),
_ui_manager (gtk_ui_manager_new ()),
_info_image (gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_MENU)),
_error_image (gtk_image_new_from_stock (GTK_STOCK_DIALOG_ERROR, GTK_ICON_SIZE_MENU)),
- _connection_size_eventbox (0),
- _connection_size_label (0),
- _queue_size_label (0),
- _queue_size_button (0),
- _taskbar (0)
+ _connection_size_eventbox (nullptr),
+ _connection_size_label (nullptr),
+ _queue_size_label (nullptr),
+ _queue_size_button (nullptr),
+ _taskbar (nullptr)
{
char * filename = g_build_filename (file::get_pan_home().c_str(), "pan.ui", NULL);
@@ -393,9 +393,9 @@ GUI :: GUI (Data& data, Queue& queue, Prefs& prefs, GroupPrefs& group_prefs):
namespace
{
- GtkWidget * hpane (0);
- GtkWidget * vpane (0);
- GtkWidget * sep_vpane (0);
+ GtkWidget * hpane (nullptr);
+ GtkWidget * vpane (nullptr);
+ GtkWidget * sep_vpane (nullptr);
}
GUI :: ~GUI ()
@@ -494,7 +494,7 @@ namespace
if (!key_to_action.empty())
return;
- for (GList * l=gtk_ui_manager_get_action_groups(uim); l!=0; l=l->next)
+ for (GList * l=gtk_ui_manager_get_action_groups(uim); l!=nullptr; l=l->next)
{
GtkActionGroup * action_group = GTK_ACTION_GROUP(l->data);
GList * actions = gtk_action_group_list_actions (action_group);
@@ -703,7 +703,7 @@ void GUI :: do_save_articles_to_nzb ()
Queue::tasks_t tasks;
std::string emptystring;
foreach_const (std::vector<Article>, copies, it)
- tasks.push_back (new TaskArticle (_data, _data, *it, _cache, _data, always ?
TaskArticle::ALWAYS_MARK : TaskArticle::NEVER_MARK, 0, TaskArticle::RAW,emptystring));
+ tasks.push_back (new TaskArticle (_data, _data, *it, _cache, _data, always ?
TaskArticle::ALWAYS_MARK : TaskArticle::NEVER_MARK, nullptr, TaskArticle::RAW,emptystring));
// write them to a file
std::ofstream tmp(file.c_str());
@@ -826,7 +826,7 @@ void GUI :: do_import_tasks ()
strings_t filenames;
if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
GSList * tmp = gtk_file_chooser_get_filenames (GTK_FILE_CHOOSER(dialog));
- for (GSList * l(tmp); l!=0; l=l->next) {
+ for (GSList * l(tmp); l!=nullptr; l=l->next) {
filenames.push_back ((char*) l->data);
g_free (l->data);
}
@@ -864,13 +864,13 @@ namespace
void task_pane_destroyed_cb (GtkWidget *, gpointer p)
{
TaskPane ** task_pane (static_cast<TaskPane**>(p));
- *task_pane = 0;
+ *task_pane = nullptr;
}
}
void GUI :: do_show_task_window ()
{
- static TaskPane * task_pane (0);
+ static TaskPane * task_pane (nullptr);
if (!task_pane) {
task_pane = new TaskPane (_queue, _prefs);
@@ -915,7 +915,7 @@ void GUI :: do_show_log_window ()
{
set_bin_child (_event_log_button, _info_image);
- static GtkWidget * w (0);
+ static GtkWidget * w (nullptr);
if (!w) {
w = log_dialog_new (_prefs, get_window (_root));
g_signal_connect (w, "destroy", G_CALLBACK(gtk_widget_destroyed), &w);
@@ -1182,7 +1182,7 @@ void GUI :: do_expand_thread ()
void GUI :: do_show_score_dialog ()
{
const Quark& group (_header_pane->get_group());
- const Article * article (0);
+ const Article * article (nullptr);
if (!group.empty())
article = _header_pane->get_first_selected_article ();
if (article) {
@@ -1307,7 +1307,7 @@ GUI :: score_add (int mode)
Article a;
const Article* article (_header_pane->get_first_selected_article ());
- if (article != 0)
+ if (article != nullptr)
a = *article;
ScoreAddDialog * d = new ScoreAddDialog (_data, _root, group, a, (ScoreAddDialog::Mode)mode);
@@ -1371,7 +1371,7 @@ void GUI :: do_supersede_article ()
g_object_unref (content_object);
g_object_unref (stream);
- PostUI * post = PostUI :: create_window (0, _data, _queue, _data, _data, new_message, _prefs,
_group_prefs, _encode_cache);
+ PostUI * post = PostUI :: create_window (nullptr, _data, _queue, _data, _data, new_message, _prefs,
_group_prefs, _encode_cache);
if (post)
{
gtk_widget_show_all (post->root());
@@ -1435,7 +1435,7 @@ void GUI :: do_cancel_article ()
g_object_unref (stream);
g_free (cancel_message);
- PostUI * post = PostUI :: create_window (0, _data, _queue, _data, _data, cancel, _prefs, _group_prefs,
_encode_cache);
+ PostUI * post = PostUI :: create_window (nullptr, _data, _queue, _data, _data, cancel, _prefs,
_group_prefs, _encode_cache);
if (post)
{
gtk_widget_show_all (post->root());
@@ -1601,7 +1601,7 @@ GUI :: do_post ()
g_mime_message_set_mime_part (message, GMIME_OBJECT(part));
g_object_unref (part);
- PostUI * post = PostUI :: create_window (0, _data, _queue, _data, _data, message, _prefs, _group_prefs,
_encode_cache);
+ PostUI * post = PostUI :: create_window (nullptr, _data, _queue, _data, _data, message, _prefs,
_group_prefs, _encode_cache);
if (post)
gtk_widget_show_all (post->root());
g_object_unref (message);
@@ -1611,7 +1611,7 @@ void GUI :: do_followup_to ()
{
GMimeMessage * message = _body_pane->create_followup_or_reply (false);
if (message) {
- PostUI * post = PostUI :: create_window(0, _data, _queue, _data, _data, message, _prefs, _group_prefs,
_encode_cache);
+ PostUI * post = PostUI :: create_window(nullptr, _data, _queue, _data, _data, message, _prefs,
_group_prefs, _encode_cache);
if (post)
gtk_widget_show_all (post->root());
g_object_unref (message);
@@ -1621,7 +1621,7 @@ void GUI :: do_reply_to ()
{
GMimeMessage * message = _body_pane->create_followup_or_reply (true);
if (message) {
- PostUI * post = PostUI :: create_window (0, _data, _queue, _data, _data, message, _prefs, _group_prefs,
_encode_cache);
+ PostUI * post = PostUI :: create_window (nullptr, _data, _queue, _data, _data, message, _prefs,
_group_prefs, _encode_cache);
if (post)
gtk_widget_show_all (post->root());
g_object_unref (message);
@@ -1663,8 +1663,8 @@ void GUI :: do_about_pan ()
"Petr Kovar <pknbe volny cz> - Contributor",
"Calin Culianu <calin ajvar org> - Threaded Decoding",
"Christophe Lambin <chris rebelbase com> - Original Developer",
- "Matt Eagleson <matt rebelbase com> - Original Developer", 0 };
- GdkPixbuf * logo = gdk_pixbuf_new_from_inline(-1, icon_pan_about_logo, 0, 0);
+ "Matt Eagleson <matt rebelbase com> - Original Developer", nullptr };
+ GdkPixbuf * logo = gdk_pixbuf_new_from_inline(-1, icon_pan_about_logo, 0, nullptr);
GtkAboutDialog * w (GTK_ABOUT_DIALOG (gtk_about_dialog_new ()));
gtk_about_dialog_set_program_name (w, _("Pan"));
gtk_about_dialog_set_version (w, PACKAGE_VERSION);
@@ -1772,11 +1772,11 @@ void GUI :: do_layout (bool tabbed)
{
if (hpane) {
_prefs.set_int ("main-window-hpane-position", gtk_paned_get_position(GTK_PANED(hpane)));
- hpane = 0;
+ hpane = nullptr;
}
if (vpane) {
_prefs.set_int ("main-window-vpane-position", gtk_paned_get_position(GTK_PANED(vpane)));
- vpane = 0;
+ vpane = nullptr;
}
gtk_widget_hide (_workarea_bin);
@@ -1797,7 +1797,7 @@ void GUI :: do_layout (bool tabbed)
g_list_free (children);
}
- GtkWidget * w (0);
+ GtkWidget * w (nullptr);
if (tabbed)
{
w = gtk_notebook_new ();
@@ -1920,7 +1920,7 @@ void GUI :: do_show_selected_article_info ()
{
const Article* a = _header_pane->get_first_selected_article ();
- if (a != 0)
+ if (a != nullptr)
{
// date
EvolutionDateMaker date_maker;
@@ -2309,7 +2309,7 @@ GUI :: on_queue_task_active_changed (Queue&, Task& t, bool is_active)
for (; it!=_active_tasks.end() && i<VIEW_QTY; ++it, ++i)
_views[i]->set_progress (*it);
for (; i<VIEW_QTY; ++i)
- _views[i]->set_progress (0);
+ _views[i]->set_progress (nullptr);
}
void
GUI :: on_queue_connection_count_changed (Queue&, int)
diff --git a/pan/gui/header-pane.cc b/pan/gui/header-pane.cc
index 2148e16..786afb3 100644
--- a/pan/gui/header-pane.cc
+++ b/pan/gui/header-pane.cc
@@ -70,7 +70,7 @@ const Article*
HeaderPane :: get_article (GtkTreeModel* model, GtkTreeIter* iter)
{
const Article * a = dynamic_cast<Row*>(PAN_TREE_STORE(model)->get_row(iter))->article;
- g_assert (a != 0);
+ g_assert (a != nullptr);
return a;
}
@@ -106,21 +106,21 @@ namespace
const guint8 * pixbuf_txt;
GdkPixbuf * pixbuf;
} _icons[ICON_QTY] = {
- { icon_article_read, 0 },
- { icon_article_unread, 0 },
+ { icon_article_read, nullptr },
+ { icon_article_unread, nullptr },
- { icon_binary_complete, 0 },
- { icon_binary_complete_read, 0 },
+ { icon_binary_complete, nullptr },
+ { icon_binary_complete_read, nullptr },
- { icon_binary_incomplete, 0 },
- { icon_binary_incomplete_read, 0 },
+ { icon_binary_incomplete, nullptr },
+ { icon_binary_incomplete_read, nullptr },
- { icon_disk, 0 },
- { icon_bluecheck, 0 },
- { icon_x, 0 },
- { icon_empty, 0 },
- { icon_red_flag, 0 },
- { icon_get_flagged, 0 }
+ { icon_disk, nullptr },
+ { icon_bluecheck, nullptr },
+ { icon_x, nullptr },
+ { icon_empty, nullptr },
+ { icon_red_flag, nullptr },
+ { icon_get_flagged, nullptr }
};
int
@@ -325,7 +325,7 @@ HeaderPane :: render_date (GtkTreeViewColumn * ,
{
const HeaderPane * self (static_cast<HeaderPane*>(userdata));
- gchar* date (0);
+ gchar* date (nullptr);
gtk_tree_model_get (model, iter, COL_DATE_STR, &date, -1);
g_object_set (renderer,
"text", date,
@@ -408,7 +408,7 @@ HeaderPane::Row*
HeaderPane :: get_row (const Quark& message_id)
{
mid_to_row_t::iterator it (_mid_to_row.find (message_id));
- return it==_mid_to_row.end() ? 0 : *it;
+ return it==_mid_to_row.end() ? nullptr : *it;
}
HeaderPane::Row*
@@ -445,7 +445,7 @@ HeaderPane :: add_children_to_model (PanTreeStore * store,
rows.reserve (children.size());
foreach_const (article_v, children, it)
rows.push_back (create_row (date_maker, *it));
- store->append (do_thread ? parent_row : 0, rows);
+ store->append (do_thread ? parent_row : nullptr, rows);
// recurse
for (size_t i=0, n=children.size(); i<n; ++i)
@@ -648,14 +648,14 @@ HeaderPane :: set_group (const Quark& new_group)
{
save_sort_order (get_group(), _group_prefs, _tree_store);
_mid_to_row.clear ();
- _tree_store = 0;
+ _tree_store = nullptr;
gtk_tree_view_set_model (GTK_TREE_VIEW(_tree_view), NULL);
}
_group = new_group;
delete _atree;
- _atree = 0;
+ _atree = nullptr;
char * pch = g_build_filename (g_get_home_dir(), "News", NULL);
Quark path(_group_prefs.get_string (_group, "default-group-save-path", pch));
@@ -742,7 +742,7 @@ HeaderPane :: collapse_selected()
{
{
// get a list of paths
- GtkTreeModel * model (0);
+ GtkTreeModel * model (nullptr);
GtkTreeView * view (GTK_TREE_VIEW (_tree_view));
GtkTreeSelection * selection (gtk_tree_view_get_selection (view));
GList * list (gtk_tree_selection_get_selected_rows (selection, &model));
@@ -795,7 +795,7 @@ HeaderPane :: on_tree_change (const Data::ArticleTree::Diffs& diffs)
if (!new_selection.empty()) {
GtkTreeView *view (GTK_TREE_VIEW(_tree_view));
Row * row (get_row (*new_selection.begin()));
- GtkTreePath *a(0), *b(0), *p (_tree_store->get_path (row));
+ GtkTreePath *a(nullptr), *b(nullptr), *p (_tree_store->get_path (row));
gtk_tree_view_get_visible_range (view, &a, &b);
selection_was_visible = (gtk_tree_path_compare(a,p)<=0 &&
gtk_tree_path_compare(p,b)<=0);
@@ -821,7 +821,7 @@ HeaderPane :: on_tree_change (const Data::ArticleTree::Diffs& diffs)
foreach_const (Data::ArticleTree::Diffs::added_t, diffs.added, it)
create_row (date_maker, _atree->get_article(it->first));
foreach_const (Data::ArticleTree::Diffs::added_t, diffs.added, it) {
- Row * parent (do_thread ? get_row (it->second.parent) : 0);
+ Row * parent (do_thread ? get_row (it->second.parent) : nullptr);
Row * child (get_row (it->first));
tmp[parent].push_back (child);
}
@@ -890,7 +890,7 @@ HeaderPane :: on_tree_change (const Data::ArticleTree::Diffs& diffs)
const Article*
HeaderPane :: get_first_selected_article () const
{
- const Article * a (0);
+ const Article * a (nullptr);
const std::set<const Article*> articles (get_full_selection ());
if (!articles.empty())
a = *articles.begin ();
@@ -900,7 +900,7 @@ HeaderPane :: get_first_selected_article () const
Article*
HeaderPane :: get_first_selected_article ()
{
- Article * a (0);
+ Article * a (nullptr);
std::set<const Article*> articles (get_full_selection ());
if (!articles.empty())
a = (Article*)*articles.begin ();
@@ -1269,7 +1269,7 @@ namespace
const bool is_smallish = lines <= 5000;
const bool is_mediumish = lines <= 20000;
const bool image_subject = has_image_type_in_subject (*a);
- const bool is_pictures_newsgroup = pane->get_group().to_view().strstr("pictures")!=0;
+ const bool is_pictures_newsgroup = pane->get_group().to_view().strstr("pictures")!=nullptr;
if (is_smallish || image_subject)
pane->_action_manager.activate_action ("read-selected-article");
else if (is_mediumish && is_pictures_newsgroup)
@@ -1665,7 +1665,7 @@ namespace
void entry_icon_release (GtkEntry*, GtkEntryIconPosition icon_pos, GdkEventButton*, gpointer menu)
{
if (icon_pos == GTK_ENTRY_ICON_PRIMARY)
- gtk_menu_popup (GTK_MENU(menu), 0, 0, 0, 0, 0, gtk_get_current_event_time());
+ gtk_menu_popup (GTK_MENU(menu), nullptr, nullptr, nullptr, nullptr, 0, gtk_get_current_event_time());
}
void entry_icon_release_2 (GtkEntry *entry, GtkEntryIconPosition icon_pos, GdkEventButton*, gpointer
pane_gpointer)
@@ -1704,7 +1704,7 @@ HeaderPane :: build_tree_columns ()
{
const std::string& name (tok.to_string());
const std::string width_key = std::string("header-pane-") + name + "-column-width";
- GtkTreeViewColumn * col (0);
+ GtkTreeViewColumn * col (nullptr);
if (name == "state")
{
@@ -1717,7 +1717,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 24));
gtk_tree_view_column_set_resizable (col, false);
gtk_tree_view_column_pack_start (col, r, false);
- gtk_tree_view_column_set_cell_data_func (col, r, render_state, 0, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_state, nullptr, nullptr);
gtk_tree_view_column_set_sort_column_id (col, COL_STATE);
gtk_tree_view_append_column (tree_view, col);
}
@@ -1732,7 +1732,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 24));
gtk_tree_view_column_set_resizable (col, false);
gtk_tree_view_column_pack_start (col, r, false);
- gtk_tree_view_column_set_cell_data_func (col, r, render_action, 0, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_action, nullptr, nullptr);
gtk_tree_view_append_column (tree_view, col);
}
else if (name == "subject")
@@ -1747,7 +1747,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 400));
gtk_tree_view_column_set_resizable (col, true);
gtk_tree_view_column_set_sort_column_id (col, COL_SUBJECT);
- gtk_tree_view_column_set_cell_data_func (col, r, render_subject, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_subject, this, nullptr);
gtk_tree_view_append_column (tree_view, col);
gtk_tree_view_set_expander_column (tree_view, col);
}
@@ -1764,7 +1764,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 50));
gtk_tree_view_column_set_resizable (col, true);
gtk_tree_view_column_set_sort_column_id (col, COL_SCORE);
- gtk_tree_view_column_set_cell_data_func (col, r, render_score, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_score, this, nullptr);
gtk_tree_view_append_column (tree_view, col);
}
else if (name == "author")
@@ -1779,7 +1779,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 133));
gtk_tree_view_column_set_resizable (col, true);
gtk_tree_view_column_set_sort_column_id (col, COL_SHORT_AUTHOR);
- gtk_tree_view_column_set_cell_data_func (col, r, render_author, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_author, this, nullptr);
gtk_tree_view_append_column (tree_view, col);
}
else if (name == "lines")
@@ -1795,7 +1795,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 60));
gtk_tree_view_column_set_resizable (col, true);
gtk_tree_view_column_set_sort_column_id (col, COL_LINES);
- gtk_tree_view_column_set_cell_data_func (col, r, render_lines, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_lines, this, nullptr);
gtk_tree_view_append_column (tree_view, col);
}
else if (name == "bytes")
@@ -1811,7 +1811,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 80));
gtk_tree_view_column_set_resizable (col, true);
gtk_tree_view_column_set_sort_column_id (col, COL_BYTES);
- gtk_tree_view_column_set_cell_data_func (col, r, render_bytes, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_bytes, this, nullptr);
gtk_tree_view_append_column (tree_view, col);
}
else if (name == "date")
@@ -1826,7 +1826,7 @@ HeaderPane :: build_tree_columns ()
gtk_tree_view_column_set_fixed_width (col, _prefs.get_int (width_key, 120));
gtk_tree_view_column_set_resizable (col, true);
gtk_tree_view_column_set_sort_column_id (col, COL_DATE);
- gtk_tree_view_column_set_cell_data_func (col, r, render_date, this, 0);
+ gtk_tree_view_column_set_cell_data_func (col, r, render_date, this, nullptr);
gtk_tree_view_append_column (tree_view, col);
}
@@ -1904,7 +1904,7 @@ HeaderPane :: create_filter_entry ()
mode = 1;
else
mode = 0;
- GSList * l = 0;
+ GSList * l = nullptr;
for (int i=0, qty=G_N_ELEMENTS(mode_strings); i<qty; ++i) {
GtkWidget * w = gtk_radio_menu_item_new_with_label (l, _(mode_strings[i]));
l = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM(w));
@@ -1936,7 +1936,7 @@ gboolean
HeaderPane :: on_selection_changed_idle (gpointer self_gpointer)
{
HeaderPane * self (static_cast<HeaderPane*>(self_gpointer));
- const bool have_article = self->get_first_selected_article() != 0;
+ const bool have_article = self->get_first_selected_article() != nullptr;
static const char* actions_that_need_an_article[] = {
"download-selected-article",
"save-articles",
@@ -1982,10 +1982,10 @@ HeaderPane :: HeaderPane (ActionManager & action_manager,
_prefs (prefs),
_group_prefs (group_prefs),
_wait (wait),
- _atree (0),
- _root (0),
- _tree_view (0),
- _tree_store (0),
+ _atree (nullptr),
+ _root (nullptr),
+ _tree_view (nullptr),
+ _tree_store (nullptr),
_selection_changed_idle_tag (0),
_fg(prefs.get_color_str_wo_fallback ("text-color-fg")),
_bg(prefs.get_color_str_wo_fallback ("text-color-bg")),
@@ -1996,7 +1996,7 @@ HeaderPane :: HeaderPane (ActionManager & action_manager,
// init the icons
for (guint i=0; i<ICON_QTY; ++i)
- _icons[i].pixbuf = gdk_pixbuf_new_from_inline (-1, _icons[i].pixbuf_txt, FALSE, 0);
+ _icons[i].pixbuf = gdk_pixbuf_new_from_inline (-1, _icons[i].pixbuf_txt, FALSE, nullptr);
// initialize the show type...
const std::string show_type_str (prefs.get_string ("header-pane-show-matching", "articles"));
@@ -2028,7 +2028,7 @@ HeaderPane :: HeaderPane (ActionManager & action_manager,
g_signal_connect (w, "row-expanded", G_CALLBACK(row_expanded_cb), NULL);
g_signal_connect (w, "popup-menu", G_CALLBACK(on_popup_menu), this);
g_signal_connect (w, "row-activated", G_CALLBACK(on_row_activated), this);
- GtkWidget * scroll = gtk_scrolled_window_new (0, 0);
+ GtkWidget * scroll = gtk_scrolled_window_new (nullptr, nullptr);
gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_container_add (GTK_CONTAINER(scroll), w);
gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW(scroll), GTK_SHADOW_IN);
@@ -2125,7 +2125,7 @@ void
HeaderPane :: expand_selected ()
{
// get a list of paths
- GtkTreeModel * model (0);
+ GtkTreeModel * model (nullptr);
GtkTreeView * view (GTK_TREE_VIEW (_tree_view));
GtkTreeSelection * selection (gtk_tree_view_get_selection (view));
GList * list (gtk_tree_selection_get_selected_rows (selection, &model));
@@ -2192,7 +2192,7 @@ namespace
struct ArticleIsParentOf: public ArticleTester {
virtual ~ArticleIsParentOf () {}
ArticleIsParentOf (const Data::ArticleTree& tree, const Article* a) {
- const Article * parent = a ? tree.get_parent(a->message_id) : 0;
+ const Article * parent = a ? tree.get_parent(a->message_id) : nullptr;
_mid = parent ? parent->message_id : "";
}
Quark _mid;
@@ -2263,7 +2263,7 @@ namespace
ActionManager& _am;
virtual void operator() (GtkTreeModel* model, GtkTreeIter* iter, const Article& a) {
SelectFunctor::operator() (model, iter, a);
- maybe_activate_on_idle (_view, gtk_tree_model_get_path(model,iter), 0);
+ maybe_activate_on_idle (_view, gtk_tree_model_get_path(model,iter), nullptr);
}
};
}
@@ -2280,10 +2280,10 @@ HeaderPane :: find_next_iterator_from (GtkTreeModel * model,
RowActionFunctor & success_func,
bool test_the_start_pos)
{
- g_assert (start_pos!=0);
+ g_assert (start_pos!=nullptr);
GtkTreeIter march = *start_pos;
bool success (false);
- const Article *article (0);
+ const Article *article (nullptr);
for (;;)
{
if (test_the_start_pos)
@@ -2307,7 +2307,7 @@ namespace
{
bool get_first_selection (GtkTreeSelection * sel, GtkTreeIter * setme)
{
- GtkTreeModel * model (0);
+ GtkTreeModel * model (nullptr);
GList * list (gtk_tree_selection_get_selected_rows (sel, &model));
const bool found (list && gtk_tree_model_get_iter (model, setme, (GtkTreePath*)(list->data)));
g_list_foreach (list, (GFunc)gtk_tree_path_free, NULL);
@@ -2448,7 +2448,7 @@ void
HeaderPane :: refresh_font ()
{
if (!_prefs.get_flag ("header-pane-font-enabled", false))
- gtk_widget_override_font (_tree_view, 0);
+ gtk_widget_override_font (_tree_view, nullptr);
else {
const std::string str (_prefs.get_string ("header-pane-font", "Sans 10"));
PangoFontDescription * pfd (pango_font_description_from_string (str.c_str()));
diff --git a/pan/gui/header-pane.h b/pan/gui/header-pane.h
index eb1288d..23647d7 100644
--- a/pan/gui/header-pane.h
+++ b/pan/gui/header-pane.h
@@ -250,8 +250,8 @@ namespace pan
action (action_in),
state (state_in),
is_read (data.is_read (a)),
- collated_subject(0),
- collated_author(0) {}
+ collated_subject(nullptr),
+ collated_author(nullptr) {}
virtual ~Row () {
g_free (collated_subject);
diff --git a/pan/gui/log-ui.cc b/pan/gui/log-ui.cc
index b05a90b..f5885a1 100644
--- a/pan/gui/log-ui.cc
+++ b/pan/gui/log-ui.cc
@@ -151,7 +151,7 @@ namespace
const Log::entries_t& entries (Log::get().get_entries());
foreach_const (Log::entries_t, entries, it) {
GtkTreeIter top, child, tmp;
- gtk_tree_store_prepend (store, &top, 0);
+ gtk_tree_store_prepend (store, &top, nullptr);
gtk_tree_store_set (store, &top,
COL_HIDDEN, "",
COL_SEVERITY, (it->severity & Log::PAN_SEVERITY_ERROR),
@@ -212,7 +212,7 @@ namespace
GtkTreeIter * iter,
gpointer )
{
- Log::Entry* log_entry(0);
+ Log::Entry* log_entry(nullptr);
gtk_tree_model_get (model, iter, COL_MESSAGE, &log_entry, -1);
bool bold (log_entry->is_child);
g_object_set (renderer,
@@ -277,7 +277,7 @@ log_dialog_new (Prefs& prefs, GtkWindow* window)
gtk_tree_view_set_show_expanders(GTK_TREE_VIEW(view),false);
g_object_set_data_full (G_OBJECT(view), "listener", new MyLogListener(store), delete_my_log_listener);
- GtkWidget * scroll = gtk_scrolled_window_new (0, 0);
+ GtkWidget * scroll = gtk_scrolled_window_new (nullptr, nullptr);
gtk_container_set_border_width (GTK_CONTAINER(scroll), PAD_BIG);
gtk_container_add (GTK_CONTAINER(scroll), view);
@@ -297,7 +297,7 @@ log_dialog_new (Prefs& prefs, GtkWindow* window)
gtk_tree_view_column_set_fixed_width (col, 35);
gtk_tree_view_column_set_resizable (col, false);
gtk_tree_view_column_pack_start (col, pixbuf_renderer, false);
- gtk_tree_view_column_set_cell_data_func (col, pixbuf_renderer, render_severity, dialog, 0);
+ gtk_tree_view_column_set_cell_data_func (col, pixbuf_renderer, render_severity, dialog, nullptr);
gtk_tree_view_column_set_sort_column_id (col, COL_SEVERITY);
gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
@@ -307,7 +307,7 @@ log_dialog_new (Prefs& prefs, GtkWindow* window)
gtk_tree_view_column_set_sort_column_id (col, COL_DATE);
gtk_tree_view_column_set_title (col, _("Date"));
gtk_tree_view_column_pack_start (col, text_renderer, false);
- gtk_tree_view_column_set_cell_data_func (col, text_renderer, render_date, 0, 0);
+ gtk_tree_view_column_set_cell_data_func (col, text_renderer, render_date, nullptr, nullptr);
gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
// message
@@ -317,7 +317,7 @@ log_dialog_new (Prefs& prefs, GtkWindow* window)
gtk_tree_view_column_set_sort_column_id (col, COL_MESSAGE);
gtk_tree_view_column_set_title (col, _("Message"));
gtk_tree_view_column_pack_start (col, text_renderer, true);
- gtk_tree_view_column_set_cell_data_func (col, text_renderer, render_message, 0, 0);
+ gtk_tree_view_column_set_cell_data_func (col, text_renderer, render_message, nullptr, nullptr);
gtk_tree_view_append_column (GTK_TREE_VIEW(view), col);
gtk_tree_view_set_expander_column(GTK_TREE_VIEW(view), col);
@@ -328,7 +328,7 @@ log_dialog_new (Prefs& prefs, GtkWindow* window)
gtk_window_set_role (GTK_WINDOW(dialog), "pan-events-dialog");
prefs.set_window ("events-window", GTK_WINDOW(dialog), 150, 150, 600, 300);
gtk_window_set_resizable (GTK_WINDOW(dialog), true);
- if (window != 0)
+ if (window != nullptr)
gtk_window_set_transient_for (GTK_WINDOW(dialog), window);
g_signal_connect (view, "button-press-event", G_CALLBACK(on_button_pressed), view);
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 83a19bd..7596f2b 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -94,7 +94,7 @@ namespace
namespace
{
- GMainLoop * nongui_gmainloop (0);
+ GMainLoop * nongui_gmainloop (nullptr);
void mainloop ()
{
@@ -198,13 +198,13 @@ namespace
const guint8 * pixbuf_txt;
GdkPixbuf * pixbuf;
} status_icons[NUM_STATUS_ICONS] = {
- { icon_status_online, 0 },
- { icon_status_offline, 0 },
- { icon_status_active, 0 },
- { icon_status_queue_empty, 0 },
- { icon_status_error, 0 },
- { icon_status_idle, 0 },
- { icon_status_new_articles, 0 }
+ { icon_status_online, nullptr },
+ { icon_status_offline, nullptr },
+ { icon_status_active, nullptr },
+ { icon_status_queue_empty, nullptr },
+ { icon_status_error, nullptr },
+ { icon_status_idle, nullptr },
+ { icon_status_new_articles, nullptr }
};
@@ -480,7 +480,7 @@ namespace
gtk_menu_popup(menu, NULL, NULL, NULL, NULL, button, activation_time);
}
- static QueueAndGui* queue_and_gui(0);
+ static QueueAndGui* queue_and_gui(nullptr);
void run_pan_with_status_icon (GtkWindow * window, GdkPixbuf * pixbuf, Queue& queue, Prefs & prefs, Data&
data, GUI* _gui)
{
@@ -488,7 +488,7 @@ namespace
GUI& gui (*_gui);
for (guint i=0; i<NUM_STATUS_ICONS; ++i)
- status_icons[i].pixbuf = gdk_pixbuf_new_from_inline (-1, status_icons[i].pixbuf_txt, FALSE, 0);
+ status_icons[i].pixbuf = gdk_pixbuf_new_from_inline (-1, status_icons[i].pixbuf_txt, FALSE, nullptr);
GtkStatusIcon * icon = gtk_status_icon_new_from_pixbuf (status_icons[ICON_STATUS_IDLE].pixbuf);
GtkWidget * menu = gtk_menu_new ();
@@ -834,7 +834,7 @@ _("General Options\n"
namespace
{
- GUI * gui_ptr (0);
+ GUI * gui_ptr (nullptr);
}
namespace
@@ -1085,11 +1085,11 @@ main (int argc, char *argv[])
if (gui) {
TaskPane * pane = new TaskPane (queue, prefs);
GtkWidget * w (pane->root());
- GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, icon_pan, FALSE, 0);
+ GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, icon_pan, FALSE, nullptr);
gtk_window_set_default_icon (pixbuf);
gtk_widget_show_all (w);
- g_signal_connect (w, "destroy", G_CALLBACK(destroy_cb), 0);
- g_signal_connect (G_OBJECT(w), "delete-event", G_CALLBACK(delete_event_cb), 0);
+ g_signal_connect (w, "destroy", G_CALLBACK(destroy_cb), nullptr);
+ g_signal_connect (G_OBJECT(w), "delete-event", G_CALLBACK(delete_event_cb), nullptr);
} else {
nongui_gmainloop = g_main_loop_new (NULL, false);
// create a PanKiller object -- which quits pan when the queue is done
@@ -1100,7 +1100,7 @@ main (int argc, char *argv[])
}
else
{
- GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, icon_pan, FALSE, 0);
+ GdkPixbuf * pixbuf = gdk_pixbuf_new_from_inline (-1, icon_pan, FALSE, nullptr);
GtkWidget * window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
if (prefs.get_flag ("main-window-is-maximized", false))
gtk_window_maximize (GTK_WINDOW (window));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]