Skip to content

Commit

Permalink
Gtk UI: Fix listing of big files on Windows (bug 1562)
Browse files Browse the repository at this point in the history
For files > 2GB, the list store couldn't handle the
long integer values. Fix this by using a different data
type in the ListStore.

Also fixed a bug that used the wrong units when showing
the file size in the main window (use_si_units was 1).
  • Loading branch information
thp committed Feb 11, 2012
1 parent f0953de commit 54056ab
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gpodder/gtkui/model.py
Expand Up @@ -34,6 +34,7 @@

import os
import gtk
import gobject
import xml.sax.saxutils

try:
Expand All @@ -60,7 +61,7 @@ class EpisodeListModel(gtk.ListStore):
def __init__(self, on_filter_changed=lambda has_episodes: None):
gtk.ListStore.__init__(self, str, str, str, object, \
str, str, str, str, bool, bool, bool, \
int, int, str, bool, bool, bool)
gobject.TYPE_INT64, int, str, bool, bool, bool)

# Callback for when the filter / list changes, gets one parameter
# (has_episodes) that is True if the list has any episodes
Expand Down Expand Up @@ -103,7 +104,7 @@ def __init__(self, on_filter_changed=lambda has_episodes: None):

def _format_filesize(self, episode):
if episode.length > 0:
return util.format_filesize(episode.length, 1)
return util.format_filesize(episode.length, digits=1)
else:
return None

Expand Down

0 comments on commit 54056ab

Please sign in to comment.