rpms/qt3/devel qt-x11-free-3.3.8b-sane_defaults.patch, NONE, 1.1 qtrc, NONE, 1.1 qt3.spec, 1.20, 1.21

Rex Dieter rdieter at fedoraproject.org
Tue Dec 22 23:46:48 UTC 2009


Author: rdieter

Update of /cvs/pkgs/rpms/qt3/devel
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv19173

Modified Files:
	qt3.spec 
Added Files:
	qt-x11-free-3.3.8b-sane_defaults.patch qtrc 
Log Message:
* Tue Dec 22 2009 Rex Dieter <rdieter at fedoraproject.org> - 3.3.8b-29
- sane defaults (#549820)


qt-x11-free-3.3.8b-sane_defaults.patch:
 qapplication.cpp     |   13 ++++++++++---
 qapplication_x11.cpp |   11 +++++++----
 2 files changed, 17 insertions(+), 7 deletions(-)

--- NEW FILE qt-x11-free-3.3.8b-sane_defaults.patch ---
diff -up qt-x11-free-3.3.8b/src/kernel/qapplication.cpp.sane_defaults qt-x11-free-3.3.8b/src/kernel/qapplication.cpp
--- qt-x11-free-3.3.8b/src/kernel/qapplication.cpp.sane_defaults	2008-01-15 13:09:13.000000000 -0600
+++ qt-x11-free-3.3.8b/src/kernel/qapplication.cpp	2009-12-22 14:00:19.078553429 -0600
@@ -1241,7 +1241,7 @@ QStyle& QApplication::style()
 #elif defined(Q_WS_X11) && defined(Q_OS_IRIX)
 	    style = "SGI";			// default style for X11 on IRIX
 #elif defined(Q_WS_X11)
-		style = "Motif";		// default style for X11
+		style = "Platinum";		// default style for X11
 #elif defined(Q_WS_MAC)
 		style = "Macintosh";		// default style for all Mac's
 #elif defined(Q_WS_QWS)
@@ -1250,8 +1250,8 @@ QStyle& QApplication::style()
 	}
 	app_style = QStyleFactory::create( style );
 	if ( !app_style &&		// platform default style not available, try alternatives
-	     !(app_style = QStyleFactory::create( "Windows" ) ) &&
 	     !(app_style = QStyleFactory::create( "Platinum" ) ) &&
+	     !(app_style = QStyleFactory::create( "Windows" ) ) &&
 	     !(app_style = QStyleFactory::create( "MotifPlus" ) ) &&
 	     !(app_style = QStyleFactory::create( "Motif" ) ) &&
 	     !(app_style = QStyleFactory::create( "CDE" ) ) &&
@@ -1731,6 +1731,13 @@ QStringList QApplication::libraryPaths()
 	    app_libpaths->append(installPathPlugins);
 	}
 
+ #if defined(Q_WS_X11)
+	QString kde3PathPlugins = QString("@@KDE3_PLUGIN_PATH@@");
+	if ( QFile::exists(kde3PathPlugins) ) {
+	    app_libpaths->append(kde3PathPlugins);
+	}
+#endif
+
 	QString app_location;
 	if (qApp)
 	    app_location = qApp->applicationFilePath();
@@ -1933,7 +1940,7 @@ QFont QApplication::font( const QWidget 
 	}
     }
     if ( !app_font ) {
-	app_font = new QFont( "Helvetica" );
+	app_font = new QFont( "Sans" );
 	Q_CHECK_PTR( app_font );
     }
     return *app_font;
diff -up qt-x11-free-3.3.8b/src/kernel/qapplication_x11.cpp.sane_defaults qt-x11-free-3.3.8b/src/kernel/qapplication_x11.cpp
--- qt-x11-free-3.3.8b/src/kernel/qapplication_x11.cpp.sane_defaults	2008-01-15 13:09:13.000000000 -0600
+++ qt-x11-free-3.3.8b/src/kernel/qapplication_x11.cpp	2009-12-22 13:54:58.335802790 -0600
@@ -953,8 +953,11 @@ bool QApplication::x11_apply_settings()
     // read new QStyle
     extern bool qt_explicit_app_style; // defined in qapplication.cpp
     QString stylename = settings.readEntry( "/qt/style" );
-    if ( !stylename.isEmpty() && !qt_explicit_app_style ) {
-	QApplication::setStyle( stylename );
+    if ( !qt_explicit_app_style ) {
+	if ( stylename.isEmpty() )
+	    QApplication::setStyle( QString("Platinum") );
+	else
+	    QApplication::setStyle( stylename );
 	// took the style from the user settings, so mark the explicit flag FALSE
 	qt_explicit_app_style = FALSE;
     }
@@ -2095,11 +2098,11 @@ void qt_init_internal( int *argcptr, cha
 	// At 95 DPI, a 12 point font should be 16 pixels tall - in which case a 17
 	// pixel font is a closer match than a 12 pixel font
 	int ptsz =
-	    (int) ( ( ( QPaintDevice::x11AppDpiY() >= 95 ? 17. : 12. ) *
+	    (int) ( ( ( QPaintDevice::x11AppDpiY() >= 95 ? 13. : 11. ) *
 		      72. / (float) QPaintDevice::x11AppDpiY() ) + 0.5 );
 
 	if ( !qt_app_has_font && !qt_x11_cmdline_font ) {
-	    QFont f( "Helvetica", ptsz );
+	    QFont f( "Sans", ptsz );
 	    QApplication::setFont( f );
 	}
 


--- NEW FILE qtrc ---
[3.3]
libraryPath=@@QTDIR@@/plugins:@@KDE3_PLUGIN_PATH@@

[General]
font=Sans,10,-1,0,50,0,0,0,0,0
style=Platinum


Index: qt3.spec
===================================================================
RCS file: /cvs/pkgs/rpms/qt3/devel/qt3.spec,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -p -r1.20 -r1.21
--- qt3.spec	10 Sep 2009 11:14:32 -0000	1.20
+++ qt3.spec	22 Dec 2009 23:46:48 -0000	1.21
@@ -2,8 +2,8 @@
 
 Summary: The shared library for the Qt 3 GUI toolkit
 Version: 3.3.8b
-Release: 28%{?dist}
 Name: qt3
+Release: 29%{?dist}
 Obsoletes: qt < 1:%{version}-%{release}
 Provides: qt = 1:%{version}-%{release}
 License: QPL or GPLv2 or GPLv3
@@ -42,6 +42,12 @@ Patch35: qt-3.3.6-fontrendering-ml_IN-21
 Patch37: qt-3.3.6-fontrendering-gu-228452.patch
 Patch38: qt-x11-free-3.3.8-odbc.patch
 Patch39: qt-x11-free-3.3.7-arm.patch
+# See http://bugzilla.redhat.com/549820
+# Try to set some sane defaults, for style, fonts, plugin path
+# FIXME: style doesn't work.  use kde3 plastik, if available
+Patch40: qt-x11-free-3.3.8b-sane_defaults.patch
+# and/or just use qtrc to do the same thing
+Source10: qtrc
 
 # immodule patches
 Patch50: qt-x11-immodule-unified-qt3.3.8-20071116.diff.bz2
@@ -304,6 +310,10 @@ for the Qt 3 toolkit.
 %ifarch armv5tel
 %patch39 -p1 -b .arm
 %endif
+%patch40 -p1 -b .sane_defaults
+sed -i.KDE3_PLUGIN_PATH \
+  -e "s|@@KDE3_PLUGIN_PATH@@|%{_libdir}/kde3/plugins|" \
+  src/kernel/qapplication.cpp
 
 # immodule patches
 %if %{immodule}
@@ -447,6 +457,12 @@ export QTDEST=%{qtdir}
 
 make install INSTALL_ROOT=%{buildroot}
 
+install -m644 -D %{SOURCE10} %{buildroot}%{qtdir}/etc/settings/qtrc
+sed -i \
+  -e "s|@@QTDIR@@|%{qtdir}|" \
+  -e "s|@@KDE3_PLUGIN_PATH@@|%{_libdir}/kde3/plugins|" \
+   %{buildroot}%{qtdir}/etc/settings/qtrc
+
 for i in findtr qt20fix qtrename140 lrelease lupdate ; do
    install bin/$i %{buildroot}%{qtdir}/bin/
 done
@@ -519,11 +535,14 @@ rm -rf %{buildroot}
 %doc FAQ LICENSE* README* changes*
 %dir %{qtdir}
 %dir %{qtdir}/bin
+%dir %{qtdir}/etc/
+%dir %{qtdir}/etc/settings/
 %dir %{qtdir}/lib
 %dir %{qtdir}/plugins
 %dir %{qtdir}/plugins/sqldrivers
 %dir %{qtdir}/plugins/styles
-%{qtdir}/translations
+%config %{qtdir}/etc/settings/qtrc
+%{qtdir}/translations/
 %{qtdir}/plugins/designer/
 %if %{immodule}
 %{qtdir}/plugins/inputmethods
@@ -600,6 +619,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Tue Dec 22 2009 Rex Dieter <rdieter at fedoraproject.org> - 3.3.8b-29
+- sane defaults (#549820)
+
 * Thu Sep 10 2009 Than Ngo <than at redhat.com> - 3.3.8b-28
 - drop support fedora < 10
 




More information about the scm-commits mailing list