rpms/wp_tray/FC-5 wp_tray-0.5.1-miscfixes.patch, NONE, 1.1 wp_tray-0.5.1-search.patch, NONE, 1.1 wp_tray-0.5.1-thumbs.patch, NONE, 1.1 wp_tray.spec, 1.3, 1.4 wp_tray-0.5.1-paths.patch, 1.1, NONE

Denis Leroy (denis) fedora-extras-commits at redhat.com
Mon Sep 11 11:38:39 UTC 2006


Author: denis

Update of /cvs/extras/rpms/wp_tray/FC-5
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9928

Modified Files:
	wp_tray.spec 
Added Files:
	wp_tray-0.5.1-miscfixes.patch wp_tray-0.5.1-search.patch 
	wp_tray-0.5.1-thumbs.patch 
Removed Files:
	wp_tray-0.5.1-paths.patch 
Log Message:
Added bug fix patches:
- Fixed vertical toolbar thumbs
- Fixed crash with small image
- Fixed gconf directory warnings
- Fixed occasional false eror on exit
- Fixed crash with paths containing spaces
- Fixed crash with non-existant directory
- Search for substring rather than absolute name
- Empty search defaults as select all
- Fixed crash with incorrect search regex
- Added dialog for no search results case


wp_tray-0.5.1-miscfixes.patch:

--- NEW FILE wp_tray-0.5.1-miscfixes.patch ---
--- wp_tray-0.5.1/src/applet.cc.orig	2006-09-10 15:05:32.000000000 +0200
+++ wp_tray-0.5.1/src/applet.cc	2006-09-11 10:24:21.000000000 +0200
@@ -91,7 +91,7 @@
 	// set up the gconf client
 	m_ref_gconf_client = Gnome::Conf::Client::get_default_client();
 
-	m_ref_gconf_client->add_dir("/apps/wp_tray/");
+	m_ref_gconf_client->add_dir("/apps/wp_tray");
 
 	// add our directory to the list of directories the GConfClient will watch
 	m_ref_gconf_client->add_dir("/desktop/gnome/background");
--- wp_tray-0.5.1/src/main.cc.orig	2006-09-10 15:05:32.000000000 +0200
+++ wp_tray-0.5.1/src/main.cc	2006-09-11 10:04:47.000000000 +0200
@@ -61,4 +61,5 @@
 	{
 		std::cerr << ex.what() << std::endl;
 	}
+	return 0;
 }
--- wp_tray-0.5.1/src/wallpapers.cc.orig	2006-09-10 15:05:32.000000000 +0200
+++ wp_tray-0.5.1/src/wallpapers.cc	2006-09-10 16:25:03.000000000 +0200
@@ -12,14 +12,17 @@
 #include <cstdlib>
 #include "boost/filesystem/exception.hpp"
 
+bool name_check_yes(const std::string&) { return true; }
+
 // definitions //
 //
 c_wallpapers::c_wallpapers				()
 {
+    boost::filesystem::path::default_name_check(name_check_yes);
 	// set up the gconf client
 	m_ref_gconf_client = Gnome::Conf::Client::get_default_client();
 
-	m_ref_gconf_client->add_dir("/apps/wp_tray/");
+	m_ref_gconf_client->add_dir("/apps/wp_tray");
 
 	// seed random number generator
 	std::srand(std::time(NULL));
@@ -124,10 +127,10 @@
 {
 	fs::directory_iterator end_iter;
 
-	for(fs::directory_iterator dir_itr(path_current); dir_itr != end_iter; ++ dir_itr)
-	{
 		try
 		{
+	for(fs::directory_iterator dir_itr(path_current); dir_itr != end_iter; ++ dir_itr)
+	{
 			if(fs::is_directory(*dir_itr))
 			{
 				if(fs::symbolic_link_exists(*dir_itr))
@@ -151,11 +154,11 @@
 					++ n_file_count;
 			}// end else
 		}// end try
+	}// end for
 		catch(const std::exception & ex)
 		{
-			std::cerr << "c_wallpapers::count_entries_in_directory() : " << dir_itr->leaf() << " " << ex.what() << std::endl;
+			std::cerr << "c_wallpapers::count_entries_in_directory() : " << ex.what() << std::endl;
 		}// end catch
-	}// end for
 
 	return n_file_count;
 }// end c_wallpapers::count_directory_entries

wp_tray-0.5.1-search.patch:

--- NEW FILE wp_tray-0.5.1-search.patch ---
--- wp_tray-0.5.1/src/search_dialog.cc.orig	2006-09-10 15:05:32.000000000 +0200
+++ wp_tray-0.5.1/src/search_dialog.cc	2006-09-11 11:37:21.000000000 +0200
@@ -85,23 +85,39 @@
 {
 	std::list<Glib::ustring> ls_wp_dir, ls_results;
 
-	if(m_p_entry_search_string->get_text().length() == 0)
-		return false;
-	
 	ls_wp_dir = m_ref_gconf_client->get_string_list("/apps/wp_tray/dir_list");
 
+	boost::regex regex;
+	Glib::ustring rstring;
+
+	try {
+	    rstring += ".*";
+	    rstring += m_p_entry_search_string->get_text();
+	    rstring += ".*";
+	    regex = boost::regex(rstring.c_str(), boost::regex::perl | boost::regex::icase);
+	} catch (...) {
+	    Gtk::MessageDialog d(_("Incorrect regular expression.\n"
+				   "Please use Perl-style format."), false,
+				 Gtk::MESSAGE_ERROR, Gtk::BUTTONS_OK, true);
+	    d.run();
+	    return true;
+	}
+
 	// search each directory
 	for(std::list<Glib::ustring>::iterator it = ls_wp_dir.begin(); it != ls_wp_dir.end(); ++ it)
 	{
 		// do the boost regex search
 		// TODO: C string conversion is 'orrible :/
-		c_search_dialog::wallpaper_search	(
-			fs::path(*it),
-			boost::regex(m_p_entry_search_string->get_text().c_str(), boost::regex::icase),
-			ls_results
-		);
+		c_search_dialog::wallpaper_search(fs::path(*it), regex, ls_results);
 	}// end for
 
+	if (ls_results.size() == 0) {
+	    Gtk::MessageDialog d(_("\nNo wallpapers found."), false, Gtk::MESSAGE_INFO,
+				 Gtk::BUTTONS_OK, true);
+	    d.run();
+	    return true;
+	}
+
 	// clear list store
 	m_ref_liststore->clear();
 

wp_tray-0.5.1-thumbs.patch:

--- NEW FILE wp_tray-0.5.1-thumbs.patch ---
--- wp_tray-0.5.1/src/applet.cc.orig	2006-09-10 15:05:32.000000000 +0200
+++ wp_tray-0.5.1/src/applet.cc	2006-09-11 10:24:21.000000000 +0200
@@ -368,6 +368,15 @@
 {
 	Glib::RefPtr<Gdk::Pixbuf> gdk_pixbuf = Glib::RefPtr<Gdk::Pixbuf>();
 
+	int targetw, targeth;
+	if (c_applet::horizontal()) {
+	    targetw = (int)(c_applet::get_size() * 1.3);
+	    targeth = c_applet::get_size();
+	} else {
+	    targetw = c_applet::get_size();
+	    targeth = (int)(c_applet::get_size() * 0.77);
+	}
+
 	try
 	{
 		gdk_pixbuf = 
@@ -376,16 +385,9 @@
 	catch(...)
 	{
 		// bugger, slap a black square in there for now
-		if(c_applet::horizontal() == true)
-		{
-			gdk_pixbuf =
-			Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, 0, 8, static_cast<int>(c_applet::get_size() * 1.3f), c_applet::get_size());
-		}// end if
-		else
-		{
-			gdk_pixbuf =
-			Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, 0, 8, c_applet::get_size(), static_cast<int>(c_applet::get_size() * 1.3f));
-		}// end else
+	    gdk_pixbuf =
+		Gdk::Pixbuf::create(Gdk::COLORSPACE_RGB, 0, 8, targetw,
+				    targeth);
 
 		gdk_pixbuf->fill(0x000000ff);
 
@@ -396,24 +398,19 @@
 
 	Glib::RefPtr<Gdk::Pixbuf> gdk_pixbuf_scaled = Glib::RefPtr<Gdk::Pixbuf>();
 
-	if(c_applet::horizontal() == true)
-	{
-		gdk_pixbuf_scaled = 
-		Gnome::UI::thumbnail_scale_down_pixbuf(	gdk_pixbuf,
-							static_cast<int>(c_applet::get_size() * 1.3f),
-							c_applet::get_size());
-	}// end if
-	else
-	{
-		// PIXBUF_ROTATE_COUNTERCLOCKWISE
-		// PIXBUF_ROTATE_CLOCKWISE
-		/*
-		gdk_pixbuf_scaled = 
-		Gnome::UI::thumbnail_scale_down_pixbuf(	gdk_pixbuf_scaled->rotate_simple(Gnome::UI::PIXBUF_ROTATE_CLOCKWISE),
-							c_applet::get_size(),
-							static_cast<int>(c_applet::get_size() * 1.3f));
-		*/
-	}// end else
+	// Only scale down if we're sure the starting image is
+	// completely larger than the destination size (or it will
+	// abort).
+	if (gdk_pixbuf->get_width() < targetw ||
+	    gdk_pixbuf->get_height() < targeth) {
+	    gdk_pixbuf_scaled = gdk_pixbuf;
+	} else {
+
+	    gdk_pixbuf_scaled = 
+		Gnome::UI::thumbnail_scale_down_pixbuf(gdk_pixbuf,
+						       targetw,
+						       targeth);
+	}
 
 	m_gtk_image.set(gdk_pixbuf_scaled);
 }// end c_applet::render_thumbnail


Index: wp_tray.spec
===================================================================
RCS file: /cvs/extras/rpms/wp_tray/FC-5/wp_tray.spec,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- wp_tray.spec	14 Feb 2006 05:03:23 -0000	1.3
+++ wp_tray.spec	11 Sep 2006 11:38:39 -0000	1.4
@@ -1,13 +1,15 @@
 Name:           wp_tray
 Version:        0.5.1
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        A wallpaper-changing applet for GNOME
 
 Group:          Amusements/Graphics
 License:        GPL
 URL:            http://planetearthworm.com/projects/wp_tray/
 Source0:        http://planetearthworm.com/projects/wp_tray/files/%{name}-%{version}.tar.gz
-Patch:          wp_tray-0.5.1-paths.patch
+Patch0:         wp_tray-0.5.1-thumbs.patch
+Patch1:         wp_tray-0.5.1-search.patch
+Patch2:         wp_tray-0.5.1-miscfixes.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  gettext libglademm24-devel libgnomecanvasmm26-devel
@@ -19,7 +21,9 @@
 
 %prep
 %setup -q
-%patch -p 1 -b .paths
+%patch0 -p1 -b .thumbs
+%patch1 -p1 -b .search
+%patch2 -p1 -b .miscfixes
 
 %build
 %configure --with-boostfilesystem=%{_libdir}/libboost_filesystem.so \
@@ -64,6 +68,9 @@
 %{_sysconfdir}/gconf/schemas/*.schemas
 
 %changelog
+* Mon Sep 11 2006 Denis Leroy <denis at poolshark.org> - 0.5.1-3
+- Added patches to fix many bugs (see bug 205869)
+
 * Mon Feb 13 2006 Ignacio Vazquez-Abrams <ivazquez at ivazquez.net> 0.5.1-2
 - Rebuild for Fedora Extras 5
 


--- wp_tray-0.5.1-paths.patch DELETED ---




More information about the scm-commits mailing list