summaryrefslogtreecommitdiff
path: root/vcl/unx/gtk
diff options
context:
space:
mode:
authorAntonio Fernandez <antonio.fernandez@aentos.es>2012-08-29 14:41:01 +0100
committerBjoern Michaelsen <bjoern.michaelsen@canonical.com>2012-11-14 13:52:45 +0100
commite200325abbfe20b0d14fb302faf50e67a9cb4d60 (patch)
treec958397a835d09230dbcdd6baa73061223be9f4f /vcl/unx/gtk
parent8bf38ff19f7e2c1b58adf8be871a2f5a076d68d1 (diff)
New menu is now correctly displayed, but still have some problems.
Change-Id: Ic69451bf9a4e5f63c4f0050b5967b8f2fc28d7cb
Diffstat (limited to 'vcl/unx/gtk')
-rw-r--r--vcl/unx/gtk/window/glomenu.cxx3
-rw-r--r--vcl/unx/gtk/window/gtksalmenu.cxx326
2 files changed, 114 insertions, 215 deletions
diff --git a/vcl/unx/gtk/window/glomenu.cxx b/vcl/unx/gtk/window/glomenu.cxx
index 962e84faaf77..657d0c2aa929 100644
--- a/vcl/unx/gtk/window/glomenu.cxx
+++ b/vcl/unx/gtk/window/glomenu.cxx
@@ -488,6 +488,9 @@ g_lo_menu_set_submenu_to_item_in_section (GLOMenu *menu,
g_return_if_fail (model != NULL);
g_lo_menu_set_link (model, position, G_MENU_LINK_SUBMENU, submenu);
+
+ // Notify the update.
+ g_menu_model_items_changed (G_MENU_MODEL (model), position, 1, 1);
}
GLOMenu *
diff --git a/vcl/unx/gtk/window/gtksalmenu.cxx b/vcl/unx/gtk/window/gtksalmenu.cxx
index 789547a3893e..4f6dda280f95 100644
--- a/vcl/unx/gtk/window/gtksalmenu.cxx
+++ b/vcl/unx/gtk/window/gtksalmenu.cxx
@@ -92,7 +92,8 @@ using namespace std;
// }
//}
-static void UpdateNativeMenu( GtkSalMenu* pMenu ) {
+static void UpdateNativeMenu( GtkSalMenu* pMenu )
+{
if ( pMenu == NULL )
return;
@@ -119,7 +120,8 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu ) {
nSection++;
nItemPos = 0;
- if ( nLOMenuSize <= nSection ) {
+ if ( nLOMenuSize <= nSection )
+ {
g_lo_menu_new_section( pLOMenu, nSection, NULL );
nLOMenuSize++;
}
@@ -130,34 +132,49 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu ) {
if ( nItemPos >= g_lo_menu_get_n_items_from_section( pLOMenu, nSection ) )
g_lo_menu_insert_in_section( pLOMenu, nSection, nItemPos, "EMPTY STRING" );
+ // Get internal menu item values.
String aText = pVCLMenu->GetItemText( nId );
- String aCommand = pVCLMenu->GetItemCommand( nId );
+ rtl::OUString aCommand( pVCLMenu->GetItemCommand( nId ) );
sal_Bool itemEnabled = pVCLMenu->IsItemEnabled( nId );
KeyCode nAccelKey = pVCLMenu->GetAccelKey( nId );
sal_Bool itemChecked = pVCLMenu->IsItemChecked( nId );
+ // Convert internal values to native values.
+ gboolean bChecked = ( itemChecked == sal_True ) ? TRUE : FALSE;
+ gboolean bEnabled = ( itemEnabled == sal_True ) ? TRUE : FALSE;
+ gchar* aNativeCommand = g_strdup( rtl::OUStringToOString( aCommand, RTL_TEXTENCODING_UTF8 ).getStr() );
+
// Force updating of native menu labels.
- pMenu->SetItemCommand( nItem, pSalMenuItem, aCommand );
- pMenu->SetItemText( nItem, pSalMenuItem, aText );
- pMenu->EnableItem( nItem, itemEnabled );
+ pMenu->SetNativeItemText( nSection, nItemPos, aText );
pMenu->SetAccelerator( nItem, pSalMenuItem, nAccelKey, nAccelKey.GetName( pMenu->GetFrame()->GetWindow() ) );
- pMenu->CheckItem( nItem, itemChecked );
+
+ if ( g_strcmp0( aNativeCommand, "" ) != 0 && pSalMenuItem->mpVCLMenu->GetPopupMenu( nId ) == NULL )
+ {
+ pMenu->SetNativeItemCommand( nSection, nItemPos, pSalMenuItem, aNativeCommand );
+ pMenu->SetNativeEnableItem( aNativeCommand, bEnabled );
+// pMenu->CheckItem( nItem, itemChecked );
+ }
+
+ g_free( aNativeCommand );
GtkSalMenu* pSubmenu = pSalMenuItem->mpSubMenu;
- if ( pSubmenu && pSubmenu->GetMenu() ) {
+ if ( pSubmenu && pSubmenu->GetMenu() )
+ {
GLOMenu* pSubMenuModel = g_lo_menu_get_submenu_from_item_in_section( pLOMenu, nSection, nItemPos );
- if ( pSubMenuModel == NULL ) {
+ if ( pSubMenuModel == NULL )
+ {
pSubMenuModel = g_lo_menu_new();
g_lo_menu_set_submenu_to_item_in_section( pLOMenu, nSection, nItemPos, G_MENU_MODEL( pSubMenuModel ) );
}
+ pSubmenu->GetMenu()->Activate();
+
pSubmenu->SetMenuModel( G_MENU_MODEL( pSubMenuModel ) );
pSubmenu->SetActionGroup( pActionGroup );
-
- pSubmenu->GetMenu()->Activate();
UpdateNativeMenu( pSubmenu );
+
pSubmenu->GetMenu()->Deactivate();
}
@@ -166,7 +183,8 @@ static void UpdateNativeMenu( GtkSalMenu* pMenu ) {
}
}
-gboolean GenerateMenu(gpointer user_data) {
+gboolean GenerateMenu(gpointer user_data)
+{
GtkSalMenu* pSalMenu = static_cast< GtkSalMenu* >( user_data );
UpdateNativeMenu( pSalMenu );
@@ -174,7 +192,8 @@ gboolean GenerateMenu(gpointer user_data) {
return TRUE;
}
-void ObjectDestroyedNotify( gpointer data ) {
+void ObjectDestroyedNotify( gpointer data )
+{
if ( data ) {
g_object_unref( data );
}
@@ -208,16 +227,6 @@ gdk_x11_window_set_utf8_property (GdkWindow *window,
}
}
-GActionGroup* GetActionGroupFromMenubar( GtkSalMenu *pMenu )
-{
- GtkSalMenu *pSalMenu = pMenu;
-
- while ( pSalMenu && pSalMenu->GetParentSalMenu() )
- pSalMenu = pSalMenu->GetParentSalMenu();
-
- return ( pSalMenu ) ? pSalMenu->GetActionGroup() : NULL;
-}
-
// FIXME: Check for missing keys. Maybe translating keycodes would be safer...
rtl::OUString GetGtkKeyName( rtl::OUString keyName )
{
@@ -290,45 +299,6 @@ rtl::OUString GetGtkKeyName( rtl::OUString keyName )
* GtkSalMenu
*/
-sal_Int32 GtkSalMenu::GetPositionFromItem( GtkSalMenuItem* pSalMenuItem )
-{
- for ( sal_uInt16 i = 0; i < maItems.size(); i++ )
- {
- GtkSalMenuItem* pItem = maItems[ i ];
-
- if ( pSalMenuItem->mnId == pItem->mnId && pSalMenuItem->mnType == pItem->mnType )
- return i;
- }
-
- return -1;
-}
-
-// FIXME: Iterating through the whole list everytime is slow, but works. Some fine tuning would be required here...
-void GtkSalMenu::GetItemSectionAndPosition( unsigned nPos, unsigned *insertSection, unsigned *insertPos )
-{
- if ( mpVCLMenu == NULL || nPos >= mpVCLMenu->GetItemCount() )
- {
- *insertSection = g_menu_model_get_n_items( mpMenuModel ) - 1;
- *insertPos = MENU_APPEND;
- }
- else
- {
- unsigned nItem;
- gint nItemPos;
-
- for ( nItem = 0, *insertSection = 0, nItemPos = -1; nItem <= nPos; nItem++ )
- {
- if ( mpVCLMenu->GetItemType( nItem ) == MENUITEM_SEPARATOR ) {
- (*insertSection)++;
- nItemPos = -1;
- } else
- nItemPos++;
- }
-
- *insertPos = nItemPos;
- }
-}
-
GtkSalMenu::GtkSalMenu( sal_Bool bMenuBar ) :
mbMenuBar( bMenuBar ),
mpVCLMenu( NULL ),
@@ -337,25 +307,21 @@ GtkSalMenu::GtkSalMenu( sal_Bool bMenuBar ) :
mpMenuModel( NULL ),
mpActionGroup( NULL )
{
- cout << this << " - " << __FUNCTION__ << endl;
-// mpMenuModel = G_MENU_MODEL( g_lo_menu_new() );
-// g_lo_menu_new_section( G_LO_MENU( mpMenuModel ), 0, NULL);
}
GtkSalMenu::~GtkSalMenu()
{
- cout << this << " - " << __FUNCTION__ << endl;
+ if ( mbMenuBar == sal_True ) {
+ g_source_remove_by_user_data( this );
-// if ( mpActionGroup ) {
-// g_lo_action_group_clear( G_LO_ACTION_GROUP( mpActionGroup ) );
-// }
+ if ( mpActionGroup ) {
+ g_lo_action_group_clear( G_LO_ACTION_GROUP( mpActionGroup ) );
+ }
-// if ( mbMenuBar ) {
-// g_source_remove_by_user_data( this );
-// g_lo_menu_remove( G_LO_MENU( mpMenuModel ), 0 );
-// } else {
-// g_object_unref( mpMenuModel );
-// }
+ if ( mpMenuModel ) {
+ g_lo_menu_remove( G_LO_MENU( mpMenuModel ), 0 );
+ }
+ }
maItems.clear();
}
@@ -367,7 +333,6 @@ sal_Bool GtkSalMenu::VisibleMenuBar()
void GtkSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
{
- cout << this << " - " << __FUNCTION__ << endl;
GtkSalMenuItem *pItem = static_cast<GtkSalMenuItem*>( pSalMenuItem );
if ( nPos == MENU_APPEND )
@@ -376,53 +341,10 @@ void GtkSalMenu::InsertItem( SalMenuItem* pSalMenuItem, unsigned nPos )
maItems.insert( maItems.begin() + nPos, pItem );
pItem->mpParentMenu = this;
-
-// if ( pItem->mnType != MENUITEM_SEPARATOR )
-// {
-// unsigned nInsertSection, nInsertPos;
-// GetItemSectionAndPosition( nPos, &nInsertSection, &nInsertPos );
-
-// // g_lo_menu_insert_in_section( G_LO_MENU( mpMenuModel ), nInsertSection, nInsertPos, "EMPTY STRING" );
-// }
-// else
-// {
-// // g_lo_menu_new_section( G_LO_MENU( mpMenuModel ), MENU_APPEND, NULL );
-// }
}
void GtkSalMenu::RemoveItem( unsigned nPos )
{
- cout << this << " - " << __FUNCTION__ << endl;
-// GLOMenu* pMenu = G_LO_MENU( mpMenuModel );
-// GtkSalMenuItem *pItem = maItems[ nPos ];
-
- // If item is a separator, the last section of the menu is removed.
-// if ( pItem->mnType != MENUITEM_SEPARATOR )
-// {
-// unsigned nSection, nItemPos;
-// GetItemSectionAndPosition( nPos, &nSection, &nItemPos );
-
-// gchar* aCommand = g_lo_menu_get_command_from_item_in_section( pMenu, nSection, nItemPos );
-
-// if ( aCommand ) {
-// GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( GetActionGroupFromMenubar( this ) );
-
-// if ( pActionGroup != NULL )
-// g_lo_action_group_remove( pActionGroup, aCommand );
-
-// g_free( aCommand );
-// }
-
-// g_lo_menu_remove_from_section( pMenu, nSection, nItemPos );
-// }
-// else
-// {
-// gint nSection = g_menu_model_get_n_items( mpMenuModel ) - 1;
-
-// if ( nSection > 0 )
-// g_lo_menu_remove( pMenu, nSection );
-// }
-
maItems.erase( maItems.begin() + nPos );
}
@@ -434,16 +356,8 @@ void GtkSalMenu::SetSubMenu( SalMenuItem* pSalMenuItem, SalMenu* pSubMenu, unsig
if ( pGtkSubMenu == NULL )
return;
- cout << this << " - " << __FUNCTION__ << " - " << nPos << " - " << pSubMenu << endl;
-
pGtkSubMenu->mpParentSalMenu = this;
pItem->mpSubMenu = pGtkSubMenu;
-
- // Update item in GMenuModel.
- unsigned nSection, nItemPos;
- GetItemSectionAndPosition( nPos, &nSection, &nItemPos );
-
- g_lo_menu_set_submenu_to_item_in_section( G_LO_MENU( mpMenuModel ), nSection, nItemPos, pGtkSubMenu->mpMenuModel );
}
void GtkSalMenu::SetFrame( const SalFrame* pFrame )
@@ -500,12 +414,14 @@ void GtkSalMenu::SetFrame( const SalFrame* pFrame )
}
// Menubar has only one section, so we put it on the exported menu.
- // g_lo_menu_insert_section( pMainMenu, 0, NULL, mpMenuModel );
- mpMenuModel = G_MENU_MODEL( pMainMenu );
+// mpMenuModel = G_MENU_MODEL( pMainMenu );
+ mpMenuModel = G_MENU_MODEL( g_lo_menu_new() );
+ g_lo_menu_insert_section( pMainMenu, 0, NULL, mpMenuModel );
+// g_lo_menu_new_section( G_LO_MENU( mpMenuModel ), 0, NULL );
mpActionGroup = G_ACTION_GROUP( pActionGroup );
-// UpdateNativeMenu( this );
-// UpdateNativeMenu( this );
+// GenerateMenu( this );
+// GenerateMenu( this );
// Refresh the menu every second.
// This code is a workaround until required modifications in Gtk+ are available.
@@ -574,43 +490,34 @@ void GtkSalMenu::CheckItem( unsigned nPos, sal_Bool bCheck )
void GtkSalMenu::EnableItem( unsigned nPos, sal_Bool bEnable )
{
-// GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( GetActionGroupFromMenubar( this ) );
-
-// if ( pActionGroup == NULL )
-// return;
-
-// sal_uInt16 nId = mpVCLMenu->GetItemId( nPos );
-// rtl::OUString aOUCommand = mpVCLMenu->GetItemCommand( nId );
-
-// if ( aOUCommand == NULL || aOUCommand.isEmpty() )
-// return;
-
-// gchar* aCommand = (gchar*) rtl::OUStringToOString( aOUCommand, RTL_TEXTENCODING_UTF8 ).getStr();
+}
-// gboolean bItemEnabled = (bEnable == sal_True) ? TRUE : FALSE;
+void GtkSalMenu::SetNativeEnableItem( gchar* aCommand, gboolean bEnable )
+{
+ GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( mpActionGroup );
-// if ( g_action_group_get_action_enabled( G_ACTION_GROUP( pActionGroup ), aCommand ) != bItemEnabled )
-// g_lo_action_group_set_action_enabled( pActionGroup, aCommand, bItemEnabled );
+ if ( g_action_group_get_action_enabled( G_ACTION_GROUP( pActionGroup ), aCommand ) != bEnable )
+ g_lo_action_group_set_action_enabled( pActionGroup, aCommand, bEnable );
}
void GtkSalMenu::SetItemText( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& rText )
{
- cout << this << " - " << __FUNCTION__ << endl;
-// // Replace the "~" character with "_".
-// rtl::OUString aText = rText.replace( '~', '_' );
-// rtl::OString aConvertedText = OUStringToOString( aText, RTL_TEXTENCODING_UTF8 );
+}
-// unsigned nSection, nItemPos;
-// GetItemSectionAndPosition( nPos, &nSection, &nItemPos );
+void GtkSalMenu::SetNativeItemText( unsigned nSection, unsigned nItemPos, const rtl::OUString& rText )
+{
+ // Replace the "~" character with "_".
+ rtl::OUString aText = rText.replace( '~', '_' );
+ rtl::OString aConvertedText = OUStringToOString( aText, RTL_TEXTENCODING_UTF8 );
-// // Update item text only when necessary.
-// gchar* aLabel = g_lo_menu_get_label_from_item_in_section( G_LO_MENU( mpMenuModel ), nSection, nItemPos );
+ // Update item text only when necessary.
+ gchar* aLabel = g_lo_menu_get_label_from_item_in_section( G_LO_MENU( mpMenuModel ), nSection, nItemPos );
-// if ( aLabel == NULL || g_strcmp0( aLabel, aConvertedText.getStr() ) != 0 )
-// g_lo_menu_set_label_to_item_in_section( G_LO_MENU( mpMenuModel ), nSection, nItemPos, aConvertedText.getStr() );
+ if ( aLabel == NULL || g_strcmp0( aLabel, aConvertedText.getStr() ) != 0 )
+ g_lo_menu_set_label_to_item_in_section( G_LO_MENU( mpMenuModel ), nSection, nItemPos, aConvertedText.getStr() );
-// if ( aLabel )
-// g_free( aLabel );
+ if ( aLabel )
+ g_free( aLabel );
}
void GtkSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const Image& rImage)
@@ -619,7 +526,6 @@ void GtkSalMenu::SetItemImage( unsigned nPos, SalMenuItem* pSalMenuItem, const I
void GtkSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const KeyCode& rKeyCode, const rtl::OUString& rKeyName )
{
- cout << this << " - " << __FUNCTION__ << endl;
// if ( rKeyName.isEmpty() )
// return;
@@ -639,75 +545,65 @@ void GtkSalMenu::SetAccelerator( unsigned nPos, SalMenuItem* pSalMenuItem, const
void GtkSalMenu::SetItemCommand( unsigned nPos, SalMenuItem* pSalMenuItem, const rtl::OUString& aCommandStr )
{
- cout << this << " - " << __FUNCTION__ << endl;
-// GtkSalMenuItem* pItem = static_cast< GtkSalMenuItem* >( pSalMenuItem );
-
-// if ( pItem->mnType == MENUITEM_SEPARATOR ||
-// pItem->mpVCLMenu->GetPopupMenu( pItem->mnId ) != NULL ||
-// aCommandStr.isEmpty() )
-// return;
-
-// gchar* aCommand = (gchar*) rtl::OUStringToOString( aCommandStr, RTL_TEXTENCODING_UTF8 ).getStr();
-
-// GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( GetActionGroupFromMenubar( this ) );
-// if ( pActionGroup == NULL )
-// return;
+}
-// GVariant *pTarget = NULL;
+void GtkSalMenu::SetNativeItemCommand( unsigned nSection, unsigned nItemPos, GtkSalMenuItem* pItem, const gchar* aCommand )
+{
+ GLOActionGroup* pActionGroup = G_LO_ACTION_GROUP( mpActionGroup );
-// if ( g_action_group_has_action( G_ACTION_GROUP( pActionGroup ), aCommand ) == FALSE ) {
-// gboolean bChecked = ( pItem->mpVCLMenu->IsItemChecked( pItem->mnId ) ) ? TRUE : FALSE;
+ GVariant *pTarget = NULL;
-// // FIXME: Why pItem->mnBits differs from GetItemBits value?
-// MenuItemBits bits = pItem->mpVCLMenu->GetItemBits( pItem->mnId );
+ if ( g_action_group_has_action( mpActionGroup, aCommand ) == FALSE ) {
+ gboolean bChecked = ( pItem->mpVCLMenu->IsItemChecked( pItem->mnId ) ) ? TRUE : FALSE;
-// if ( bits & MIB_CHECKABLE )
-// {
-// // Item is a checkmark button.
-// GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_BOOLEAN );
-// GVariant* pState = g_variant_new_boolean( bChecked );
+ // FIXME: Why pItem->mnBits differs from GetItemBits value?
+ MenuItemBits bits = pItem->mpVCLMenu->GetItemBits( pItem->mnId );
-// g_lo_action_group_insert_stateful( pActionGroup, aCommand, pItem, NULL, pStateType, NULL, pState );
-// }
-// else if ( bits & MIB_RADIOCHECK )
-// {
-// // Item is a radio button.
-// GVariantType* pParameterType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );
-// GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );
-// // GVariant* pStateHint = GetRadioButtonHints( pItem );
-// GVariant* pState = g_variant_new_string( "" );
-// pTarget = g_variant_new_string( aCommand );
-
-// g_lo_action_group_insert_stateful( pActionGroup, aCommand, pItem, pParameterType, pStateType, NULL, pState );
-// }
-// else
-// {
-// // Item is not special, so insert a stateless action.
-// g_lo_action_group_insert( pActionGroup, aCommand, pItem );
-// }
-// }
+ if ( bits & MIB_CHECKABLE )
+ {
+ // Item is a checkmark button.
+ GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_BOOLEAN );
+ GVariant* pState = g_variant_new_boolean( bChecked );
-// GLOMenu* pMenu = G_LO_MENU( mpMenuModel );
+ g_lo_action_group_insert_stateful( pActionGroup, aCommand, pItem, NULL, pStateType, NULL, pState );
+ }
+ else if ( bits & MIB_RADIOCHECK )
+ {
+ // Item is a radio button.
+ GVariantType* pParameterType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );
+ GVariantType* pStateType = g_variant_type_new( (gchar*) G_VARIANT_TYPE_STRING );
+ // GVariant* pStateHint = GetRadioButtonHints( pItem );
+ GVariant* pState = g_variant_new_string( "" );
+ pTarget = g_variant_new_string( aCommand );
+
+ g_lo_action_group_insert_stateful( pActionGroup, aCommand, pItem, pParameterType, pStateType, NULL, pState );
+ }
+ else
+ {
+ // Item is not special, so insert a stateless action.
+ g_lo_action_group_insert( pActionGroup, aCommand, pItem );
+ }
+ }
-// // Menu item is not updated unless it's necessary.
-// unsigned nSection, nItemPos;
-// GetItemSectionAndPosition( nPos, &nSection, &nItemPos );
+ GLOMenu* pMenu = G_LO_MENU( mpMenuModel );
-// gchar* aCurrentCommand = g_lo_menu_get_command_from_item_in_section( pMenu, nSection, nItemPos );
+ // Menu item is not updated unless it's necessary.
+ gchar* aCurrentCommand = g_lo_menu_get_command_from_item_in_section( pMenu, nSection, nItemPos );
-// if ( aCurrentCommand == NULL || g_strcmp0( aCurrentCommand, aCommand ) != 0 )
-// {
-// g_lo_menu_set_accelerator_to_item_in_section( pMenu, nSection, nItemPos, aCommand );
+ if ( aCurrentCommand == NULL || g_strcmp0( aCurrentCommand, aCommand ) != 0 )
+ {
+ cout << __FUNCTION__ << endl;
+ g_lo_menu_set_command_to_item_in_section( pMenu, nSection, nItemPos, aCommand );
-// gchar* aItemCommand = g_strconcat("win.", aCommand, NULL );
+ gchar* aItemCommand = g_strconcat("win.", aCommand, NULL );
-// g_lo_menu_set_action_and_target_value_to_item_in_section( pMenu, nSection, nItemPos, aItemCommand, pTarget );
+ g_lo_menu_set_action_and_target_value_to_item_in_section( pMenu, nSection, nItemPos, aItemCommand, pTarget );
-// g_free( aItemCommand );
-// }
+ g_free( aItemCommand );
+ }
-// if ( aCurrentCommand )
-// g_free( aCurrentCommand );
+ if ( aCurrentCommand )
+ g_free( aCurrentCommand );
}
void GtkSalMenu::GetSystemMenuData( SystemMenuData* pData )