I got a problem with listviews, using PyGTK. Here is the situation:

Let's assume we got a listview, containing a playlist with two rows: Song name and artist:

```
Song 1, Artist C
Song 2, Artist A
Song 3, Artist B

```

(In reality, there a some more columns)

Every row can be used to sort the view. Sorting by artist, would lead to the following result:

```
Song 2, Artist A
Song 3, Artist B
Song 1, Artist C

```

What I need now, is the current order of the playlist. Assuming the player plays Song 3 (Artist B), the Song ends, but the user changed the order by sorting by artist. The next song on the playlist is now Song 1.

The gtk.ListStore still contains the old order, which means, the player will stop after Song 3, because the playlist ended here before the reordering.

I do not need the path of the song in the List- or Treeview, as Song 1 will always have (0,). What I need is the CURRENT order of the list in the view.

I tried a lot, but did not found a solution. If required, I can add the code.

Update:

I add some code to clarify:

```
class Player:
    def __init__(self):

    "Window stuff.."

    self.treeView = gtk.TreeView(self.create_model())
    self.treeView.set_rules_hint(True)
    select = self.treeView.get_selection()
    select.connect("changed", self.on_tree_selection_changed)
    self.treeView.connect("button-press-event", self.on_double_click)

    "Window stuff.. Packing etc."

def create_model(self):
    """Returns a gtk.ListStore"""
    store = gtk.ListStore(str, str, str, str, int)
    for song in self.songs:
        store.append([song.track, song.title, song.artist, song.get_length(), song.id])
    return store

def create_columns(self, treeView):

    rendererText = gtk.CellRendererText()
    column = gtk.TreeViewColumn("Track", rendererText, text=0)
    column.set_sort_column_id(0)
    treeView.append_column(column)

    rendererText = gtk.CellRendererText()
    column = gtk.TreeViewColumn("Title", rendererText, text=1)
    column.set_sort_column_id(1)    
    treeView.append_column(column)

    rendererText = gtk.CellRendererText()
    column = gtk.TreeViewColumn("Artist", rendererText, text=2)
    column.set_sort_column_id(2)    
    treeView.append_column(column)

    rendererText = gtk.CellRendererText()
    column = gtk.TreeViewColumn("Length", rendererText, text=3)
    column.set_sort_column_id(3)    
    treeView.append_column(column)

    rendererText = gtk.CellRendererText()
    column = gtk.TreeViewColumn("Id", rendererText, text=4)
    column.set_sort_column_id(4)   

```