[gnome-commander/gcmd-1-10: 54/57] C++ cast, use nullptr instead of NULL
- From: Uwe Scholz <uwescholz src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-commander/gcmd-1-10: 54/57] C++ cast, use nullptr instead of NULL
- Date: Thu, 11 Apr 2019 20:08:53 +0000 (UTC)
commit 1dd8d7f0d505ecd636286bab3563b61d2325aa02
Author: Uwe Scholz <u scholz83 gmx de>
Date: Thu Apr 11 17:55:49 2019 +0200
C++ cast, use nullptr instead of NULL
src/gnome-cmd-main-menu.cc | 470 ++++++++++++++++++-------------------
src/gnome-cmd-owner.cc | 4 +-
src/gnome-cmd-quicksearch-popup.cc | 32 +--
src/gnome-cmd-smb-net.cc | 4 +-
src/gnome-cmd-smb-path.cc | 52 ++--
src/gnome-cmd-user-actions.cc | 18 +-
src/gnome-cmd-xfer-progress-win.cc | 18 +-
src/gnome-cmd-xfer.cc | 56 ++---
src/imageloader.cc | 52 ++--
9 files changed, 353 insertions(+), 353 deletions(-)
---
diff --git a/src/gnome-cmd-main-menu.cc b/src/gnome-cmd-main-menu.cc
index 21ad2c7b..2e754e3a 100644
--- a/src/gnome-cmd-main-menu.cc
+++ b/src/gnome-cmd-main-menu.cc
@@ -82,17 +82,17 @@ struct MenuData
#define MENUTYPE_END { \
MENU_TYPE_END, \
- NULL, NULL, NULL, \
- NULL, NULL, \
- (GnomeUIPixmapType) 0, NULL, \
- NULL }
+ nullptr, nullptr, nullptr, \
+ nullptr, nullptr, \
+ (GnomeUIPixmapType) 0, nullptr, \
+ nullptr }
#define MENUTYPE_SEPARATOR { \
MENU_TYPE_SEPARATOR, \
- NULL, NULL, NULL, \
- NULL, NULL, \
- (GnomeUIPixmapType) 0, NULL, \
- NULL }
+ nullptr, nullptr, nullptr, \
+ nullptr, nullptr, \
+ (GnomeUIPixmapType) 0, nullptr, \
+ nullptr }
struct GnomeCmdMainMenuPrivate
@@ -121,7 +121,7 @@ struct GnomeCmdMainMenuPrivate
};
-static GtkMenuBarClass *parent_class = NULL;
+static GtkMenuBarClass *parent_class = nullptr;
/*******************************
@@ -130,7 +130,7 @@ static GtkMenuBarClass *parent_class = NULL;
static void on_bookmark_selected (GtkMenuItem *menuitem, GnomeCmdBookmark *bookmark)
{
- g_return_if_fail (bookmark != NULL);
+ g_return_if_fail (bookmark != nullptr);
gnome_cmd_bookmark_goto (bookmark);
}
@@ -144,10 +144,10 @@ static void on_con_list_list_changed (GnomeCmdConList *con_list, GnomeCmdMainMen
static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent, MenuData *spec)
{
- GtkWidget *item=NULL;
- GtkWidget *desc=NULL;
- GtkWidget *shortcut=NULL;
- GtkWidget *content = NULL;
+ GtkWidget *item=nullptr;
+ GtkWidget *desc=nullptr;
+ GtkWidget *shortcut=nullptr;
+ GtkWidget *content = nullptr;
#if defined (__GNUC__)
#pragma GCC diagnostic push
@@ -179,7 +179,7 @@ static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent
if (spec->pixmap_type != 0 && spec->pixmap_info)
{
- GtkWidget *pixmap = NULL;
+ GtkWidget *pixmap = nullptr;
pixmap = create_ui_pixmap (*main_win, spec->pixmap_type, spec->pixmap_info,
GTK_ICON_SIZE_MENU);
if (pixmap)
@@ -189,7 +189,7 @@ static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent
}
}
if (spec->tooltip)
- gtk_tooltips_set_tip (main_menu->priv->tooltips, item, spec->tooltip, NULL);
+ gtk_tooltips_set_tip (main_menu->priv->tooltips, item, spec->tooltip, nullptr);
gtk_container_add (GTK_CONTAINER (item), content);
break;
@@ -216,7 +216,7 @@ static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent
default:
g_warning ("This MENU_TYPE is not implemented");
- return NULL;
+ return nullptr;
}
#if defined (__GNUC__)
#pragma GCC diagnostic pop
@@ -240,7 +240,7 @@ static GtkWidget *create_menu_item (GnomeCmdMainMenu *main_menu, GtkMenu *parent
static GtkWidget *create_menu (GnomeCmdMainMenu *main_menu, MenuData *spec, MenuData *childs)
{
GtkWidget *submenu = gtk_menu_new ();
- GtkWidget *menu_item = create_menu_item (main_menu, NULL, spec);
+ GtkWidget *menu_item = create_menu_item (main_menu, nullptr, spec);
gtk_menu_item_set_submenu (GTK_MENU_ITEM (menu_item), submenu);
@@ -267,15 +267,15 @@ add_menu_item (GnomeCmdMainMenu *main_menu,
GtkSignalFunc callback,
gpointer user_data)
{
- g_return_val_if_fail (GTK_IS_MENU_SHELL (menu), NULL);
+ g_return_val_if_fail (GTK_IS_MENU_SHELL (menu), nullptr);
GtkWidget *item, *label;
- GtkWidget *pixmap_widget = NULL;
+ GtkWidget *pixmap_widget = nullptr;
item = gtk_image_menu_item_new ();
if (tooltip)
- gtk_tooltips_set_tip (main_menu->priv->tooltips, item, tooltip, NULL);
+ gtk_tooltips_set_tip (main_menu->priv->tooltips, item, tooltip, nullptr);
if (pixmap && mask)
pixmap_widget = gtk_pixmap_new (pixmap, mask);
@@ -323,7 +323,7 @@ static void add_bookmark_menu_item (GnomeCmdMainMenu *main_menu, GtkMenuShell *m
{
GtkWidget *item;
- item = add_menu_item (main_menu, menu, bookmark->name, NULL,
+ item = add_menu_item (main_menu, menu, bookmark->name, nullptr,
IMAGE_get_pixmap (PIXMAP_BOOKMARK), IMAGE_get_mask (PIXMAP_BOOKMARK),
GTK_SIGNAL_FUNC (on_bookmark_selected), bookmark);
@@ -335,12 +335,12 @@ static void add_bookmark_menu_item (GnomeCmdMainMenu *main_menu, GtkMenuShell *m
static void add_bookmark_group (GnomeCmdMainMenu *main_menu, GtkMenuShell *menu, GnomeCmdBookmarkGroup
*group)
{
g_return_if_fail (GTK_IS_MENU_SHELL (menu));
- g_return_if_fail (group != NULL);
+ g_return_if_fail (group != nullptr);
GnomeCmdPixmap *pixmap = gnome_cmd_con_get_go_pixmap (group->con);
- GtkWidget *item = add_menu_item (main_menu, menu, gnome_cmd_con_get_alias (group->con), NULL,
- pixmap?pixmap->pixmap:NULL, pixmap?pixmap->mask:NULL,
- NULL, NULL);
+ GtkWidget *item = add_menu_item (main_menu, menu, gnome_cmd_con_get_alias (group->con), nullptr,
+ pixmap?pixmap->pixmap:nullptr, pixmap?pixmap->mask:nullptr,
+ nullptr, nullptr);
// Remember this bookmarks item-widget so that we can remove it later
main_menu->priv->group_menuitems = g_list_append (main_menu->priv->group_menuitems, item);
@@ -352,7 +352,7 @@ static void add_bookmark_group (GnomeCmdMainMenu *main_menu, GtkMenuShell *menu,
for (GList *bookmarks = group->bookmarks; bookmarks; bookmarks = bookmarks->next)
{
- GnomeCmdBookmark *bookmark = (GnomeCmdBookmark *) bookmarks->data;
+ auto bookmark = static_cast<GnomeCmdBookmark*> (bookmarks->data);
add_bookmark_menu_item (main_menu, GTK_MENU_SHELL (submenu), bookmark);
}
}
@@ -375,7 +375,7 @@ static void destroy (GtkObject *object)
static void map (GtkWidget *widget)
{
- if (GTK_WIDGET_CLASS (parent_class)->map != NULL)
+ if (GTK_WIDGET_CLASS (parent_class)->map != nullptr)
GTK_WIDGET_CLASS (parent_class)->map (widget);
}
@@ -396,80 +396,80 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData files_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("Change _Owner/Group"), "", NULL,
- (gpointer) file_chown, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Change _Owner/Group"), "", nullptr,
+ (gpointer) file_chown, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Change Per_missions"), "", NULL,
- (gpointer) file_chmod, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Change Per_missions"), "", nullptr,
+ (gpointer) file_chmod, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Advanced _Rename Tool"), "Ctrl+M", NULL,
- (gpointer) file_advrename, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Advanced _Rename Tool"), "Ctrl+M", nullptr,
+ (gpointer) file_advrename, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Create _Symbolic Link"), "Ctrl+Shift+F5", NULL,
- (gpointer) file_create_symlink, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Create _Symbolic Link"), "Ctrl+Shift+F5", nullptr,
+ (gpointer) file_create_symlink, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Properties…"), "Alt+ENTER", NULL,
- (gpointer) file_properties, NULL,
+ MENU_TYPE_ITEM, _("_Properties…"), "Alt+ENTER", nullptr,
+ (gpointer) file_properties, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_PROPERTIES,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("_Search…"), "Alt+F7", NULL,
- (gpointer) edit_search, NULL,
+ MENU_TYPE_ITEM, _("_Search…"), "Alt+F7", nullptr,
+ (gpointer) edit_search, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_FIND,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Quick Search…"), "", NULL,
- (gpointer) edit_quick_search, NULL,
+ MENU_TYPE_ITEM, _("_Quick Search…"), "", nullptr,
+ (gpointer) edit_quick_search, nullptr,
GNOME_APP_PIXMAP_NONE, 0,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Enable Filter…"), "", NULL,
- (gpointer) edit_filter, NULL,
+ MENU_TYPE_ITEM, _("_Enable Filter…"), "", nullptr,
+ (gpointer) edit_filter, nullptr,
GNOME_APP_PIXMAP_NONE, 0,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("_Diff"), "", NULL,
- (gpointer) file_diff, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Diff"), "", nullptr,
+ (gpointer) file_diff, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("S_ynchronize Directories"), "", NULL,
- (gpointer) file_sync_dirs, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("S_ynchronize Directories"), "", nullptr,
+ (gpointer) file_sync_dirs, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("Start _GNOME Commander as root"), "", NULL,
- (gpointer) command_root_mode, NULL,
+ MENU_TYPE_ITEM, _("Start _GNOME Commander as root"), "", nullptr,
+ (gpointer) command_root_mode, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_DIALOG_AUTHENTICATION,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("_Quit"), "Ctrl+Q", NULL,
- (gpointer) file_exit, NULL,
+ MENU_TYPE_ITEM, _("_Quit"), "Ctrl+Q", nullptr,
+ (gpointer) file_exit, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_QUIT,
- NULL
+ nullptr
},
MENUTYPE_END
};
@@ -477,59 +477,59 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData mark_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Select All"), "Ctrl++", NULL,
- (gpointer) mark_select_all, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Select All"), "Ctrl++", nullptr,
+ (gpointer) mark_select_all, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Unselect All"), "Ctrl+-", NULL,
- (gpointer) mark_unselect_all, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Unselect All"), "Ctrl+-", nullptr,
+ (gpointer) mark_unselect_all, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Select with _Pattern"), "+", NULL,
- (gpointer) mark_select_with_pattern, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Select with _Pattern"), "+", nullptr,
+ (gpointer) mark_select_with_pattern, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Unselect with P_attern"), "-", NULL,
- (gpointer) mark_unselect_with_pattern, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Unselect with P_attern"), "-", nullptr,
+ (gpointer) mark_unselect_with_pattern, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Select with same _Extension"), "", NULL,
- (gpointer) mark_select_all_with_same_extension, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Select with same _Extension"), "", nullptr,
+ (gpointer) mark_select_all_with_same_extension, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Unselect with same E_xtension"), "", NULL,
- (gpointer) mark_unselect_all_with_same_extension, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Unselect with same E_xtension"), "", nullptr,
+ (gpointer) mark_unselect_all_with_same_extension, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Invert Selection"), "*", NULL,
- (gpointer) mark_invert_selection, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Invert Selection"), "*", nullptr,
+ (gpointer) mark_invert_selection, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Restore Selection"), "", NULL,
- (gpointer) mark_restore_selection, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Restore Selection"), "", nullptr,
+ (gpointer) mark_restore_selection, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("_Compare Directories"), "Shift+F2", NULL,
- (gpointer) mark_compare_directories, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Compare Directories"), "Shift+F2", nullptr,
+ (gpointer) mark_compare_directories, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_END
};
@@ -537,35 +537,35 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData edit_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("Cu_t"), "Ctrl+X", NULL,
- (gpointer) edit_cap_cut, NULL,
+ MENU_TYPE_ITEM, _("Cu_t"), "Ctrl+X", nullptr,
+ (gpointer) edit_cap_cut, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CUT,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Copy"), "Ctrl+C", NULL,
- (gpointer) edit_cap_copy, NULL,
+ MENU_TYPE_ITEM, _("_Copy"), "Ctrl+C", nullptr,
+ (gpointer) edit_cap_copy, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_COPY,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Paste"), "Ctrl+V", NULL,
- (gpointer) edit_cap_paste, NULL,
+ MENU_TYPE_ITEM, _("_Paste"), "Ctrl+V", nullptr,
+ (gpointer) edit_cap_paste, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_PASTE,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Delete"), "Delete", NULL,
- (gpointer) file_delete, NULL,
+ MENU_TYPE_ITEM, _("_Delete"), "Delete", nullptr,
+ (gpointer) file_delete, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_DELETE,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("Copy _File Names"), "", NULL,
- (gpointer) edit_copy_fnames, NULL,
+ MENU_TYPE_ITEM, _("Copy _File Names"), "", nullptr,
+ (gpointer) edit_copy_fnames, nullptr,
GNOME_APP_PIXMAP_NONE, 0,
- NULL
+ nullptr
},
MENUTYPE_END
};
@@ -573,104 +573,104 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData view_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Back"), "Alt+Left", NULL,
- (gpointer) view_back, NULL,
+ MENU_TYPE_ITEM, _("_Back"), "Alt+Left", nullptr,
+ (gpointer) view_back, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_GO_BACK,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Forward"), "Alt+Right", NULL,
- (gpointer) view_forward, NULL,
+ MENU_TYPE_ITEM, _("_Forward"), "Alt+Right", nullptr,
+ (gpointer) view_forward, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_GO_FORWARD,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Refresh"), "Ctrl+R", NULL,
- (gpointer) view_refresh, NULL,
+ MENU_TYPE_ITEM, _("_Refresh"), "Ctrl+R", nullptr,
+ (gpointer) view_refresh, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_REFRESH,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("Open in New _Tab"), "Ctrl+T", NULL,
- (gpointer) view_new_tab, NULL,
+ MENU_TYPE_ITEM, _("Open in New _Tab"), "Ctrl+T", nullptr,
+ (gpointer) view_new_tab, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_OPEN,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Close Tab"), "Ctrl+W", NULL,
- (gpointer) view_close_tab, NULL,
+ MENU_TYPE_ITEM, _("_Close Tab"), "Ctrl+W", nullptr,
+ (gpointer) view_close_tab, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CLOSE,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Close _All Tabs"), "Ctrl+Shift+W", NULL,
- (gpointer) view_close_all_tabs, NULL,
+ MENU_TYPE_ITEM, _("Close _All Tabs"), "Ctrl+Shift+W", nullptr,
+ (gpointer) view_close_all_tabs, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CLOSE,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_TOGGLEITEM, _("Show Toolbar"), "", NULL,
- (gpointer) view_toolbar, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Toolbar"), "", nullptr,
+ (gpointer) view_toolbar, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_TOGGLEITEM, _("Show Device Buttons"), "", NULL,
- (gpointer) view_conbuttons, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Device Buttons"), "", nullptr,
+ (gpointer) view_conbuttons, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_TOGGLEITEM, _("Show Device List"), "", NULL,
- (gpointer) view_devlist, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Device List"), "", nullptr,
+ (gpointer) view_devlist, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_TOGGLEITEM, _("Show Command Line"), "", NULL,
- (gpointer) view_cmdline, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Command Line"), "", nullptr,
+ (gpointer) view_cmdline, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_TOGGLEITEM, _("Show Buttonbar"), "", NULL,
- (gpointer) view_buttonbar, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Buttonbar"), "", nullptr,
+ (gpointer) view_buttonbar, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_TOGGLEITEM, _("Show Hidden Files"), "Ctrl+Shift+H", NULL,
- (gpointer) view_hidden_files, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Hidden Files"), "Ctrl+Shift+H", nullptr,
+ (gpointer) view_hidden_files, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_TOGGLEITEM, _("Show Backup Files"), "", NULL,
- (gpointer) view_backup_files, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Show Backup Files"), "", nullptr,
+ (gpointer) view_backup_files, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("_Equal Panel Size"), "Ctrl+Shift+=", NULL,
- (gpointer) view_equal_panes, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Equal Panel Size"), "Ctrl+Shift+=", nullptr,
+ (gpointer) view_equal_panes, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Maximize Panel Size"), "", NULL,
- (gpointer) view_maximize_pane, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("Maximize Panel Size"), "", nullptr,
+ (gpointer) view_maximize_pane, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
{
- MENU_TYPE_TOGGLEITEM, _("Horizontal Orientation"), "", NULL,
- (gpointer) view_horizontal_orientation, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_TOGGLEITEM, _("Horizontal Orientation"), "", nullptr,
+ (gpointer) view_horizontal_orientation, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_END
};
@@ -678,16 +678,16 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData bookmarks_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Bookmark this Directory…"), "", NULL,
- (gpointer) bookmarks_add_current, NULL,
+ MENU_TYPE_ITEM, _("_Bookmark this Directory…"), "", nullptr,
+ (gpointer) bookmarks_add_current, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_ADD,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Manage Bookmarks…"), "Ctrl+D", NULL,
- (gpointer) bookmarks_edit, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL
+ MENU_TYPE_ITEM, _("_Manage Bookmarks…"), "Ctrl+D", nullptr,
+ (gpointer) bookmarks_edit, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr
},
MENUTYPE_SEPARATOR,
MENUTYPE_END
@@ -696,10 +696,10 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData plugins_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Configure Plugins…"), "", NULL,
- (gpointer) plugins_configure, NULL,
+ MENU_TYPE_ITEM, _("_Configure Plugins…"), "", nullptr,
+ (gpointer) plugins_configure, nullptr,
GNOME_APP_PIXMAP_DATA, exec_wheel_xpm,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
MENUTYPE_END
@@ -708,16 +708,16 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData options_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Options…"), "Ctrl+O", NULL,
- (gpointer) options_edit, NULL,
+ MENU_TYPE_ITEM, _("_Options…"), "Ctrl+O", nullptr,
+ (gpointer) options_edit, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_PREFERENCES,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Keyboard Shortcuts…"), "", NULL,
- (gpointer) options_edit_shortcuts, NULL,
+ MENU_TYPE_ITEM, _("_Keyboard Shortcuts…"), "", nullptr,
+ (gpointer) options_edit_shortcuts, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_ITALIC,
- NULL
+ nullptr
},
MENUTYPE_END
};
@@ -725,16 +725,16 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData connections_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Remote Server…"), "Ctrl+F", NULL,
- (gpointer) connections_open, NULL,
+ MENU_TYPE_ITEM, _("_Remote Server…"), "Ctrl+F", nullptr,
+ (gpointer) connections_open, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CONNECT,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("New Connection…"), "Ctrl+N", NULL,
- (gpointer) connections_new, NULL,
+ MENU_TYPE_ITEM, _("New Connection…"), "Ctrl+N", nullptr,
+ (gpointer) connections_new, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_CONNECT,
- NULL
+ nullptr
},
MENUTYPE_END
};
@@ -742,50 +742,50 @@ static void init (GnomeCmdMainMenu *main_menu)
MenuData help_menu_uiinfo[] =
{
{
- MENU_TYPE_ITEM, _("_Documentation"), "F1", NULL,
- (gpointer) help_help, NULL,
+ MENU_TYPE_ITEM, _("_Documentation"), "F1", nullptr,
+ (gpointer) help_help, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_HELP,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("_Keyboard Shortcuts"), "", NULL,
- (gpointer) help_keyboard, NULL,
+ MENU_TYPE_ITEM, _("_Keyboard Shortcuts"), "", nullptr,
+ (gpointer) help_keyboard, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_ITALIC,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("GNOME Commander on the _Web"), "", NULL,
- (gpointer) help_web, NULL,
+ MENU_TYPE_ITEM, _("GNOME Commander on the _Web"), "", nullptr,
+ (gpointer) help_web, nullptr,
GNOME_APP_PIXMAP_NONE, 0,
- NULL
+ nullptr
},
{
- MENU_TYPE_ITEM, _("Report a _Problem"), "", NULL,
- (gpointer) help_problem, NULL,
+ MENU_TYPE_ITEM, _("Report a _Problem"), "", nullptr,
+ (gpointer) help_problem, nullptr,
GNOME_APP_PIXMAP_NONE, 0,
- NULL
+ nullptr
},
MENUTYPE_SEPARATOR,
{
- MENU_TYPE_ITEM, _("_About"), "", NULL,
- (gpointer) help_about, NULL,
+ MENU_TYPE_ITEM, _("_About"), "", nullptr,
+ (gpointer) help_about, nullptr,
GNOME_APP_PIXMAP_STOCK, GTK_STOCK_ABOUT,
- NULL
+ nullptr
},
MENUTYPE_END
};
MenuData spec = { MENU_TYPE_BASIC, "", "", "",
- NULL, NULL,
- GNOME_APP_PIXMAP_NONE, NULL,
- NULL };
+ nullptr, nullptr,
+ GNOME_APP_PIXMAP_NONE, nullptr,
+ nullptr };
main_menu->priv = g_new (GnomeCmdMainMenuPrivate, 1);
main_menu->priv->tooltips = gtk_tooltips_new ();
- main_menu->priv->bookmark_menuitems = NULL;
- main_menu->priv->connections_menuitems = NULL;
- main_menu->priv->group_menuitems = NULL;
- main_menu->priv->view_menuitems = NULL;
+ main_menu->priv->bookmark_menuitems = nullptr;
+ main_menu->priv->connections_menuitems = nullptr;
+ main_menu->priv->group_menuitems = nullptr;
+ main_menu->priv->view_menuitems = nullptr;
//gtk_menu_bar_set_shadow_type (GTK_MENU_BAR (main_menu), GTK_SHADOW_NONE);
@@ -851,7 +851,7 @@ static void init (GnomeCmdMainMenu *main_menu)
GtkWidget *gnome_cmd_main_menu_new ()
{
- return (GtkWidget *) g_object_new (GNOME_CMD_TYPE_MAIN_MENU, NULL);
+ return (GtkWidget *) g_object_new (GNOME_CMD_TYPE_MAIN_MENU, nullptr);
}
@@ -868,9 +868,9 @@ GtkType gnome_cmd_main_menu_get_type ()
sizeof (GnomeCmdMainMenuClass),
(GtkClassInitFunc) class_init,
(GtkObjectInitFunc) init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL
+ /* reserved_1 */ nullptr,
+ /* reserved_2 */ nullptr,
+ (GtkClassInitFunc) nullptr
};
dlg_type = gtk_type_unique (gtk_menu_bar_get_type (), &dlg_info);
@@ -884,7 +884,7 @@ static void add_connection (GnomeCmdMainMenu *main_menu, GnomeCmdCon *con, const
GtkMenuShell *connections_menu =GTK_MENU_SHELL (GTK_MENU_ITEM
(main_menu->priv->connections_menu)->submenu);
GtkWidget *item;
- item = add_menu_item (main_menu, connections_menu, text, NULL, pixmap?pixmap->pixmap:NULL,
pixmap?pixmap->mask:NULL, func, con);
+ item = add_menu_item (main_menu, connections_menu, text, nullptr, pixmap?pixmap->pixmap:nullptr,
pixmap?pixmap->mask:nullptr, func, con);
main_menu->priv->connections_menuitems = g_list_append (main_menu->priv->connections_menuitems, item);
}
@@ -901,9 +901,9 @@ void gnome_cmd_main_menu_update_connections (GnomeCmdMainMenu *main_menu)
// GList *dev_cons = gnome_cmd_con_list_get_all_dev (con_list);
// Remove all old items
- g_list_foreach (main_menu->priv->connections_menuitems, (GFunc) gtk_widget_destroy, NULL);
+ g_list_foreach (main_menu->priv->connections_menuitems, (GFunc) gtk_widget_destroy, nullptr);
g_list_free (main_menu->priv->connections_menuitems);
- main_menu->priv->connections_menuitems = NULL;
+ main_menu->priv->connections_menuitems = nullptr;
// separator
main_menu->priv->connections_menuitems = g_list_append (main_menu->priv->connections_menuitems,
add_separator (main_menu, connections_menu));
@@ -948,14 +948,14 @@ void gnome_cmd_main_menu_update_bookmarks (GnomeCmdMainMenu *main_menu)
g_return_if_fail (GNOME_CMD_IS_MAIN_MENU (main_menu));
// Remove all old bookmark menu items
- g_list_foreach (main_menu->priv->bookmark_menuitems, (GFunc) gtk_widget_destroy, NULL);
+ g_list_foreach (main_menu->priv->bookmark_menuitems, (GFunc) gtk_widget_destroy, nullptr);
g_list_free (main_menu->priv->bookmark_menuitems);
- main_menu->priv->bookmark_menuitems = NULL;
+ main_menu->priv->bookmark_menuitems = nullptr;
// Remove all old group menu items
- g_list_foreach (main_menu->priv->group_menuitems, (GFunc) gtk_widget_destroy, NULL);
+ g_list_foreach (main_menu->priv->group_menuitems, (GFunc) gtk_widget_destroy, nullptr);
g_list_free (main_menu->priv->group_menuitems);
- main_menu->priv->group_menuitems = NULL;
+ main_menu->priv->group_menuitems = nullptr;
// Add bookmark groups
GList *cons = gnome_cmd_con_list_get_all (gnome_cmd_con_list_get ());
@@ -983,7 +983,7 @@ void gnome_cmd_main_menu_update_sens (GnomeCmdMainMenu *main_menu)
static void on_plugin_menu_activate (GtkMenuItem *item, PluginData *data)
{
- g_return_if_fail (data != NULL);
+ g_return_if_fail (data != nullptr);
GnomeCmdState *state = main_win->get_state();
gnome_cmd_plugin_update_main_menu_state (data->plugin, state);
diff --git a/src/gnome-cmd-owner.cc b/src/gnome-cmd-owner.cc
index 056e58ab..9a76f1c5 100644
--- a/src/gnome-cmd-owner.cc
+++ b/src/gnome-cmd-owner.cc
@@ -120,11 +120,11 @@ gpointer GnomeCmdOwner::perform_load_operation (GnomeCmdOwner *self)
self->group_names = g_list_sort (self->group_names, (GCompareFunc) compare_names); ;
- return NULL;
+ return nullptr;
}
void GnomeCmdOwner::load_async()
{
- thread = g_thread_new (NULL, (GThreadFunc) perform_load_operation, this);
+ thread = g_thread_new (nullptr, (GThreadFunc) perform_load_operation, this);
}
diff --git a/src/gnome-cmd-quicksearch-popup.cc b/src/gnome-cmd-quicksearch-popup.cc
index 8146cab4..0bc77266 100644
--- a/src/gnome-cmd-quicksearch-popup.cc
+++ b/src/gnome-cmd-quicksearch-popup.cc
@@ -1,4 +1,4 @@
-/**
+/**
* @file gnome-cmd-quicksearch-popup.cc
* @copyright (C) 2001-2006 Marcus Bjurman\n
* @copyright (C) 2007-2012 Piotr Eljasiak\n
@@ -31,7 +31,7 @@
using namespace std;
-static GtkWindowClass *parent_class = NULL;
+static GtkWindowClass *parent_class = nullptr;
struct GnomeCmdQuicksearchPopupPrivate
{
@@ -60,7 +60,7 @@ inline void focus_file (GnomeCmdQuicksearchPopup *popup, GnomeCmdFile *f)
static void set_filter (GnomeCmdQuicksearchPopup *popup, const gchar *text)
{
g_return_if_fail (GNOME_CMD_IS_FILE_LIST (popup->priv->fl));
- g_return_if_fail (text != NULL);
+ g_return_if_fail (text != nullptr);
gboolean first = TRUE;
@@ -71,19 +71,19 @@ static void set_filter (GnomeCmdQuicksearchPopup *popup, const gchar *text)
if (popup->priv->matches)
{
g_list_free (popup->priv->matches);
- popup->priv->matches = NULL;
+ popup->priv->matches = nullptr;
}
gchar *pattern;
if (gnome_cmd_data.options.quick_search_exact_match_begin)
- pattern = gnome_cmd_data.options.quick_search_exact_match_end ? g_strdup (text) : g_strconcat (text,
"*", NULL);
+ pattern = gnome_cmd_data.options.quick_search_exact_match_end ? g_strdup (text) : g_strconcat (text,
"*", nullptr);
else
- pattern = gnome_cmd_data.options.quick_search_exact_match_end ? g_strconcat ("*", text, NULL) :
g_strconcat ("*", text, "*", NULL);
+ pattern = gnome_cmd_data.options.quick_search_exact_match_end ? g_strconcat ("*", text, nullptr) :
g_strconcat ("*", text, "*", nullptr);
for (GList *files = popup->priv->fl->get_visible_files(); files; files = files->next)
{
- GnomeCmdFile *f = (GnomeCmdFile *) files->data;
+ auto f = static_cast<GnomeCmdFile*> (files->data);
if (gnome_cmd_filter_fnmatch (pattern, f->info->name, gnome_cmd_data.options.case_sens_sort))
{
@@ -100,7 +100,7 @@ static void set_filter (GnomeCmdQuicksearchPopup *popup, const gchar *text)
g_free (pattern);
// If no file matches the new filter, focus on the last file that matched a previous filter
- if (popup->priv->matches==NULL && popup->priv->last_focused_file!=NULL)
+ if (popup->priv->matches == nullptr && popup->priv->last_focused_file != nullptr)
popup->priv->matches = g_list_append (popup->priv->matches, popup->priv->last_focused_file);
popup->priv->pos = popup->priv->matches;
@@ -116,7 +116,7 @@ inline void hide_popup (GnomeCmdQuicksearchPopup *popup)
gtk_widget_grab_focus (GTK_WIDGET (popup->priv->fl));
if (popup->priv->matches)
g_list_free (popup->priv->matches);
- popup->priv->last_focused_file = NULL;
+ popup->priv->last_focused_file = nullptr;
gtk_widget_hide (GTK_WIDGET (popup));
}
@@ -245,7 +245,7 @@ static void destroy (GtkObject *object)
static void map (GtkWidget *widget)
{
- if (GTK_WIDGET_CLASS (parent_class)->map != NULL)
+ if (GTK_WIDGET_CLASS (parent_class)->map != nullptr)
GTK_WIDGET_CLASS (parent_class)->map (widget);
}
@@ -266,7 +266,7 @@ static void init (GnomeCmdQuicksearchPopup *popup)
{
popup->priv = g_new0 (GnomeCmdQuicksearchPopupPrivate, 1);
- popup->frame = gtk_frame_new (NULL);
+ popup->frame = gtk_frame_new (nullptr);
gtk_frame_set_shadow_type (GTK_FRAME (popup->frame), GTK_SHADOW_OUT);
popup->box = gtk_hbox_new (FALSE, 2);
popup->lbl = gtk_label_new (_("Search"));
@@ -314,9 +314,9 @@ GtkType gnome_cmd_quicksearch_popup_get_type ()
sizeof (GnomeCmdQuicksearchPopupClass),
(GtkClassInitFunc) class_init,
(GtkObjectInitFunc) init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL
+ /* reserved_1 */ nullptr,
+ /* reserved_2 */ nullptr,
+ (GtkClassInitFunc) nullptr
};
type = gtk_type_unique (gtk_window_get_type (), &info);
@@ -329,10 +329,10 @@ GtkWidget *gnome_cmd_quicksearch_popup_new (GnomeCmdFileList *fl)
{
GnomeCmdQuicksearchPopup *popup;
- popup = (GnomeCmdQuicksearchPopup *) g_object_new (GNOME_CMD_TYPE_QUICKSEARCH_POPUP, NULL);
+ popup = static_cast<GnomeCmdQuicksearchPopup*> (g_object_new (GNOME_CMD_TYPE_QUICKSEARCH_POPUP,
nullptr));
GTK_WINDOW (popup)->type = GTK_WINDOW_POPUP;
popup->priv->fl = fl;
- popup->priv->last_focused_file = NULL;
+ popup->priv->last_focused_file = nullptr;
set_popup_position (popup);
return GTK_WIDGET (popup);
diff --git a/src/gnome-cmd-smb-net.cc b/src/gnome-cmd-smb-net.cc
index 896b2f56..5653f644 100644
--- a/src/gnome-cmd-smb-net.cc
+++ b/src/gnome-cmd-smb-net.cc
@@ -151,12 +151,12 @@ SmbEntity *gnome_cmd_smb_net_get_entity (const gchar *name)
b = TRUE;
}
- SmbEntity *ent = (SmbEntity *) g_hash_table_lookup (entities, name);
+ auto ent = static_cast<SmbEntity*> (g_hash_table_lookup (entities, name));
if (!ent && !b)
{
DEBUG ('s', "Entity not found, rebuilding the database\n");
rebuild_map ();
- ent = (SmbEntity *) g_hash_table_lookup (entities, name);
+ ent = static_cast<SmbEntity*> (g_hash_table_lookup (entities, name));
}
if (ent)
diff --git a/src/gnome-cmd-smb-path.cc b/src/gnome-cmd-smb-path.cc
index b0f56524..54eefce8 100644
--- a/src/gnome-cmd-smb-path.cc
+++ b/src/gnome-cmd-smb-path.cc
@@ -1,4 +1,4 @@
-/**
+/**
* @file gnome-cmd-smb-path.cc
* @copyright (C) 2001-2006 Marcus Bjurman\n
* @copyright (C) 2007-2012 Piotr Eljasiak\n
@@ -39,10 +39,10 @@ inline void GnomeCmdSmbPath::set_resources(const gchar *set_res_workgroup, const
{
this->resource = g_strdup (set_res_resource);
this->resource_path = g_strdup (set_res_path);
- this->path = g_strconcat (G_DIR_SEPARATOR_S, set_res_resource, set_res_path, NULL);
+ this->path = g_strconcat (G_DIR_SEPARATOR_S, set_res_resource, set_res_path, nullptr);
}
else
- this->path = g_strconcat (G_DIR_SEPARATOR_S, set_res_workgroup, NULL);
+ this->path = g_strconcat (G_DIR_SEPARATOR_S, set_res_workgroup, nullptr);
}
else
this->path = g_strdup (G_DIR_SEPARATOR_S);
@@ -54,11 +54,11 @@ inline void GnomeCmdSmbPath::set_resources(const gchar *set_res_workgroup, const
GnomeCmdPath *GnomeCmdSmbPath::get_parent()
{
if (!workgroup)
- return NULL;
+ return nullptr;
- gchar *a = NULL,
- *b = NULL,
- *c = NULL;
+ gchar *a = nullptr,
+ *b = nullptr,
+ *c = nullptr;
if (resource)
{
@@ -71,7 +71,7 @@ GnomeCmdPath *GnomeCmdSmbPath::get_parent()
if (u1 && gnome_vfs_uri_has_parent (u1))
{
GnomeVFSURI *u2 = gnome_vfs_uri_get_parent (u1);
- g_return_val_if_fail (u2 != NULL, NULL);
+ g_return_val_if_fail (u2 != nullptr, nullptr);
gchar *s = gnome_vfs_uri_to_string (u2, GNOME_VFS_URI_HIDE_PASSWORD);
gnome_vfs_uri_unref (u2);
@@ -93,12 +93,12 @@ GnomeCmdPath *GnomeCmdSmbPath::get_parent()
GnomeCmdPath *GnomeCmdSmbPath::get_child(const gchar *child)
{
- g_return_val_if_fail (child != NULL, NULL);
- g_return_val_if_fail (child[0] != '/', NULL);
+ g_return_val_if_fail (child != nullptr, nullptr);
+ g_return_val_if_fail (child[0] != '/', nullptr);
- gchar *a = NULL,
- *b = NULL,
- *c = NULL;
+ gchar *a = nullptr,
+ *b = nullptr,
+ *c = nullptr;
if (workgroup)
{
@@ -116,7 +116,7 @@ GnomeCmdPath *GnomeCmdSmbPath::get_parent()
else
u2 = gnome_vfs_uri_append_path (u1, child);
gnome_vfs_uri_unref (u1);
- g_return_val_if_fail (u2 != NULL, NULL);
+ g_return_val_if_fail (u2 != nullptr, nullptr);
c = gnome_vfs_unescape_string (gnome_vfs_uri_get_path (u2), 0);
gnome_vfs_uri_unref (u2);
@@ -151,10 +151,10 @@ GnomeCmdSmbPath::GnomeCmdSmbPath(const gchar *constr_workgroup, const gchar *con
GnomeCmdSmbPath::GnomeCmdSmbPath(const gchar *path_str): workgroup(0), resource(0), resource_path(0),
path(0), display_path(0)
{
- g_return_if_fail (path_str != NULL);
+ g_return_if_fail (path_str != nullptr);
gchar *s, *t;
- gchar *c = NULL;
+ gchar *c = nullptr;
DEBUG('s', "Creating smb-path for %s\n", path_str);
@@ -175,23 +175,23 @@ GnomeCmdSmbPath::GnomeCmdSmbPath(const gchar *path_str): workgroup(0), resource(
gchar **v = g_strsplit (s, G_DIR_SEPARATOR_S, 0);
g_free (t);
- if (v[0] != NULL)
+ if (v[0] != nullptr)
{
- gchar *a = NULL;
- gchar *b = NULL;
+ gchar *a = nullptr;
+ gchar *b = nullptr;
a = g_strdup (v[0]);
- if (v[1] != NULL)
+ if (v[1] != nullptr)
{
b = g_strdup (v[1]);
- if (v[2] != NULL)
+ if (v[2] != nullptr)
{
- c = g_strconcat (G_DIR_SEPARATOR_S, v[2], NULL);
- if (v[3] != NULL)
+ c = g_strconcat (G_DIR_SEPARATOR_S, v[2], nullptr);
+ if (v[3] != nullptr)
{
gchar *t1 = c;
gchar *t2 = g_strjoinv (G_DIR_SEPARATOR_S, &v[3]);
- c = g_strjoin (G_DIR_SEPARATOR_S, t1, t2, NULL);
+ c = g_strjoin (G_DIR_SEPARATOR_S, t1, t2, nullptr);
g_free (t1);
g_free (t2);
}
@@ -208,7 +208,7 @@ GnomeCmdSmbPath::GnomeCmdSmbPath(const gchar *path_str): workgroup(0), resource(
{
if (!b)
b = (char*) "/";
- b = c ? g_strconcat (G_DIR_SEPARATOR_S, b, c, NULL) : g_strdup (b);
+ b = c ? g_strconcat (G_DIR_SEPARATOR_S, b, c, nullptr) : g_strdup (b);
g_free (c);
set_resources(ent->workgroup_name, a, b);
}
@@ -217,5 +217,5 @@ GnomeCmdSmbPath::GnomeCmdSmbPath(const gchar *path_str): workgroup(0), resource(
g_warning ("Can't find a host or workgroup named %s", a);
}
else
- set_resources(NULL, NULL, NULL);
+ set_resources(nullptr, nullptr, nullptr);
}
diff --git a/src/gnome-cmd-user-actions.cc b/src/gnome-cmd-user-actions.cc
index 224ea5f9..f7d780b3 100644
--- a/src/gnome-cmd-user-actions.cc
+++ b/src/gnome-cmd-user-actions.cc
@@ -569,8 +569,8 @@ gboolean GnomeCmdUserActions::handle_key_event(GnomeCmdMainWin *mw, GnomeCmdFile
static int sort_by_description (const void *data1, const void *data2)
{
- const gchar *s1 = ((UserActionData *) data1)->description;
- const gchar *s2 = ((UserActionData *) data2)->description;
+ const gchar *s1 = (static_cast<const UserActionData*> (data1))->description;
+ const gchar *s2 = (static_cast<const UserActionData*> (data2))->description;
if (!s1 && !s2)
return 0;
@@ -596,7 +596,7 @@ static int sort_by_description (const void *data1, const void *data2)
GtkTreeModel *gnome_cmd_user_actions_create_model ()
{
- UserActionData *data = (UserActionData *) g_memdup (user_actions_data, sizeof(user_actions_data));
+ auto data = static_cast<UserActionData*> (g_memdup (user_actions_data, sizeof(user_actions_data)));
qsort (data, G_N_ELEMENTS(user_actions_data), sizeof(UserActionData), sort_by_description);
@@ -1359,7 +1359,7 @@ void mark_compare_directories (GtkMenuItem *menuitem, gpointer not_used)
for (GList *i2=fl2->get_visible_files(); i2; i2=i2->next)
{
- GnomeCmdFile *f2 = (GnomeCmdFile *) i2->data;
+ auto f2 = static_cast<GnomeCmdFile*> (i2->data);
if (!f2->is_dotdot && f2->info->type!=GNOME_VFS_FILE_TYPE_DIRECTORY)
files2[f2->get_name()] = f2;
@@ -1369,7 +1369,7 @@ void mark_compare_directories (GtkMenuItem *menuitem, gpointer not_used)
for (GList *i1=fl1->get_visible_files(); i1; i1=i1->next)
{
- GnomeCmdFile *f1 = (GnomeCmdFile *) i1->data;
+ auto f1 = static_cast<GnomeCmdFile*> (i1->data);
if (f1->is_dotdot || f1->info->type==GNOME_VFS_FILE_TYPE_DIRECTORY)
continue;
@@ -1796,7 +1796,7 @@ void connections_new (GtkMenuItem *menuitem, gpointer not_used)
void connections_change (GtkMenuItem *menuitem, gpointer con) // this function is NOT exposed to
user as UserAction
{
- get_fl (ACTIVE)->set_connection((GnomeCmdCon *) con);
+ get_fl (ACTIVE)->set_connection(static_cast<GnomeCmdCon*> (con));
}
@@ -1824,7 +1824,7 @@ void connections_close (GtkMenuItem *menuitem, gpointer con) // this
if (con == inactive->get_connection())
inactive->set_connection(home);
- gnome_cmd_con_close ((GnomeCmdCon *) con);
+ gnome_cmd_con_close (static_cast<GnomeCmdCon*> (con));
}
@@ -1867,7 +1867,7 @@ void bookmarks_goto (GtkMenuItem *menuitem, gpointer bookmark_name)
{
for (GList *bookmarks = gnome_cmd_con_get_bookmarks (get_home_con ())->bookmarks; bookmarks;
bookmarks = bookmarks->next)
{
- GnomeCmdBookmark *bookmark = (GnomeCmdBookmark *) bookmarks->data;
+ auto bookmark = static_cast<GnomeCmdBookmark*> (bookmarks->data);
if (name == bookmark->name)
{
@@ -1884,7 +1884,7 @@ void bookmarks_goto (GtkMenuItem *menuitem, gpointer bookmark_name)
{
for (GList *bookmarks = gnome_cmd_con_get_bookmarks (get_smb_con ())->bookmarks; bookmarks;
bookmarks = bookmarks->next)
{
- GnomeCmdBookmark *bookmark = (GnomeCmdBookmark *) bookmarks->data;
+ auto bookmark = static_cast<GnomeCmdBookmark*> (bookmarks->data);
if (name == bookmark->name)
{
diff --git a/src/gnome-cmd-xfer-progress-win.cc b/src/gnome-cmd-xfer-progress-win.cc
index 6f0b264b..fbefc39b 100644
--- a/src/gnome-cmd-xfer-progress-win.cc
+++ b/src/gnome-cmd-xfer-progress-win.cc
@@ -1,4 +1,4 @@
-/**
+/**
* @file gnome-cmd-xfer-progress-win.cc
* @copyright (C) 2001-2006 Marcus Bjurman\n
* @copyright (C) 2007-2012 Piotr Eljasiak\n
@@ -29,7 +29,7 @@
using namespace std;
-static GtkWindowClass *parent_class = NULL;
+static GtkWindowClass *parent_class = nullptr;
/******************************
@@ -57,7 +57,7 @@ static void destroy (GtkObject *object)
static void map (GtkWidget *widget)
{
- if (GTK_WIDGET_CLASS (parent_class)->map != NULL)
+ if (GTK_WIDGET_CLASS (parent_class)->map != nullptr)
GTK_WIDGET_CLASS (parent_class)->map (widget);
}
@@ -118,13 +118,13 @@ static void init (GnomeCmdXferProgressWin *win)
GtkWidget *gnome_cmd_xfer_progress_win_new (guint no_of_files)
{
- GnomeCmdXferProgressWin *win = (GnomeCmdXferProgressWin *) g_object_new
(GNOME_CMD_TYPE_XFER_PROGRESS_WIN, NULL);
+ auto win = static_cast<GnomeCmdXferProgressWin*> (g_object_new (GNOME_CMD_TYPE_XFER_PROGRESS_WIN,
nullptr));
- if (no_of_files<2)
+ if (no_of_files < 2)
{
GtkWidget *vbox = gtk_bin_get_child (GTK_BIN (win));
gtk_container_remove (GTK_CONTAINER (vbox), win->fileprog);
- win->fileprog = NULL;
+ win->fileprog = nullptr;
}
return GTK_WIDGET (win);
@@ -144,9 +144,9 @@ GtkType gnome_cmd_xfer_progress_win_get_type ()
sizeof (GnomeCmdXferProgressWinClass),
(GtkClassInitFunc) class_init,
(GtkObjectInitFunc) init,
- /* reserved_1 */ NULL,
- /* reserved_2 */ NULL,
- (GtkClassInitFunc) NULL
+ /* reserved_1 */ nullptr,
+ /* reserved_2 */ nullptr,
+ (GtkClassInitFunc) nullptr
};
dlg_type = gtk_type_unique (gtk_window_get_type (), &dlg_info);
diff --git a/src/gnome-cmd-xfer.cc b/src/gnome-cmd-xfer.cc
index dbfcdbef..761b782f 100644
--- a/src/gnome-cmd-xfer.cc
+++ b/src/gnome-cmd-xfer.cc
@@ -1,4 +1,4 @@
-/**
+/**
* @file gnome-cmd-xfer.cc
* @copyright (C) 2001-2006 Marcus Bjurman\n
* @copyright (C) 2007-2012 Piotr Eljasiak\n
@@ -80,7 +80,7 @@ struct XferData
inline void free_xfer_data (XferData *data)
{
if (data->on_completed_func)
- data->on_completed_func (data->on_completed_data, NULL);
+ data->on_completed_func (data->on_completed_data, nullptr);
g_list_free (data->src_uri_list);
@@ -109,8 +109,8 @@ create_xfer_data (GnomeVFSXferOptions xferOptions, GList *src_uri_list, GList *d
data->to_dir = to_dir;
data->src_fl = src_fl;
data->src_files = src_files;
- data->win = NULL;
- data->cur_file_name = NULL;
+ data->win = nullptr;
+ data->cur_file_name = nullptr;
data->prev_status = GNOME_VFS_XFER_PROGRESS_STATUS_OK;
data->cur_phase = (GnomeVFSXferPhase) -1;
data->prev_phase = (GnomeVFSXferPhase) -1;
@@ -130,7 +130,7 @@ create_xfer_data (GnomeVFSXferOptions xferOptions, GList *src_uri_list, GList *d
GList *uris;
data->bytes_total = 0;
data->files_total = 0;
- for (uris = data->src_uri_list; uris != NULL; uris = uris->next) {
+ for (uris = data->src_uri_list; uris != nullptr; uris = uris->next) {
GnomeVFSURI *uri;
uri = (GnomeVFSURI*)uris->data;
data->bytes_total += calc_tree_size(uri,&(data->files_total));
@@ -168,12 +168,12 @@ static gint async_xfer_callback (GnomeVFSAsyncHandle *handle, GnomeVFSXferProgre
if (data->aborted)
return 0;
- if (info->source_name != NULL)
+ if (info->source_name != nullptr)
{
if (data->cur_file_name && strcmp (data->cur_file_name, info->source_name) != 0)
{
g_free (data->cur_file_name);
- data->cur_file_name = NULL;
+ data->cur_file_name = nullptr;
}
if (!data->cur_file_name)
@@ -182,7 +182,7 @@ static gint async_xfer_callback (GnomeVFSAsyncHandle *handle, GnomeVFSXferProgre
if (info->status == GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE)
{
- gchar *s = NULL;
+ gchar *s = nullptr;
// Check if the src uri is from local ('file:///...'). If not, just use the base name.
if ( !(s = gnome_vfs_get_local_path_from_uri (info->source_name) )) s = str_uri_basename
(info->source_name);
gchar *t = gnome_cmd_dir_is_local (data->to_dir) ? gnome_vfs_get_local_path_from_uri
(info->target_name) : str_uri_basename (info->target_name);
@@ -206,7 +206,7 @@ static gint async_xfer_callback (GnomeVFSAsyncHandle *handle, GnomeVFSXferProgre
gdk_threads_enter ();
gint ret = run_simple_dialog (*main_win, FALSE, GTK_MESSAGE_QUESTION, text, " ",
- 1, _("Abort"), _("Replace"), _("Replace All"), _("Skip"), _("Skip All"), NULL);
+ 1, _("Abort"), _("Replace"), _("Replace All"), _("Skip"), _("Skip All"), nullptr);
g_free(text);
data->prev_status = GNOME_VFS_XFER_PROGRESS_STATUS_OVERWRITE;
@@ -225,7 +225,7 @@ static gint async_xfer_callback (GnomeVFSAsyncHandle *handle, GnomeVFSXferProgre
gdk_threads_enter ();
gint ret = run_simple_dialog (*main_win, FALSE, GTK_MESSAGE_ERROR, msg, _("Transfer problem"),
- -1, _("Abort"), _("Retry"), _("Skip"), NULL);
+ -1, _("Abort"), _("Retry"), _("Skip"), nullptr);
g_free (msg);
g_free (fn);
g_free (t);
@@ -253,7 +253,7 @@ static gboolean update_xfer_gui_func (XferData *data)
data->aborted = TRUE;
if (data->on_completed_func)
- data->on_completed_func (data->on_completed_data, NULL);
+ data->on_completed_func (data->on_completed_data, nullptr);
gtk_widget_destroy (GTK_WIDGET (data->win));
return FALSE;
@@ -317,7 +317,7 @@ static gboolean update_xfer_gui_func (XferData *data)
for (; data->src_files; data->src_files = data->src_files->next)
{
- GnomeCmdFile *f = (GnomeCmdFile *) data->src_files->data;
+ auto f = static_cast<GnomeCmdFile*> (data->src_files->data);
GnomeVFSURI *src_uri = f->get_uri();
if (!gnome_vfs_uri_exists (src_uri))
data->src_fl->remove_file(f);
@@ -331,13 +331,13 @@ static gboolean update_xfer_gui_func (XferData *data)
gnome_cmd_dir_relist_files (data->to_dir, FALSE);
main_win->focus_file_lists();
gnome_cmd_dir_unref (data->to_dir);
- data->to_dir = NULL;
+ data->to_dir = nullptr;
}
if (data->win)
{
gtk_widget_destroy (GTK_WIDGET (data->win));
- data->win = NULL;
+ data->win = nullptr;
}
free_xfer_data (data);
@@ -380,7 +380,7 @@ inline gchar *remove_basename (gchar *in)
return out;
}
- return NULL;
+ return nullptr;
}
@@ -411,7 +411,7 @@ gnome_cmd_xfer_uris_start (GList *src_uri_list,
GtkSignalFunc on_completed_func,
gpointer on_completed_data)
{
- g_return_if_fail (src_uri_list != NULL);
+ g_return_if_fail (src_uri_list != nullptr);
g_return_if_fail (GNOME_CMD_IS_DIR (to_dir));
GnomeVFSURI *src_uri, *dest_uri;
@@ -433,13 +433,13 @@ gnome_cmd_xfer_uris_start (GList *src_uri_list,
}
}
- XferData *data = create_xfer_data (xferOptions, src_uri_list, NULL,
+ XferData *data = create_xfer_data (xferOptions, src_uri_list, nullptr,
to_dir, src_fl, src_files,
(GFunc) on_completed_func, on_completed_data);
gint num_files = g_list_length (src_uri_list);
- if (num_files == 1 && dest_fn != NULL)
+ if (num_files == 1 && dest_fn != nullptr)
{
dest_uri = gnome_cmd_dir_get_child_uri (to_dir, dest_fn);
@@ -471,7 +471,7 @@ gnome_cmd_xfer_uris_start (GList *src_uri_list,
xferOptions, GNOME_VFS_XFER_ERROR_MODE_QUERY, xferOverwriteMode,
XFER_PRIORITY,
(GnomeVFSAsyncXferProgressCallback) async_xfer_callback, data,
- NULL, NULL);
+ nullptr, nullptr);
g_timeout_add (gnome_cmd_data.gui_update_rate, (GSourceFunc) update_xfer_gui_func, data);
}
@@ -487,7 +487,7 @@ gnome_cmd_xfer_start (GList *src_files,
GtkSignalFunc on_completed_func,
gpointer on_completed_data)
{
- g_return_if_fail (src_files != NULL);
+ g_return_if_fail (src_files != nullptr);
g_return_if_fail (GNOME_CMD_IS_DIR (to_dir));
GList *src_uri_list = file_list_to_uri_list (src_files);
@@ -512,11 +512,11 @@ gnome_cmd_xfer_tmp_download (GnomeVFSURI *src_uri,
GtkSignalFunc on_completed_func,
gpointer on_completed_data)
{
- g_return_if_fail (src_uri != NULL);
- g_return_if_fail (dest_uri != NULL);
+ g_return_if_fail (src_uri != nullptr);
+ g_return_if_fail (dest_uri != nullptr);
- gnome_cmd_xfer_tmp_download_multiple (g_list_append (NULL, src_uri),
- g_list_append (NULL, dest_uri),
+ gnome_cmd_xfer_tmp_download_multiple (g_list_append (nullptr, src_uri),
+ g_list_append (nullptr, dest_uri),
xferOptions,
xferOverwriteMode,
on_completed_func,
@@ -532,13 +532,13 @@ gnome_cmd_xfer_tmp_download_multiple (GList *src_uri_list,
GtkSignalFunc on_completed_func,
gpointer on_completed_data)
{
- g_return_if_fail (src_uri_list != NULL);
- g_return_if_fail (dest_uri_list != NULL);
+ g_return_if_fail (src_uri_list != nullptr);
+ g_return_if_fail (dest_uri_list != nullptr);
XferData *data;
data = create_xfer_data (xferOptions, src_uri_list, dest_uri_list,
- NULL, NULL, NULL,
+ nullptr, nullptr, nullptr,
(GFunc) on_completed_func, on_completed_data);
data->win = GNOME_CMD_XFER_PROGRESS_WIN (gnome_cmd_xfer_progress_win_new (g_list_length (src_uri_list)));
@@ -551,7 +551,7 @@ gnome_cmd_xfer_tmp_download_multiple (GList *src_uri_list,
xferOptions, GNOME_VFS_XFER_ERROR_MODE_ABORT, xferOverwriteMode,
XFER_PRIORITY,
(GnomeVFSAsyncXferProgressCallback) async_xfer_callback, data,
- NULL, NULL);
+ nullptr, nullptr);
if (result != GNOME_VFS_OK)
{
DEBUG ('x', "Downloading could not be started properly as of wrong arguments in
gnome_vfs_async_xfer()\n");
diff --git a/src/imageloader.cc b/src/imageloader.cc
index 046ea9d4..29dd1866 100644
--- a/src/imageloader.cc
+++ b/src/imageloader.cc
@@ -1,4 +1,4 @@
-/**
+/**
* @file imageloader.cc
* @copyright (C) 2001-2006 Marcus Bjurman\n
* @copyright (C) 2007-2012 Piotr Eljasiak\n
@@ -79,8 +79,8 @@ static const gchar *categories[][2] = {{"text", "gnome-text-plain.png"},
static GnomeCmdPixmap *pixmaps[NUM_PIXMAPS];
static CacheEntry file_type_pixmaps[NUM_FILE_TYPE_PIXMAPS];
-static GHashTable *mime_cache = NULL;
-static GdkPixbuf *symlink_pixbuf = NULL;
+static GHashTable *mime_cache = nullptr;
+static GdkPixbuf *symlink_pixbuf = nullptr;
static gboolean load_icon (const gchar *icon_path, GdkPixmap **pm, GdkBitmap **bm, GdkPixmap **lpm,
GdkBitmap **lbm);
@@ -97,14 +97,14 @@ void IMAGE_init ()
for (gint i=1; i<NUM_PIXMAPS; i++)
{
- gchar *path = g_build_filename (PIXMAPS_DIR, pixmap_files[i], NULL);
+ gchar *path = g_build_filename (PIXMAPS_DIR, pixmap_files[i], nullptr);
DEBUG ('i', "imageloader: loading pixmap: %s\n", path);
pixmaps[i] = gnome_cmd_pixmap_new_from_file (path);
if (!pixmaps[i])
{
- gchar *path2 = g_build_filename ("../pixmaps", pixmap_files[i], NULL);
+ gchar *path2 = g_build_filename ("../pixmaps", pixmap_files[i], nullptr);
g_warning (_("Couldn’t load installed file type pixmap, trying to load %s instead"), path2);
@@ -123,13 +123,13 @@ void IMAGE_init ()
for (size_t i=0; i<NUM_FILE_TYPE_PIXMAPS; i++)
{
CacheEntry *e = &file_type_pixmaps[i];
- gchar *path = g_build_filename (PIXMAPS_DIR, file_type_pixmap_files[i], NULL);
+ gchar *path = g_build_filename (PIXMAPS_DIR, file_type_pixmap_files[i], nullptr);
DEBUG ('i', "imageloader: loading pixmap: %s\n", path);
if (!load_icon (path, &e->pixmap, &e->mask, &e->lnk_pixmap, &e->lnk_mask))
{
- gchar *path2 = g_build_filename ("../pixmaps", pixmap_files[i], NULL);
+ gchar *path2 = g_build_filename ("../pixmaps", pixmap_files[i], nullptr);
g_warning (_("Couldn’t load installed pixmap, trying to load %s instead"), path2);
@@ -145,7 +145,7 @@ void IMAGE_init ()
GnomeCmdPixmap *IMAGE_get_gnome_cmd_pixmap (Pixmap pixmap_id)
{
- return pixmap_id > 0 && pixmap_id < NUM_PIXMAPS ? pixmaps[pixmap_id] : NULL;
+ return pixmap_id > 0 && pixmap_id < NUM_PIXMAPS ? pixmaps[pixmap_id] : nullptr;
}
@@ -217,7 +217,7 @@ static const gchar *get_type_icon_name (GnomeVFSFileType type)
#pragma GCC diagnostic pop
#endif
- return NULL;
+ return nullptr;
}
@@ -227,7 +227,7 @@ static const gchar *get_type_icon_name (GnomeVFSFileType type)
*/
inline gchar *get_mime_file_type_icon_path (GnomeVFSFileType type, const gchar *icon_dir)
{
- return g_build_filename (icon_dir, get_type_icon_name (type), NULL);
+ return g_build_filename (icon_dir, get_type_icon_name (type), nullptr);
}
@@ -239,7 +239,7 @@ inline gchar *get_mime_file_type_icon_path (GnomeVFSFileType type, const gchar *
inline gchar *get_mime_document_type_icon_path (const gchar *mime_type, const gchar *icon_dir)
{
gchar *icon_name = get_mime_icon_name (mime_type);
- gchar *icon_path = g_build_filename (icon_dir, icon_name, NULL);
+ gchar *icon_path = g_build_filename (icon_dir, icon_name, nullptr);
g_free (icon_name);
return icon_path;
@@ -255,9 +255,9 @@ inline gchar *get_category_icon_path (const gchar *mime_type, const gchar *icon_
{
for (size_t i=0; i<G_N_ELEMENTS(categories); i++)
if (g_str_has_prefix (mime_type, categories[i][0]))
- return g_build_filename (icon_dir, categories[i][1], NULL);
+ return g_build_filename (icon_dir, categories[i][1], nullptr);
- return NULL;
+ return nullptr;
}
@@ -273,7 +273,7 @@ static gboolean load_icon (const gchar *icon_path, GdkPixmap **pm, GdkBitmap **b
DEBUG ('i', "Trying to load \"%s\"\n\n", icon_path);
- pixbuf = gdk_pixbuf_new_from_file (icon_path, NULL);
+ pixbuf = gdk_pixbuf_new_from_file (icon_path, nullptr);
if (!pixbuf) return FALSE;
@@ -337,18 +337,18 @@ static gboolean get_mime_icon_in_dir (const gchar *icon_dir,
if (type == GNOME_VFS_FILE_TYPE_SYMBOLIC_LINK)
return FALSE;
- CacheEntry *entry = (CacheEntry *) g_hash_table_lookup (mime_cache, mime_type);
+ auto entry = static_cast<CacheEntry*> (g_hash_table_lookup (mime_cache, mime_type));
if (!entry)
{
// We're looking up this mime-type for the first time
- gchar *icon_path = NULL;
- gchar *icon_path2 = NULL;
- gchar *icon_path3 = NULL;
- GdkPixmap *pm = NULL;
- GdkBitmap *bm = NULL;
- GdkPixmap *lpm = NULL;
- GdkBitmap *lbm = NULL;
+ gchar *icon_path = nullptr;
+ gchar *icon_path2 = nullptr;
+ gchar *icon_path3 = nullptr;
+ GdkPixmap *pm = nullptr;
+ GdkBitmap *bm = nullptr;
+ GdkPixmap *lpm = nullptr;
+ GdkBitmap *lbm = nullptr;
DEBUG ('y', "Looking up pixmap for: %s\n", mime_type);
@@ -379,7 +379,7 @@ static gboolean get_mime_icon_in_dir (const gchar *icon_dir,
g_free (icon_path3);
entry = g_new0 (CacheEntry, 1);
- entry->dead_end = (pm == NULL || bm == NULL);
+ entry->dead_end = (pm == nullptr || bm == nullptr);
entry->pixmap = pm;
entry->mask = bm;
entry->lnk_pixmap = lpm;
@@ -473,9 +473,9 @@ static gboolean remove_entry (const gchar *key, CacheEntry *entry, gpointer user
void IMAGE_clear_mime_cache ()
{
- g_return_if_fail (mime_cache != NULL);
+ g_return_if_fail (mime_cache != nullptr);
- g_hash_table_foreach_remove (mime_cache, (GHRFunc) remove_entry, NULL);
+ g_hash_table_foreach_remove (mime_cache, (GHRFunc) remove_entry, nullptr);
}
@@ -484,6 +484,6 @@ void IMAGE_free ()
for (int i=0; i<NUM_PIXMAPS; i++)
{
gnome_cmd_pixmap_free (pixmaps[i]);
- pixmaps[i] = NULL;
+ pixmaps[i] = nullptr;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]