packages: xfce4-linelight-plugin/xfce4-linelight-plugin.spec, xfce4-linelig...
baggins
baggins at pld-linux.org
Tue Feb 22 00:52:41 CET 2011
Author: baggins Date: Mon Feb 21 23:52:41 2011 GMT
Module: packages Tag: HEAD
---- Log message:
- rel 4
- port to gio (from upstream svn)
---- Files affected:
packages/xfce4-linelight-plugin:
xfce4-linelight-plugin.spec (1.4 -> 1.5) , xfce4-linelight-plugin-gio.patch (NONE -> 1.1) (NEW)
---- Diffs:
================================================================
Index: packages/xfce4-linelight-plugin/xfce4-linelight-plugin.spec
diff -u packages/xfce4-linelight-plugin/xfce4-linelight-plugin.spec:1.4 packages/xfce4-linelight-plugin/xfce4-linelight-plugin.spec:1.5
--- packages/xfce4-linelight-plugin/xfce4-linelight-plugin.spec:1.4 Tue Feb 15 19:37:16 2011
+++ packages/xfce4-linelight-plugin/xfce4-linelight-plugin.spec Tue Feb 22 00:52:36 2011
@@ -3,16 +3,20 @@
Summary(pl.UTF-8): Prosty interfejs do wyszukiwania przy pomocy locate
Name: xfce4-linelight-plugin
Version: 0.1.6
-Release: 3
+Release: 4
License: GPL v2
Group: X11/Applications
Source0: http://archive.xfce.org/src/panel-plugins/xfce4-linelight-plugin/0.1/%{name}-%{version}.tar.bz2
# Source0-md5: 796ea4e795089a10525b8b70a0291e03
Patch0: includes.patch
+Patch1: %{name}-gio.patch
URL: http://goodies.xfce.org/projects/panel-plugins/xfce4-linelight-plugin
+BuildRequires: autoconf
+BuildRequires: automake
+BuildRequires: glib2-devel >= 1:2.18.0
+BuildRequires: libtool
BuildRequires: libxfcegui4-devel >= 4.4.0
BuildRequires: rpmbuild(macros) >= 1.601
-BuildRequires: thunar-vfs-devel
BuildRequires: xfce4-dev-tools >= 4.4.0
BuildRequires: xfce4-panel-devel >= 4.4.0
Requires: gtk-update-icon-cache
@@ -29,8 +33,14 @@
%prep
%setup -q
%patch0 -p1
+%patch1 -p0
%build
+%{__libtoolize}
+%{__aclocal}
+%{__autoconf}
+%{__autoheader}
+%{__automake}
%configure \
--disable-static
@@ -64,6 +74,10 @@
All persons listed below can be reached at <cvs_login>@pld-linux.org
$Log$
+Revision 1.5 2011/02/21 23:52:36 baggins
+- rel 4
+- port to gio (from upstream svn)
+
Revision 1.4 2011/02/15 18:37:16 megabajt
- added includes.patch (fixes build with xfce 4.8)
- added missing BRs
================================================================
Index: packages/xfce4-linelight-plugin/xfce4-linelight-plugin-gio.patch
diff -u /dev/null packages/xfce4-linelight-plugin/xfce4-linelight-plugin-gio.patch:1.1
--- /dev/null Tue Feb 22 00:52:41 2011
+++ packages/xfce4-linelight-plugin/xfce4-linelight-plugin-gio.patch Tue Feb 22 00:52:36 2011
@@ -0,0 +1,336 @@
+Index: configure.in
+===================================================================
+--- configure.in (revision 59)
++++ configure.in (working copy)
+@@ -22,7 +22,8 @@
+ dnl Check for required packages
+ XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
+ XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.4.0])
+-XDT_CHECK_PACKAGE([LIBTHUNAR_VFS], [thunar-vfs-1], [0.9.0])
++XDT_CHECK_PACKAGE([LIBGIO], [gio-2.0], [2.18.0])
++XDT_CHECK_PACKAGE([LIBGIOUNIX], [gio-unix-2.0], [2.16.0])
+ XDT_CHECK_PACKAGE([LIBGTK], [gtk+-2.0], [2.12.0])
+ XDT_CHECK_PACKAGE([LIBGTHREADS], [gthread-2.0], [2.16.0])
+
+Index: ChangeLog
+===================================================================
+--- ChangeLog (revision 59)
++++ ChangeLog (working copy)
+@@ -1,3 +1,9 @@
++2010-05-24 10:00 mpfeuti
++
++ * applied patch for xfce 4.8
++ * applied patch for xfce gio
++ * fixed Alt-F4 Bug
++
+ 2008-07-24 21:30 mpfeuti
+
+ * A Settings Dialog is now available
+Index: panel-plugin/linelight.c
+===================================================================
+--- panel-plugin/linelight.c (revision 59)
++++ panel-plugin/linelight.c (working copy)
+@@ -20,7 +20,7 @@
+ #include <libxfcegui4/libxfcegui4.h>
+ #include <libxfce4panel/libxfce4panel.h>
+
+-#include <thunar-vfs/thunar-vfs.h>
++#include <gio/gio.h>
+
+ #include <string.h>
+ #include <stdlib.h>
+@@ -215,10 +213,10 @@
+ gtk_list_store_insert(data->list, &iter, data->listPointer[sec]);
+
+ GtkIconTheme *icon_theme = gtk_icon_theme_get_default();
+- ThunarVfsPath *thunarPath = thunar_vfs_path_new (entry,NULL);
++ GFile *file = g_file_new_for_path(entry);
+
+ //icon
+- if (thunarPath != NULL && sec == BIN_SECTION )
++ if (g_file_query_exists (file, NULL) && sec == BIN_SECTION )
+ {
+ XfceDesktopEntry* app = xfce_desktop_entry_new(entry,categories,3);
+
+@@ -228,25 +226,27 @@
+ g_object_unref(app);
+ free(icon);
+ }
+- thunar_vfs_path_unref(thunarPath);
+ }
+- else if (thunarPath != NULL)
++ else if (file != NULL)
+ {
+- ThunarVfsMimeDatabase* db = thunar_vfs_mime_database_get_default();
+- ThunarVfsMimeInfo* info = thunar_vfs_mime_database_get_info_for_file(db, entry,NULL);
++ GFileInfo *info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+ if (info != NULL)
+ {
+- const char *mime_icon = thunar_vfs_mime_info_lookup_icon_name(info, icon_theme);
++ GIcon *mime_icon = g_content_type_get_icon (g_file_info_get_content_type (info));
+ if (mime_icon != NULL)
+ {
+- pixbuf = gtk_icon_theme_load_icon(icon_theme, mime_icon, ICON_SIZE, GTK_ICON_LOOKUP_USE_BUILTIN,NULL);
+- gtk_list_store_set(data->list, &iter, ICON_COL, pixbuf, -1);
++ GtkIconInfo *icon_info = gtk_icon_theme_lookup_by_gicon (icon_theme, mime_icon, ICON_SIZE, GTK_ICON_LOOKUP_USE_BUILTIN);
++ if (icon_info != NULL)
++ {
++ pixbuf = gtk_icon_info_load_icon (icon_info, NULL);
++ gtk_icon_info_free (icon_info);
++ gtk_list_store_set(data->list, &iter, ICON_COL, pixbuf, -1);
++ }
++ g_object_unref (mime_icon);
+ }
+- thunar_vfs_mime_info_unref(info);
+ }
+- g_object_unref(db);
+- thunar_vfs_path_unref(thunarPath);
+ }
++ g_object_unref(file);
+
+ //text
+ gtk_list_store_set(data->list, &iter, TEXT_COL, entry, -1);
+@@ -269,30 +269,31 @@
+
+ int linelight_get_result_section(LineLightData *data, char* result)
+ {
+- //TODO: remove thunar_vfs_info_unref(info); dups
+ if (result == NULL)
+ return -1;
+
+ remove_newline(result);
+
+- ThunarVfsPath *thunarPath = thunar_vfs_path_new (result,NULL);
+- ThunarVfsInfo *info = thunar_vfs_info_new_for_path(thunarPath,NULL);
+- thunar_vfs_path_unref(thunarPath);
++ GFile *file = g_file_new_for_path (result);
++ GFileInfo *info = g_file_query_info (file, "standard::*", G_FILE_QUERY_INFO_NONE, NULL, NULL);
++ g_object_unref(file);
+
+ if (info == NULL)
+ {
+ return -1;
+ }
+
+- if ((info->type != THUNAR_VFS_FILE_TYPE_REGULAR && info->type != THUNAR_VFS_FILE_TYPE_DIRECTORY) || info->flags & THUNAR_VFS_FILE_FLAGS_HIDDEN)
++ GFileType type = g_file_info_get_file_type (info);
++
++ if ((type != G_FILE_TYPE_REGULAR && type != G_FILE_TYPE_DIRECTORY) || g_file_info_get_is_hidden (info))
+ {
+- thunar_vfs_info_unref(info);
++ g_object_unref (info);
+ return -1;
+ }
+
+- if (info->type == THUNAR_VFS_FILE_TYPE_DIRECTORY)
++ if (type == G_FILE_TYPE_DIRECTORY)
+ {
+- thunar_vfs_info_unref(info);
++ g_object_unref (info);
+ return FOLDER_SECTION;
+ }
+
+@@ -302,7 +303,7 @@
+ path_lower = g_utf8_strdown(result,-1);
+ for (j = 0; j< SECTION_COUNT; j++)
+ {
+- for (i = 0; i < data->listSectionPaths[j]->len && info->type != THUNAR_VFS_FILE_TYPE_DIRECTORY; i++)
++ for (i = 0; i < data->listSectionPaths[j]->len && type != G_FILE_TYPE_DIRECTORY; i++)
+ {
+ ending = g_ptr_array_index(data->listSectionPaths[j], i);
+ path_ending = strrchr(path_lower,'.');
+@@ -310,7 +311,7 @@
+ if ( (path_ending != NULL && strcmp(path_ending, ending) == 0) ||
+ (path_begining != NULL && j == FILES_SECTION && strcmp(path_begining, path_lower) == 0))
+ {
+- thunar_vfs_info_unref(info);
++ g_object_unref (info);
+ free(path_lower);
+ return j;
+ }
+@@ -318,7 +319,7 @@
+ }
+
+ free(path_lower);
+- thunar_vfs_info_unref(info);
++ g_object_unref (info);
+
+ return -1;
+ }
+Index: panel-plugin/main.c
+===================================================================
+--- panel-plugin/main.c (revision 59)
++++ panel-plugin/main.c (working copy)
+@@ -28,7 +28,8 @@
+ #include <gdk/gdkkeysyms.h>
+ #include <gdk/gdk.h>
+
+-#include <thunar-vfs/thunar-vfs.h>
++#include <gio/gio.h>
++#include <gio/gdesktopappinfo.h>
+
+ #include <libxfcegui4/libxfcegui4.h>
+ #include <libxfce4panel/libxfce4panel.h>
+@@ -51,6 +49,7 @@
+ static void open_search_window_cb(GtkButton *button, XfcePanelPlugin* win);
+ static gboolean tree_selection (GtkWidget *widget, GdkEventKey *event, GtkWidget *tree);
+ static void cell_renderer (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *tree_model, GtkTreeIter *iter, gpointer data);
++static gboolean delete_event(GtkWidget *w, GdkEvent* event, gpointer user_data);
+
+ /*
+ * GUI Handling
+@@ -252,22 +251,33 @@
+
+ static void executeFile(char* path)
+ {
+- ThunarVfsPath *thunarPath;
+- ThunarVfsInfo *info;
++ GFile *file;
++ GFileInfo *info;
++ GAppInfo *app;
++ GDesktopAppInfo *desktop_app;
++ GList *fileList = NULL;
+
+- thunarPath = thunar_vfs_path_new (path,NULL);
+- if (thunarPath == NULL)
+- return;
++ file = g_file_new_for_path (path);
++ if (file == NULL)
++ return;
+
+- info = thunar_vfs_info_new_for_path(thunarPath,NULL);
++ info = g_file_query_info (file, G_FILE_ATTRIBUTE_STANDARD_CONTENT_TYPE, G_FILE_QUERY_INFO_NONE, NULL, NULL);
+ if (info == NULL)
++ {
++ g_object_unref (file);
+ return;
++ }
+
+ if (strstr(path,".desktop") != 0)
+ {
+- thunar_vfs_info_execute(info, NULL, NULL,NULL,NULL);
++ desktop_app = g_desktop_app_info_new_from_filename (path);
++ if (desktop_app != NULL)
++ {
++ g_app_info_launch (G_APP_INFO (desktop_app), NULL, NULL, NULL);
++ g_object_unref (desktop_app);
++ }
+ }
+- else if (info->type == THUNAR_VFS_FILE_TYPE_DIRECTORY)
++ else if (g_file_query_file_type (file, G_FILE_QUERY_INFO_NONE, NULL) == G_FILE_TYPE_DIRECTORY)
+ {
+ char command[strlen(path) + 10];
+ strcpy(command, "thunar \"");
+@@ -277,23 +287,17 @@
+ }
+ else
+ {
+- GList *pathList=NULL;
+- pathList = g_list_append(pathList,thunarPath);
++ fileList = g_list_append (fileList, file);
+
+- ThunarVfsMimeDatabase *db = thunar_vfs_mime_database_get_default();
+- ThunarVfsMimeInfo *info = thunar_vfs_mime_database_get_info_for_file(db, path,NULL);
+- ThunarVfsMimeApplication *app = thunar_vfs_mime_database_get_default_application(db,info);
++ app = g_app_info_get_default_for_type (g_file_info_get_content_type (info), FALSE);
+
+- thunar_vfs_mime_handler_exec (THUNAR_VFS_MIME_HANDLER(app),NULL, pathList, NULL);
++ g_app_info_launch (app, fileList, NULL, NULL);
+
+- g_object_unref(db);
+- thunar_vfs_mime_info_unref(info);
+ g_object_unref(app);
+- g_list_free(pathList);
++ g_list_free(fileList);
+ }
+- thunar_vfs_info_unref(info);
+- thunar_vfs_path_unref(thunarPath);
+-
++ g_object_unref (info);
++ g_object_unref (file);
+ }
+
+ void* show_all_search_results(void* arg)
+@@ -471,6 +475,12 @@
+ return FALSE;
+ }
+
++static gboolean delete_event(GtkWidget *w, GdkEvent* event, gpointer user_data)
++{
++ linelight_toggle_show_hide(linelight);
++ return TRUE;
++}
++
+ /*
+ * About Dialog
+ */
+@@ -559,7 +569,6 @@
+ static void clean_up_cb(XfcePanelPlugin *plugin, gpointer userdata)
+ {
+ save_data_cb(plugin, userdata);
+- thunar_vfs_shutdown();
+ linelight_free(linelight);
+ system("rm -r /tmp/xfce4-linelight/");
+ gdk_threads_leave ();
+@@ -746,8 +755,7 @@
+ int main (int argc, char *argv[])
+ {
+ g_type_init ();
+- thunar_vfs_init ();
+- //g_thread_init (NULL);
++ g_thread_init (NULL);
+ gdk_threads_init();
+ gdk_threads_enter();
+
+@@ -772,7 +780,6 @@
+
+
+ gtk_main ();
+- thunar_vfs_shutdown();
+ gdk_threads_leave ();
+ return 0;
+ }
+@@ -780,9 +787,8 @@
+ // callback for xfce panel (executed on plugin addition)
+ static void plugin_create(XfcePanelPlugin *plugin)
+ {
+- g_type_init ();
+- thunar_vfs_init ();
+- //g_thread_init (NULL);
++ g_type_init ();
++ g_thread_init (NULL);
+ gdk_threads_init();
+ gdk_threads_enter();
+
+@@ -813,6 +819,7 @@
+ GtkListStore *list = gtk_list_store_new(NUM_COLUMS,GDK_TYPE_PIXBUF, G_TYPE_STRING);
+ linelight = linelight_new(text_window, list);
+ gtk_container_add(GTK_CONTAINER(text_window), create_windows_content(list));
++ g_signal_connect(text_window, "delete-event", G_CALLBACK(delete_event), NULL);
+
+ load_data(plugin,linelight);
+ linelight_clear_list(linelight);
+Index: panel-plugin/Makefile.am
+===================================================================
+--- panel-plugin/Makefile.am (revision 59)
++++ panel-plugin/Makefile.am (working copy)
+@@ -13,7 +13,8 @@
+ -DPACKAGE_LOCALE_DIR=\"$(localedir)\" \
+ $(LIBXFCEGUI4_CFLAGS) \
+ $(LIBXFCE4PANEL_CFLAGS) \
+- $(LIBTHUNAR_VFS_CFLAGS) \
++ $(LIBGIO_CFLAGS) \
++ $(LIBGIOUNIX_CFLAGS) \
+ $(LIBGTK_CFLAGS) \
+ $(LIBGTHREADS_CFLAGS)
+
+@@ -21,7 +22,8 @@
+ xfce4_linelight_plugin_LDFLAGS = \
+ $(LIBXFCEGUI4_LIBS) \
+ $(LIBXFCE4PANEL_LIBS) \
+- $(LIBTHUNAR_VFS_LIBS) \
++ $(LIBGIO_LIBS) \
++ $(LIBGIOUNIX_LIBS) \
+ $(LIBGTK_LIBS) \
+ $(LIBGTHREADS_LIBS)
+
================================================================
---- CVS-web:
http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/xfce4-linelight-plugin/xfce4-linelight-plugin.spec?r1=1.4&r2=1.5&f=u
More information about the pld-cvs-commit
mailing list