@@ -47,20 +47,6 @@ static void nemo_action_set_property (GObject *object,
47
47
static void nemo_action_constructed (GObject * object );
48
48
static void nemo_action_finalize (GObject * gobject );
49
49
50
- static SelectionType nemo_action_get_selection_type (NemoAction * action );
51
- static void nemo_action_set_extensions (NemoAction * action , gchar * * extensions );
52
- static gchar * * nemo_action_get_extension_list (NemoAction * action );
53
- static void nemo_action_set_mimetypes (NemoAction * action , gchar * * mimetypes );
54
- static gchar * * nemo_action_get_mimetypes_list (NemoAction * action );
55
- static void nemo_action_set_key_file_path (NemoAction * action , const gchar * path );
56
- static void nemo_action_set_exec (NemoAction * action , const gchar * exec );
57
- static void nemo_action_set_parent_dir (NemoAction * action , const gchar * parent_dir );
58
- static void nemo_action_set_separator (NemoAction * action , const gchar * separator );
59
- static void nemo_action_set_conditions (NemoAction * action , gchar * * conditions );
60
- static gchar * * nemo_action_get_conditions (NemoAction * action );
61
- static void nemo_action_set_orig_label (NemoAction * action , const gchar * orig_label );
62
- static void nemo_action_set_orig_tt (NemoAction * action , const gchar * orig_tt );
63
-
64
50
static gchar * find_token_type (const gchar * str , TokenType * token_type );
65
51
66
52
static gpointer parent_class ;
@@ -1033,40 +1019,40 @@ nemo_action_set_property (GObject *object,
1033
1019
switch (prop_id )
1034
1020
{
1035
1021
case PROP_KEY_FILE_PATH :
1036
- nemo_action_set_key_file_path ( action , g_value_get_string (value ));
1022
+ action -> key_file_path = g_strdup ( g_value_get_string (value ));
1037
1023
break ;
1038
1024
case PROP_SELECTION_TYPE :
1039
1025
action -> selection_type = g_value_get_int (value );
1040
1026
break ;
1041
1027
case PROP_EXTENSIONS :
1042
- nemo_action_set_extensions ( action , g_value_get_pointer (value ));
1028
+ action -> extensions = g_strdupv ( g_value_get_pointer (value ));
1043
1029
break ;
1044
1030
case PROP_MIMES :
1045
- nemo_action_set_mimetypes ( action , g_value_get_pointer (value ));
1031
+ action -> mimetypes = g_strdupv ( g_value_get_pointer (value ));
1046
1032
break ;
1047
1033
case PROP_EXEC :
1048
- nemo_action_set_exec ( action , g_value_get_string (value ));
1034
+ action -> exec = g_strdup ( g_value_get_string (value ));
1049
1035
break ;
1050
1036
case PROP_PARENT_DIR :
1051
- nemo_action_set_parent_dir ( action , g_value_get_string (value ));
1037
+ action -> parent_dir = g_strdup ( g_value_get_string (value ));
1052
1038
break ;
1053
1039
case PROP_USE_PARENT_DIR :
1054
1040
action -> use_parent_dir = g_value_get_boolean (value );
1055
1041
break ;
1056
1042
case PROP_ORIG_LABEL :
1057
- nemo_action_set_orig_label ( action , g_value_get_string (value ));
1043
+ action -> orig_label = g_strdup ( g_value_get_string (value ));
1058
1044
break ;
1059
1045
case PROP_ORIG_TT :
1060
- nemo_action_set_orig_tt ( action , g_value_get_string (value ));
1046
+ action -> orig_tt = g_strdup ( g_value_get_string (value ));
1061
1047
break ;
1062
1048
case PROP_QUOTE_TYPE :
1063
1049
action -> quote_type = g_value_get_int (value );
1064
1050
break ;
1065
1051
case PROP_SEPARATOR :
1066
- nemo_action_set_separator ( action , g_value_get_string (value ));
1052
+ action -> separator = g_strdup ( g_value_get_string (value ));
1067
1053
break ;
1068
1054
case PROP_CONDITIONS :
1069
- nemo_action_set_conditions ( action , g_value_get_pointer (value ));
1055
+ action -> conditions = g_strdupv ( g_value_get_pointer (value ));
1070
1056
break ;
1071
1057
case PROP_ESCAPE_SPACE :
1072
1058
action -> escape_space = g_value_get_boolean (value );
@@ -1503,119 +1489,6 @@ nemo_action_activate (NemoAction *action,
1503
1489
g_string_free (exec , TRUE);
1504
1490
}
1505
1491
1506
- static SelectionType
1507
- nemo_action_get_selection_type (NemoAction * action )
1508
- {
1509
- return action -> selection_type ;
1510
- }
1511
-
1512
- static void
1513
- nemo_action_set_extensions (NemoAction * action , gchar * * extensions )
1514
- {
1515
- gchar * * tmp ;
1516
-
1517
- tmp = action -> extensions ;
1518
- action -> extensions = g_strdupv (extensions );
1519
- g_strfreev (tmp );
1520
- }
1521
-
1522
- static gchar * *
1523
- nemo_action_get_extension_list (NemoAction * action )
1524
- {
1525
- return action -> extensions ;
1526
- }
1527
-
1528
- static void
1529
- nemo_action_set_mimetypes (NemoAction * action , gchar * * mimetypes )
1530
- {
1531
- gchar * * tmp ;
1532
-
1533
- tmp = action -> mimetypes ;
1534
- action -> mimetypes = g_strdupv (mimetypes );
1535
- g_strfreev (tmp );
1536
- }
1537
-
1538
- static gchar * *
1539
- nemo_action_get_mimetypes_list (NemoAction * action )
1540
- {
1541
- return action -> mimetypes ;
1542
- }
1543
-
1544
- static void
1545
- nemo_action_set_key_file_path (NemoAction * action , const gchar * path )
1546
- {
1547
- gchar * tmp ;
1548
- tmp = action -> key_file_path ;
1549
- action -> key_file_path = g_strdup (path );
1550
- g_free (tmp );
1551
- }
1552
-
1553
- static void
1554
- nemo_action_set_exec (NemoAction * action , const gchar * exec )
1555
- {
1556
- gchar * tmp ;
1557
-
1558
- tmp = action -> exec ;
1559
- action -> exec = g_strdup (exec );
1560
- g_free (tmp );
1561
- }
1562
-
1563
- static void
1564
- nemo_action_set_parent_dir (NemoAction * action , const gchar * parent_dir )
1565
- {
1566
- gchar * tmp ;
1567
-
1568
- tmp = action -> parent_dir ;
1569
- action -> parent_dir = g_strdup (parent_dir );
1570
- g_free (tmp );
1571
- }
1572
-
1573
- static void
1574
- nemo_action_set_separator (NemoAction * action , const gchar * separator )
1575
- {
1576
- gchar * tmp ;
1577
-
1578
- tmp = action -> separator ;
1579
- action -> separator = g_strdup (separator );
1580
- g_free (tmp );
1581
- }
1582
-
1583
- static void
1584
- nemo_action_set_conditions (NemoAction * action , gchar * * conditions )
1585
- {
1586
- gchar * * tmp ;
1587
-
1588
- tmp = action -> conditions ;
1589
- action -> conditions = g_strdupv (conditions );
1590
- g_strfreev (tmp );
1591
- }
1592
-
1593
- static gchar * *
1594
- nemo_action_get_conditions (NemoAction * action )
1595
- {
1596
- return action -> conditions ;
1597
- }
1598
-
1599
- static void
1600
- nemo_action_set_orig_label (NemoAction * action , const gchar * orig_label )
1601
- {
1602
- gchar * tmp ;
1603
-
1604
- tmp = action -> orig_label ;
1605
- action -> orig_label = g_strdup (orig_label );
1606
- g_free (tmp );
1607
- }
1608
-
1609
- static void
1610
- nemo_action_set_orig_tt (NemoAction * action , const gchar * orig_tt )
1611
- {
1612
- gchar * tmp ;
1613
-
1614
- tmp = action -> orig_tt ;
1615
- action -> orig_tt = g_strdup (orig_tt );
1616
- g_free (tmp );
1617
- }
1618
-
1619
1492
const gchar *
1620
1493
nemo_action_get_orig_label (NemoAction * action )
1621
1494
{
@@ -1677,18 +1550,6 @@ nemo_action_get_tt (NemoAction *action,
1677
1550
return ret ;
1678
1551
}
1679
1552
1680
- static gboolean
1681
- get_dbus_satisfied (NemoAction * action )
1682
- {
1683
- return action -> dbus_satisfied ;
1684
- }
1685
-
1686
- static gboolean
1687
- get_gsettings_satisfied (NemoAction * action )
1688
- {
1689
- return action -> gsettings_satisfied ;
1690
- }
1691
-
1692
1553
static gboolean
1693
1554
check_exec_condition (NemoAction * action ,
1694
1555
const gchar * condition ,
@@ -1783,19 +1644,17 @@ nemo_action_get_visibility (NemoAction *action,
1783
1644
GtkWindow * window )
1784
1645
{
1785
1646
// Check DBUS
1786
- if (!get_dbus_satisfied ( action ) )
1647
+ if (!action -> dbus_satisfied )
1787
1648
return FALSE;
1788
1649
1789
- if (!get_gsettings_satisfied ( action ) )
1650
+ if (!action -> gsettings_satisfied )
1790
1651
return FALSE;
1791
1652
1792
1653
// Check selection
1793
1654
gboolean selection_type_show = FALSE;
1794
- SelectionType selection_type = nemo_action_get_selection_type (action );
1795
-
1796
1655
guint selected_count = g_list_length (selection );
1797
1656
1798
- switch (selection_type ) {
1657
+ switch (action -> selection_type ) {
1799
1658
case SELECTION_SINGLE :
1800
1659
selection_type_show = selected_count == 1 ;
1801
1660
break ;
@@ -1812,7 +1671,7 @@ nemo_action_get_visibility (NemoAction *action,
1812
1671
selection_type_show = TRUE;
1813
1672
break ;
1814
1673
default :
1815
- selection_type_show = selected_count == selection_type ;
1674
+ selection_type_show = selected_count == action -> selection_type ;
1816
1675
break ;
1817
1676
}
1818
1677
@@ -1821,8 +1680,8 @@ nemo_action_get_visibility (NemoAction *action,
1821
1680
1822
1681
// Check extensions and mimetypes
1823
1682
gboolean extension_type_show = TRUE;
1824
- gchar * * extensions = nemo_action_get_extension_list ( action ) ;
1825
- gchar * * mimetypes = nemo_action_get_mimetypes_list ( action ) ;
1683
+ gchar * * extensions = action -> extensions ;
1684
+ gchar * * mimetypes = action -> mimetypes ;
1826
1685
1827
1686
guint ext_count = extensions != NULL ? g_strv_length (extensions ) : 0 ;
1828
1687
guint mime_count = mimetypes != NULL ? g_strv_length (mimetypes ) : 0 ;
@@ -1897,7 +1756,7 @@ nemo_action_get_visibility (NemoAction *action,
1897
1756
1898
1757
// Check conditions
1899
1758
gboolean condition_type_show = TRUE;
1900
- gchar * * conditions = nemo_action_get_conditions ( action ) ;
1759
+ gchar * * conditions = action -> conditions ;
1901
1760
guint condition_count = conditions != NULL ? g_strv_length (conditions ) : 0 ;
1902
1761
1903
1762
if (condition_count > 0 ) {
0 commit comments