Sort on ID if no images have a "captured" attribute.
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 22 Jul 2004 14:20:34 +0000 (14:20 +0000)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 22 Jul 2004 14:20:34 +0000 (14:20 +0000)
src/gkofoto/sortableobjectcollection.py

index ac893eb..18bf3e3 100644 (file)
@@ -67,6 +67,8 @@ class SortableObjectCollection(ObjectCollection):
             # ignore the callback when the radio menu item is unselected
             return
         if self.__sortColumnName != columnName:
+            if not columnName in self.getObjectMetadataMap():
+                columnName = "id"
             env.debug("Setting sort column to: " + columnName)
             self.__sortColumnName = columnName
             self.__configureSortedModel(self.__sortColumnName, self.__sortOrder)