]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
GTK: wrap gtk_list_store_append
authorTimePath <andrew.hardaker1995@gmail.com>
Fri, 29 Dec 2017 08:48:00 +0000 (19:48 +1100)
committerTimePath <andrew.hardaker1995@gmail.com>
Fri, 29 Dec 2017 08:48:00 +0000 (19:48 +1100)
libs/uilib/uilib.cpp
libs/uilib/uilib.h
radiant/build.cpp

index b53137a52031313ed2edeb22cc803c0954872b7a..4832d92ffaec570a49318cd813b8c96d7eb17041 100644 (file)
@@ -373,6 +373,11 @@ namespace ui {
         gtk_list_store_clear(this);
     }
 
+    void IListStore::append()
+    {
+        gtk_list_store_append(this, nullptr);
+    }
+
     // IMPL(TreePath, GTK_TREE_PATH);
 
     TreePath::TreePath(ui::New_t) : TreePath(gtk_tree_path_new())
index 482d720af0f2aef8ae831cf203746c7c8641796b..b4d315c96327dc72d0b0bf0d6638e4b8dd40595e 100644 (file)
@@ -528,6 +528,8 @@ namespace ui {
 
          template<class... T>
          void append(T... args);
+
+         void append();
     );
 
     WRAP(TreeSelection, Object, _GtkTreeSelection, (),
index 8c733dd45ac196412460f7eac7fc414e587d78bd..13938ce10bd4c058d15494781f0b8e18d7e3b583 100644 (file)
@@ -653,8 +653,7 @@ void BSPCommandList_Construct( ui::ListStore store, Project& project ){
                store.append(0, (*i).first.c_str());
        }
 
-       GtkTreeIter lastIter;
-       gtk_list_store_append( store, &lastIter );
+       store.append();
 }
 
 class ProjectList
@@ -695,8 +694,7 @@ gboolean project_cell_edited( GtkCellRendererText* cell, gchar* path_string, gch
                project.push_back( Project::value_type( new_text, Build() ) );
 
                gtk_list_store_set( projectList->m_store, &iter, 0, new_text, -1 );
-               GtkTreeIter lastIter;
-               gtk_list_store_append( projectList->m_store, &lastIter );
+               projectList->m_store.append();
        }
 
        gtk_tree_path_free( path );
@@ -753,8 +751,7 @@ gboolean project_selection_changed( GtkTreeSelection* selection, ui::ListStore s
                        {
                                store.append(0, (*i).c_str());
                        }
-                       GtkTreeIter lastIter;
-                       gtk_list_store_append( store, &lastIter );
+                       store.append();
                }
                else
                {
@@ -795,8 +792,7 @@ gboolean commands_cell_edited( GtkCellRendererText* cell, gchar* path_string, gc
 
                gtk_list_store_set( store, &iter, 0, new_text, -1 );
 
-               GtkTreeIter lastIter;
-               gtk_list_store_append( store, &lastIter );
+               store.append();
        }
 
        gtk_tree_path_free( path );