[arch-commits] Commit in gnome-activity-journal/repos/community-any (12 files)
Balló György
bgyorgy at nymeria.archlinux.org
Sat Nov 30 14:49:02 UTC 2013
Date: Saturday, November 30, 2013 @ 15:49:02
Author: bgyorgy
Revision: 101716
archrelease: copy trunk to community-any
Added:
gnome-activity-journal/repos/community-any/PKGBUILD
(from rev 101715, gnome-activity-journal/trunk/PKGBUILD)
gnome-activity-journal/repos/community-any/bluebird_histogram.patch
(from rev 101715, gnome-activity-journal/trunk/bluebird_histogram.patch)
gnome-activity-journal/repos/community-any/disable-set-background.patch
(from rev 101715, gnome-activity-journal/trunk/disable-set-background.patch)
gnome-activity-journal/repos/community-any/fix-indicator-icon.patch
(from rev 101715, gnome-activity-journal/trunk/fix-indicator-icon.patch)
gnome-activity-journal/repos/community-any/gnome-activity-journal.install
(from rev 101715, gnome-activity-journal/trunk/gnome-activity-journal.install)
gnome-activity-journal/repos/community-any/make-libgnomeui-optional.patch
(from rev 101715, gnome-activity-journal/trunk/make-libgnomeui-optional.patch)
Deleted:
gnome-activity-journal/repos/community-any/PKGBUILD
gnome-activity-journal/repos/community-any/bluebird_histogram.patch
gnome-activity-journal/repos/community-any/disable-set-background.patch
gnome-activity-journal/repos/community-any/fix-indicator-icon.patch
gnome-activity-journal/repos/community-any/gnome-activity-journal.install
gnome-activity-journal/repos/community-any/make-libgnomeui-optional.patch
--------------------------------+
PKGBUILD | 102 ++++++++---------
bluebird_histogram.patch | 30 ++---
disable-set-background.patch | 66 +++++------
fix-indicator-icon.patch | 30 ++---
gnome-activity-journal.install | 44 +++----
make-libgnomeui-optional.patch | 226 +++++++++++++++++++--------------------
6 files changed, 249 insertions(+), 249 deletions(-)
Deleted: PKGBUILD
===================================================================
--- PKGBUILD 2013-11-30 14:48:44 UTC (rev 101715)
+++ PKGBUILD 2013-11-30 14:49:02 UTC (rev 101716)
@@ -1,51 +0,0 @@
-# $Id$
-# Maintainer: Balló György <ballogyor+arch at gmail dot com>
-
-pkgname=gnome-activity-journal
-pkgver=0.8.0
-pkgrel=5
-pkgdesc="Tool for easily browsing and finding files on your computer using the Zeitgeist engine"
-arch=('any')
-url="https://launchpad.net/gnome-activity-journal"
-license=('GPL')
-depends=('python2-gconf' 'zeitgeist' 'hicolor-icon-theme' 'xdg-utils')
-makedepends=('python2-distutils-extra')
-optdepends=('python2-libgnome: get thumbnail of image and video files'
- 'gstreamer0.10-python: add multimedia tooltip for audio and video files'
- 'python2-pygments: get thumbnail of text files')
-install=$pkgname.install
-source=(http://launchpad.net/$pkgname/${pkgver%.*}/$pkgver/+download/$pkgname-$pkgver.tar.gz
- disable-set-background.patch
- bluebird_histogram.patch
- fix-indicator-icon.patch
- make-libgnomeui-optional.patch)
-md5sums=('46e493f090b41a49cfce422203791bc0'
- '23f0ead4fe6161e6aa71c8ad19ac5695'
- '075953e6cc1f88d2fc588488957550ee'
- 'b757b0c8e5ff06eb50d30f5028c5691b'
- 'a158b002cf33efcfefb4fa06d7ef7da5')
-
-build() {
- cd "$srcdir/$pkgname-$pkgver"
- sed -i 's@^#!.*python$@#!/usr/bin/python2@' src/config.py gnome-activity-journal
-
- # https://bugs.launchpad.net/gnome-activity-journal/+bug/882557
- patch -Np1 -i "$srcdir/disable-set-background.patch"
-
- # https://bugs.launchpad.net/gnome-activity-journal/+bug/924988
- patch -Np1 -i "$srcdir/bluebird_histogram.patch"
-
- # Use icon name instead of full path to fix indicator icon
- patch -Np1 -i "$srcdir/fix-indicator-icon.patch"
-
- # https://bugs.launchpad.net/gnome-activity-journal/+bug/871130
- patch -Np1 -i "$srcdir/make-libgnomeui-optional.patch"
-
- python2 setup.py build
-}
-
-package() {
- cd "$srcdir/$pkgname-$pkgver"
-
- python2 setup.py install --root=$pkgdir/ --optimize=1
-}
Copied: gnome-activity-journal/repos/community-any/PKGBUILD (from rev 101715, gnome-activity-journal/trunk/PKGBUILD)
===================================================================
--- PKGBUILD (rev 0)
+++ PKGBUILD 2013-11-30 14:49:02 UTC (rev 101716)
@@ -0,0 +1,51 @@
+# $Id$
+# Maintainer: Balló György <ballogyor+arch at gmail dot com>
+
+pkgname=gnome-activity-journal
+pkgver=0.8.0
+pkgrel=6
+pkgdesc="Tool for easily browsing and finding files on your computer using the Zeitgeist engine"
+arch=('any')
+url="https://launchpad.net/gnome-activity-journal"
+license=('GPL')
+depends=('python2-gconf' 'python2-xdg' 'zeitgeist' 'hicolor-icon-theme' 'xdg-utils')
+makedepends=('python2-distutils-extra')
+optdepends=('python2-libgnome: get thumbnail of image and video files'
+ 'gstreamer0.10-python: add multimedia tooltip for audio and video files'
+ 'python2-pygments: get thumbnail of text files')
+install=$pkgname.install
+source=(http://launchpad.net/$pkgname/${pkgver%.*}/$pkgver/+download/$pkgname-$pkgver.tar.gz
+ disable-set-background.patch
+ bluebird_histogram.patch
+ fix-indicator-icon.patch
+ make-libgnomeui-optional.patch)
+md5sums=('46e493f090b41a49cfce422203791bc0'
+ '23f0ead4fe6161e6aa71c8ad19ac5695'
+ '075953e6cc1f88d2fc588488957550ee'
+ 'b757b0c8e5ff06eb50d30f5028c5691b'
+ 'a158b002cf33efcfefb4fa06d7ef7da5')
+
+build() {
+ cd "$srcdir/$pkgname-$pkgver"
+ sed -i 's@^#!.*python$@#!/usr/bin/python2@' src/config.py gnome-activity-journal
+
+ # https://bugs.launchpad.net/gnome-activity-journal/+bug/882557
+ patch -Np1 -i "$srcdir/disable-set-background.patch"
+
+ # https://bugs.launchpad.net/gnome-activity-journal/+bug/924988
+ patch -Np1 -i "$srcdir/bluebird_histogram.patch"
+
+ # Use icon name instead of full path to fix indicator icon
+ patch -Np1 -i "$srcdir/fix-indicator-icon.patch"
+
+ # https://bugs.launchpad.net/gnome-activity-journal/+bug/871130
+ patch -Np1 -i "$srcdir/make-libgnomeui-optional.patch"
+
+ python2 setup.py build
+}
+
+package() {
+ cd "$srcdir/$pkgname-$pkgver"
+
+ python2 setup.py install --root=$pkgdir/ --optimize=1
+}
Deleted: bluebird_histogram.patch
===================================================================
--- bluebird_histogram.patch 2013-11-30 14:48:44 UTC (rev 101715)
+++ bluebird_histogram.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -1,15 +0,0 @@
---- a/src/external.py
-+++ b/src/external.py
-@@ -41,7 +41,11 @@
- _restarted = False
-
- def __init__(self):
-- self._extension = CLIENT._iface.get_extension("Log", "journal/activity")
-+ if CLIENT.get_version() >= [0, 8, 99]:
-+ self._extension = CLIENT._iface.get_extension("Histogram", "journal/activity")
-+ else:
-+ self._extension = CLIENT._iface.get_extension("Log", "journal/activity")
-+
-
- def _show_error(self):
- dialog = gtk.MessageDialog(
Copied: gnome-activity-journal/repos/community-any/bluebird_histogram.patch (from rev 101715, gnome-activity-journal/trunk/bluebird_histogram.patch)
===================================================================
--- bluebird_histogram.patch (rev 0)
+++ bluebird_histogram.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -0,0 +1,15 @@
+--- a/src/external.py
++++ b/src/external.py
+@@ -41,7 +41,11 @@
+ _restarted = False
+
+ def __init__(self):
+- self._extension = CLIENT._iface.get_extension("Log", "journal/activity")
++ if CLIENT.get_version() >= [0, 8, 99]:
++ self._extension = CLIENT._iface.get_extension("Histogram", "journal/activity")
++ else:
++ self._extension = CLIENT._iface.get_extension("Log", "journal/activity")
++
+
+ def _show_error(self):
+ dialog = gtk.MessageDialog(
Deleted: disable-set-background.patch
===================================================================
--- disable-set-background.patch 2013-11-30 14:48:44 UTC (rev 101715)
+++ disable-set-background.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -1,33 +0,0 @@
-diff -Naur gnome-activity-journal-0.8.0.orig/src/activity_widgets.py gnome-activity-journal-0.8.0/src/activity_widgets.py
---- gnome-activity-journal-0.8.0.orig/src/activity_widgets.py 2011-07-16 17:58:23.000000000 +0200
-+++ gnome-activity-journal-0.8.0/src/activity_widgets.py 2011-11-15 02:15:30.603371223 +0100
-@@ -1689,7 +1689,6 @@
- context = widget.window.cairo_create()
- layout = self.create_pango_layout(" ")
- width = event.area.width
-- widget.style.set_background(window, gtk.STATE_NORMAL)
- context.set_source_rgba(*self.line_color)
- context.set_line_width(2)
- self.draw_lines(window, context, layout, width)
-diff -Naur gnome-activity-journal-0.8.0.orig/src/histogram.py gnome-activity-journal-0.8.0/src/histogram.py
---- gnome-activity-journal-0.8.0.orig/src/histogram.py 2011-05-21 14:29:27.000000000 +0200
-+++ gnome-activity-journal-0.8.0/src/histogram.py 2011-11-15 02:15:37.776270364 +0100
-@@ -157,7 +157,6 @@
- """
- The major drawing method that the expose event calls directly
- """
-- widget.style.set_background(widget.window, gtk.STATE_NORMAL)
- context = widget.window.cairo_create()
- self.expose(widget, event, context)
-
-diff -Naur gnome-activity-journal-0.8.0.orig/src/supporting_widgets.py gnome-activity-journal-0.8.0/src/supporting_widgets.py
---- gnome-activity-journal-0.8.0.orig/src/supporting_widgets.py 2011-05-21 14:29:27.000000000 +0200
-+++ gnome-activity-journal-0.8.0/src/supporting_widgets.py 2011-11-15 02:15:45.059162848 +0100
-@@ -94,7 +94,6 @@
- self.context = context
-
- self.font_name = self.style.font_desc.get_family()
-- widget.style.set_background(widget.window, gtk.STATE_NORMAL)
-
- # set a clip region for the expose event
- context.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
Copied: gnome-activity-journal/repos/community-any/disable-set-background.patch (from rev 101715, gnome-activity-journal/trunk/disable-set-background.patch)
===================================================================
--- disable-set-background.patch (rev 0)
+++ disable-set-background.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -0,0 +1,33 @@
+diff -Naur gnome-activity-journal-0.8.0.orig/src/activity_widgets.py gnome-activity-journal-0.8.0/src/activity_widgets.py
+--- gnome-activity-journal-0.8.0.orig/src/activity_widgets.py 2011-07-16 17:58:23.000000000 +0200
++++ gnome-activity-journal-0.8.0/src/activity_widgets.py 2011-11-15 02:15:30.603371223 +0100
+@@ -1689,7 +1689,6 @@
+ context = widget.window.cairo_create()
+ layout = self.create_pango_layout(" ")
+ width = event.area.width
+- widget.style.set_background(window, gtk.STATE_NORMAL)
+ context.set_source_rgba(*self.line_color)
+ context.set_line_width(2)
+ self.draw_lines(window, context, layout, width)
+diff -Naur gnome-activity-journal-0.8.0.orig/src/histogram.py gnome-activity-journal-0.8.0/src/histogram.py
+--- gnome-activity-journal-0.8.0.orig/src/histogram.py 2011-05-21 14:29:27.000000000 +0200
++++ gnome-activity-journal-0.8.0/src/histogram.py 2011-11-15 02:15:37.776270364 +0100
+@@ -157,7 +157,6 @@
+ """
+ The major drawing method that the expose event calls directly
+ """
+- widget.style.set_background(widget.window, gtk.STATE_NORMAL)
+ context = widget.window.cairo_create()
+ self.expose(widget, event, context)
+
+diff -Naur gnome-activity-journal-0.8.0.orig/src/supporting_widgets.py gnome-activity-journal-0.8.0/src/supporting_widgets.py
+--- gnome-activity-journal-0.8.0.orig/src/supporting_widgets.py 2011-05-21 14:29:27.000000000 +0200
++++ gnome-activity-journal-0.8.0/src/supporting_widgets.py 2011-11-15 02:15:45.059162848 +0100
+@@ -94,7 +94,6 @@
+ self.context = context
+
+ self.font_name = self.style.font_desc.get_family()
+- widget.style.set_background(widget.window, gtk.STATE_NORMAL)
+
+ # set a clip region for the expose event
+ context.rectangle(event.area.x, event.area.y, event.area.width, event.area.height)
Deleted: fix-indicator-icon.patch
===================================================================
--- fix-indicator-icon.patch 2013-11-30 14:48:44 UTC (rev 101715)
+++ fix-indicator-icon.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -1,15 +0,0 @@
-diff -Naur gnome-activity-journal-0.8.0.orig/src/Indicator.py gnome-activity-journal-0.8.0/src/Indicator.py
---- gnome-activity-journal-0.8.0.orig/src/Indicator.py 2011-07-16 18:57:07.000000000 +0200
-+++ gnome-activity-journal-0.8.0/src/Indicator.py 2011-11-15 02:51:27.156163756 +0100
-@@ -37,9 +37,9 @@
- A widget that implements the appindicator for ubuntu
- """
- def __init__(self, main_window):
-- path = get_icon_path("hicolor/scalable/apps/gnome-activity-journal.svg")
-+ icon = "gnome-activity-journal"
- name = _("Activity Journal")
-- appindicator.Indicator.__init__(self, name, path, \
-+ appindicator.Indicator.__init__(self, name, icon, \
- appindicator.CATEGORY_APPLICATION_STATUS)
-
- self.main_window = main_window
Copied: gnome-activity-journal/repos/community-any/fix-indicator-icon.patch (from rev 101715, gnome-activity-journal/trunk/fix-indicator-icon.patch)
===================================================================
--- fix-indicator-icon.patch (rev 0)
+++ fix-indicator-icon.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -0,0 +1,15 @@
+diff -Naur gnome-activity-journal-0.8.0.orig/src/Indicator.py gnome-activity-journal-0.8.0/src/Indicator.py
+--- gnome-activity-journal-0.8.0.orig/src/Indicator.py 2011-07-16 18:57:07.000000000 +0200
++++ gnome-activity-journal-0.8.0/src/Indicator.py 2011-11-15 02:51:27.156163756 +0100
+@@ -37,9 +37,9 @@
+ A widget that implements the appindicator for ubuntu
+ """
+ def __init__(self, main_window):
+- path = get_icon_path("hicolor/scalable/apps/gnome-activity-journal.svg")
++ icon = "gnome-activity-journal"
+ name = _("Activity Journal")
+- appindicator.Indicator.__init__(self, name, path, \
++ appindicator.Indicator.__init__(self, name, icon, \
+ appindicator.CATEGORY_APPLICATION_STATUS)
+
+ self.main_window = main_window
Deleted: gnome-activity-journal.install
===================================================================
--- gnome-activity-journal.install 2013-11-30 14:48:44 UTC (rev 101715)
+++ gnome-activity-journal.install 2013-11-30 14:49:02 UTC (rev 101716)
@@ -1,22 +0,0 @@
-pkgname=gnome-activity-journal
-
-post_install() {
- gconfpkg --install $pkgname
- xdg-icon-resource forceupdate
-}
-
-pre_upgrade() {
- pre_remove $1
-}
-
-post_upgrade() {
- post_install $1
-}
-
-pre_remove() {
- gconfpkg --uninstall $pkgname
-}
-
-post_remove() {
- xdg-icon-resource forceupdate
-}
Copied: gnome-activity-journal/repos/community-any/gnome-activity-journal.install (from rev 101715, gnome-activity-journal/trunk/gnome-activity-journal.install)
===================================================================
--- gnome-activity-journal.install (rev 0)
+++ gnome-activity-journal.install 2013-11-30 14:49:02 UTC (rev 101716)
@@ -0,0 +1,22 @@
+pkgname=gnome-activity-journal
+
+post_install() {
+ gconfpkg --install $pkgname
+ xdg-icon-resource forceupdate
+}
+
+pre_upgrade() {
+ pre_remove $1
+}
+
+post_upgrade() {
+ post_install $1
+}
+
+pre_remove() {
+ gconfpkg --uninstall $pkgname
+}
+
+post_remove() {
+ xdg-icon-resource forceupdate
+}
Deleted: make-libgnomeui-optional.patch
===================================================================
--- make-libgnomeui-optional.patch 2013-11-30 14:48:44 UTC (rev 101715)
+++ make-libgnomeui-optional.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -1,113 +0,0 @@
-diff -Naur gnome-activity-journal-0.8.0.orig/src/common.py gnome-activity-journal-0.8.0/src/common.py
---- gnome-activity-journal-0.8.0.orig/src/common.py 2011-07-16 18:27:43.000000000 +0200
-+++ gnome-activity-journal-0.8.0/src/common.py 2011-10-09 07:04:07.011645989 +0200
-@@ -29,7 +29,6 @@
- import gobject
- import gettext
- import gio
--import gnome.ui
- import glib
- import gtk
- import os
-@@ -44,6 +43,12 @@
- import zipfile
-
- try:
-+ import gnome.ui
-+ gnomeui = True
-+except ImportError:
-+ gnomeui = None
-+
-+try:
- import pygments
- except ImportError:
- pygments = None
-@@ -72,10 +77,11 @@
- SIZE_TEXT_TIMELINEVIEW = ["small", "medium", "large", "x-large"]
- SIZE_TEXT_THUMBVIEW = ["x-small", "small", "large", "xx-large"]
-
--THUMBNAIL_FACTORIES = {
-- SIZE_NORMAL: gnome.ui.ThumbnailFactory("normal"),
-- SIZE_LARGE: gnome.ui.ThumbnailFactory("large")
--}
-+if gnomeui:
-+ THUMBNAIL_FACTORIES = {
-+ SIZE_NORMAL: gnome.ui.ThumbnailFactory("normal"),
-+ SIZE_LARGE: gnome.ui.ThumbnailFactory("large")
-+ }
- ICON_THEME = gtk.icon_theme_get_default()
-
- #FIXME i know it's ugly. Btw this is only a temp solution. It will be removed
-@@ -878,39 +884,41 @@
- try:
- thumb = THUMBS[size][self.uri]
- except KeyError:
-+ thumb = None
-- factory = THUMBNAIL_FACTORIES[size]
-- location = factory.lookup(self.uri, self.mtime)
-- if location:
-- thumb, mtime = THUMBS[size][self.uri] = \
-- (gtk.gdk.pixbuf_new_from_file(location), self.mtime)
-- else:
-- if factory.has_valid_failed_thumbnail(self.uri, self.mtime):
-- thumb = THUMBS[size][self.uri] = None
-+ if gnomeui:
-+ factory = THUMBNAIL_FACTORIES[size]
-+ location = factory.lookup(self.uri, self.mtime)
-+ if location:
-+ thumb, mtime = THUMBS[size][self.uri] = \
-+ (gtk.gdk.pixbuf_new_from_file(location), self.mtime)
- else:
-- thumb = factory.generate_thumbnail(self.uri, self.mime_type)
-- if thumb is None:
-- # maybe we are able to use a custom thumbnailer here
-- if filter(lambda name: "application-vnd.oasis.opendocument" in name, self.icon_names):
-- thumb = create_opendocument_thumb(self._file_object.get_path())
-- elif "text-x-generic" in self.icon_names or "text-x-script" in self.icon_names:
-- try:
-- thumb = create_text_thumb(self, size, 1)
-- except Exception:
-- thumb = None
-- elif "audio-x-generic" in self.icon_names:
-- pass
-- #FIXME
-- #thumb = self.get_audio_cover(size)
-- if thumb is None:
-- factory.create_failed_thumbnail(self.uri, self.mtime)
-+ if factory.has_valid_failed_thumbnail(self.uri, self.mtime):
-+ thumb = THUMBS[size][self.uri] = None
- else:
-- width, height = thumb.get_width(), thumb.get_height()
-- if width > size[0] or height > size[1]:
-- scale = min(float(size[0])/width, float(size[1])/height)
-- thumb = gnome.ui.thumbnail_scale_down_pixbuf(
-- thumb, int(scale*width), int(scale*height))
-- factory.save_thumbnail(thumb, self.uri, self.mtime)
-- THUMBS[size][self.uri] = (thumb, self.mtime)
-+ thumb = factory.generate_thumbnail(self.uri, self.mime_type)
-+ if thumb is None:
-+ # maybe we are able to use a custom thumbnailer here
-+ if filter(lambda name: "application-vnd.oasis.opendocument" in name, self.icon_names):
-+ thumb = create_opendocument_thumb(self._file_object.get_path())
-+ elif "text-x-generic" in self.icon_names or "text-x-script" in self.icon_names:
-+ try:
-+ thumb = create_text_thumb(self, size, 1)
-+ except Exception:
-+ thumb = None
-+ elif "audio-x-generic" in self.icon_names:
-+ pass
-+ #FIXME
-+ #thumb = self.get_audio_cover(size)
-+ if thumb is None:
-+ factory.create_failed_thumbnail(self.uri, self.mtime)
-+ else:
-+ width, height = thumb.get_width(), thumb.get_height()
-+ if width > size[0] or height > size[1]:
-+ scale = min(float(size[0])/width, float(size[1])/height)
-+ thumb = gnome.ui.thumbnail_scale_down_pixbuf(
-+ thumb, int(scale*width), int(scale*height))
-+ factory.save_thumbnail(thumb, self.uri, self.mtime)
-+ THUMBS[size][self.uri] = (thumb, self.mtime)
- else:
- if thumb is not None:
- if thumb[1] != self.mtime:
Copied: gnome-activity-journal/repos/community-any/make-libgnomeui-optional.patch (from rev 101715, gnome-activity-journal/trunk/make-libgnomeui-optional.patch)
===================================================================
--- make-libgnomeui-optional.patch (rev 0)
+++ make-libgnomeui-optional.patch 2013-11-30 14:49:02 UTC (rev 101716)
@@ -0,0 +1,113 @@
+diff -Naur gnome-activity-journal-0.8.0.orig/src/common.py gnome-activity-journal-0.8.0/src/common.py
+--- gnome-activity-journal-0.8.0.orig/src/common.py 2011-07-16 18:27:43.000000000 +0200
++++ gnome-activity-journal-0.8.0/src/common.py 2011-10-09 07:04:07.011645989 +0200
+@@ -29,7 +29,6 @@
+ import gobject
+ import gettext
+ import gio
+-import gnome.ui
+ import glib
+ import gtk
+ import os
+@@ -44,6 +43,12 @@
+ import zipfile
+
+ try:
++ import gnome.ui
++ gnomeui = True
++except ImportError:
++ gnomeui = None
++
++try:
+ import pygments
+ except ImportError:
+ pygments = None
+@@ -72,10 +77,11 @@
+ SIZE_TEXT_TIMELINEVIEW = ["small", "medium", "large", "x-large"]
+ SIZE_TEXT_THUMBVIEW = ["x-small", "small", "large", "xx-large"]
+
+-THUMBNAIL_FACTORIES = {
+- SIZE_NORMAL: gnome.ui.ThumbnailFactory("normal"),
+- SIZE_LARGE: gnome.ui.ThumbnailFactory("large")
+-}
++if gnomeui:
++ THUMBNAIL_FACTORIES = {
++ SIZE_NORMAL: gnome.ui.ThumbnailFactory("normal"),
++ SIZE_LARGE: gnome.ui.ThumbnailFactory("large")
++ }
+ ICON_THEME = gtk.icon_theme_get_default()
+
+ #FIXME i know it's ugly. Btw this is only a temp solution. It will be removed
+@@ -878,39 +884,41 @@
+ try:
+ thumb = THUMBS[size][self.uri]
+ except KeyError:
++ thumb = None
+- factory = THUMBNAIL_FACTORIES[size]
+- location = factory.lookup(self.uri, self.mtime)
+- if location:
+- thumb, mtime = THUMBS[size][self.uri] = \
+- (gtk.gdk.pixbuf_new_from_file(location), self.mtime)
+- else:
+- if factory.has_valid_failed_thumbnail(self.uri, self.mtime):
+- thumb = THUMBS[size][self.uri] = None
++ if gnomeui:
++ factory = THUMBNAIL_FACTORIES[size]
++ location = factory.lookup(self.uri, self.mtime)
++ if location:
++ thumb, mtime = THUMBS[size][self.uri] = \
++ (gtk.gdk.pixbuf_new_from_file(location), self.mtime)
+ else:
+- thumb = factory.generate_thumbnail(self.uri, self.mime_type)
+- if thumb is None:
+- # maybe we are able to use a custom thumbnailer here
+- if filter(lambda name: "application-vnd.oasis.opendocument" in name, self.icon_names):
+- thumb = create_opendocument_thumb(self._file_object.get_path())
+- elif "text-x-generic" in self.icon_names or "text-x-script" in self.icon_names:
+- try:
+- thumb = create_text_thumb(self, size, 1)
+- except Exception:
+- thumb = None
+- elif "audio-x-generic" in self.icon_names:
+- pass
+- #FIXME
+- #thumb = self.get_audio_cover(size)
+- if thumb is None:
+- factory.create_failed_thumbnail(self.uri, self.mtime)
++ if factory.has_valid_failed_thumbnail(self.uri, self.mtime):
++ thumb = THUMBS[size][self.uri] = None
+ else:
+- width, height = thumb.get_width(), thumb.get_height()
+- if width > size[0] or height > size[1]:
+- scale = min(float(size[0])/width, float(size[1])/height)
+- thumb = gnome.ui.thumbnail_scale_down_pixbuf(
+- thumb, int(scale*width), int(scale*height))
+- factory.save_thumbnail(thumb, self.uri, self.mtime)
+- THUMBS[size][self.uri] = (thumb, self.mtime)
++ thumb = factory.generate_thumbnail(self.uri, self.mime_type)
++ if thumb is None:
++ # maybe we are able to use a custom thumbnailer here
++ if filter(lambda name: "application-vnd.oasis.opendocument" in name, self.icon_names):
++ thumb = create_opendocument_thumb(self._file_object.get_path())
++ elif "text-x-generic" in self.icon_names or "text-x-script" in self.icon_names:
++ try:
++ thumb = create_text_thumb(self, size, 1)
++ except Exception:
++ thumb = None
++ elif "audio-x-generic" in self.icon_names:
++ pass
++ #FIXME
++ #thumb = self.get_audio_cover(size)
++ if thumb is None:
++ factory.create_failed_thumbnail(self.uri, self.mtime)
++ else:
++ width, height = thumb.get_width(), thumb.get_height()
++ if width > size[0] or height > size[1]:
++ scale = min(float(size[0])/width, float(size[1])/height)
++ thumb = gnome.ui.thumbnail_scale_down_pixbuf(
++ thumb, int(scale*width), int(scale*height))
++ factory.save_thumbnail(thumb, self.uri, self.mtime)
++ THUMBS[size][self.uri] = (thumb, self.mtime)
+ else:
+ if thumb is not None:
+ if thumb[1] != self.mtime:
More information about the arch-commits
mailing list