[kde-plasma-yawp] - patch for KDE4.5

Orcan Ogetbil oget at fedoraproject.org
Wed Sep 8 03:50:42 UTC 2010


commit a6d44eb2947fd8f8dbf100caff54bc91eae92dec
Author: Orcan Ogetbil <oget.fedora at gmail.com>
Date:   Tue Sep 7 23:50:47 2010 -0400

    - patch for KDE4.5

 kde-plasma-yawp.spec |    8 ++-
 yawp-kde4.5.patch    |  224 ++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 231 insertions(+), 1 deletions(-)
---
diff --git a/kde-plasma-yawp.spec b/kde-plasma-yawp.spec
index 82b905c..d756221 100644
--- a/kde-plasma-yawp.spec
+++ b/kde-plasma-yawp.spec
@@ -1,11 +1,13 @@
 Name:           kde-plasma-yawp
 Version:        0.3.4
-Release:        1%{?dist}
+Release:        2%{?dist}
 Summary:        Yet Another Weather Plasmoid
 Group:          User Interface/Desktops
 License:        GPLv2+
 URL:            http://www.kde-look.org/content/show.php?content=94106
 Source0:        http://downloads.sourceforge.net/yawp/yawp-%{version}.tar.bz2
+# To build against KDE4.5. From upstream trunk
+Patch0:         yawp-kde4.5.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -21,6 +23,7 @@ This colorful plasmoid shows weather maps, reports and forecasts.
 
 %prep
 %setup -q -n yawp-%{version}
+%patch0 -p1 .kde45
 
 
 %build
@@ -58,6 +61,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Tue Sep 07 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.3.4-2
+- patch for KDE4.5
+
 * Sat Jul 10 2010 Orcan Ogetbil <oget [DOT] fedora [AT] gmail [DOT] com> - 0.3.4-1
 - new version
 
diff --git a/yawp-kde4.5.patch b/yawp-kde4.5.patch
new file mode 100644
index 0000000..6b0ab78
--- /dev/null
+++ b/yawp-kde4.5.patch
@@ -0,0 +1,224 @@
+diff -rupN yawp-0.3.4.old/applet/configdialog/yawpconfig.cpp yawp.trunk/applet/configdialog/yawpconfig.cpp
+--- yawp-0.3.4.old/applet/configdialog/yawpconfig.cpp	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/applet/configdialog/yawpconfig.cpp	2010-07-17 14:03:25.000000000 -0400
+@@ -135,7 +135,7 @@ YawpConfigDialog::YawpConfigDialog( KCon
+ 	connect(checkBoxUseCustomColor,		SIGNAL(stateChanged(int)),	this,  SLOT(enableCustomFontColorOptions(int)));
+ 
+ 	//--- SETUP UNIT SYSTEM ---
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 	comboTemperature->insertItem( 0, i18n("Celsius"),	QVariant(KUnitConversion::Celsius) );
+ 	comboTemperature->insertItem( 1, i18n("Fahrenheit"),	QVariant(KUnitConversion::Fahrenheit) );
+ 
+@@ -149,7 +149,11 @@ YawpConfigDialog::YawpConfigDialog( KCon
+ 	comboPressure->insertItem( 1, i18n("Inches HG"),	QVariant(KUnitConversion::InchesOfMercury) );
+ 	comboPressure->insertItem( 2, i18n("Millibars"),	QVariant(KUnitConversion::Millibar) );
+ 	comboPressure->insertItem( 3, i18n("Hectopascals"),	QVariant(KUnitConversion::Hectopascal) );
++#if KDE_IS_VERSION(4,4,92)
++	comboPressure->insertItem( 4, i18n("Millimeters HG"),	QVariant(KUnitConversion::MillimetersOfMercury) );
++#else
+ 	comboPressure->insertItem( 4, i18n("Torr (Millimeter HG)"),	QVariant(KUnitConversion::Torr) );
++#endif
+ 
+ 	comboDistance->insertItem( 3, i18n("Kilometers"),	QVariant(KUnitConversion::Kilometer) );
+ 	comboDistance->insertItem( 4, i18n("Miles"),		QVariant(KUnitConversion::Mile) );
+diff -rupN yawp-0.3.4.old/applet/utils.h yawp.trunk/applet/utils.h
+--- yawp-0.3.4.old/applet/utils.h	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/applet/utils.h	2010-07-17 05:59:27.000000000 -0400
+@@ -53,7 +53,7 @@ namespace Utils
+ 	inline QString
+ 	GetUnitString( int unit )
+ 	{
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 		KUnitConversion::Value v(1.0, unit);
+ 		QString str = v.unit()->symbol();
+ #else
+@@ -77,4 +77,4 @@ namespace Utils
+ 	}
+ };
+ 
+-#endif // UTILS_H
+\ No newline at end of file
++#endif // UTILS_H
+diff -rupN yawp-0.3.4.old/applet/weatherdataprocessor.cpp yawp.trunk/applet/weatherdataprocessor.cpp
+--- yawp-0.3.4.old/applet/weatherdataprocessor.cpp	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/applet/weatherdataprocessor.cpp	2010-07-20 16:46:15.000000000 -0400
+@@ -39,7 +39,7 @@
+ #include <KTimeZones>
+ #include <KSystemTimeZones>
+ 
+-#if KDE_IS_VERSION(4,3,70)
++#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
+ 	#include <KUnitConversion/Value>
+ #endif
+ 
+@@ -643,7 +647,7 @@ WeatherDataProcessor::Private::convertDi
+ 
+ 	if( fromSystem != distanceSystem )
+ 	{
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 		KUnitConversion::Value v( (double) fValue, fromSystem);
+ 		fValue = v.convertTo(distanceSystem).number();
+ #elif KDE_VERSION_MINOR == 3
+@@ -664,7 +668,7 @@ WeatherDataProcessor::Private::convertPr
+ 		return SHRT_MAX;
+ 	if( fromSystem != pressureSystem )
+ 	{
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 		KUnitConversion::Value v( (double) fValue, fromSystem);
+ 		fValue = v.convertTo(pressureSystem).number();
+ #elif KDE_VERSION_MINOR >= 3
+@@ -687,7 +691,7 @@ WeatherDataProcessor::Private::convertTe
+ 
+ 	if( fromSystem != temperatureSystem )
+ 	{
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 		KUnitConversion::Value v( (double) fValue, fromSystem);
+ 		fValue = v.convertTo(temperatureSystem).number();
+ #elif KDE_VERSION_MINOR >= 3
+@@ -709,7 +713,7 @@ WeatherDataProcessor::Private::convertSp
+ 
+ 	if( fromSystem != speedSystem )
+ 	{
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 		KUnitConversion::Value v( (double) fValue, fromSystem);
+ 		fValue = v.convertTo(speedSystem).number();
+ #elif KDE_VERSION_MINOR >= 3
+diff -rupN yawp-0.3.4.old/ions/ion_accuweather.cpp yawp.trunk/ions/ion_accuweather.cpp
+--- yawp-0.3.4.old/ions/ion_accuweather.cpp	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/ions/ion_accuweather.cpp	2010-08-08 16:04:49.000000000 -0400
+@@ -31,6 +50,7 @@
+ //--- KDE4 ---
+ #include <Plasma/DataContainer>
+ #include <KDateTime>
++#include <kdeversion.h>
+ 
+ #define TAG_TEMP		1
+ #define	TAG_SPEED		2
+@@ -56,6 +76,10 @@ struct AccuWeatherIon::Private
+ 	//--- Image jobs ---
+ 	QHash<QByteArray, ImageData *>    vImageData;	// Satellite url is the key to the ImageData
+ 	QHash<KJob *,  ImageData *>       vImageJobs;
++	
++#if KDE_IS_VERSION(4,5,60)
++	QStringList                       sourcesToReset;
++#endif
+ };
+ 
+ AccuWeatherIon::AccuWeatherIon( QObject * parent, const QVariantList & args )
+@@ -232,9 +256,13 @@ AccuWeatherIon::reset()
+ 	
+ 	d->vActiveJobs.clear();
+ 
+-#if KDE_VERSION_MINOR >= 3
+-	/**  Triggered when we get initial setup data for ions that provide a list of places */
+-    emit(resetCompleted(this, true));
++	/**  Triggered when we get initial setup data for ions that provide a list of places
++	*/
++#if KDE_IS_VERSION(4,5,60)
++	d->sourcesToReset = sources();
++	updateAllSources();
++#elif KDE_VERSION_MINOR >= 3
++	emit(resetCompleted(this, true));
+ #endif
+ 	dEndFunct();
+ }
+diff -rupN yawp-0.3.4.old/ions/ion_google.cpp yawp.trunk/ions/ion_google.cpp
+--- yawp-0.3.4.old/ions/ion_google.cpp	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/ions/ion_google.cpp	2010-08-08 16:04:49.000000000 -0400
+@@ -30,6 +49,7 @@
+ //--- KDE4 ---
+ #include <KDateTime>
+ #include <KSystemTimeZones>
++#include <kdeversion.h>
+ 
+ const QString GoogleIon::IonName("google");
+ const QString GoogleIon::ActionValidate("validate");
+@@ -79,6 +99,10 @@ struct GoogleIon::Private
+ 	QHash<KJob *, XmlServiceData *>     vJobData;
+ 	QHash<QString, KJob *>              vActiveJobs;
+ 	
++#if KDE_IS_VERSION(4,5,60)
++	QStringList                         sourcesToReset;
++#endif
++	
+ 	QString getNodeValue( const QXmlStreamReader & xml ) const;
+ 	QString createLocationString( const QString & sCityTag, const QString & sPostalTag ) const;
+ 	
+@@ -207,9 +230,12 @@ GoogleIon::reset()
+ 	d->vJobData.clear();
+ 	d->vActiveJobs.clear();
+ 
+-#if KDE_VERSION_MINOR >= 3
+ 	/**  Triggered when we get initial setup data for ions that provide a list of places */
+-    emit(resetCompleted(this, true));
++#if KDE_IS_VERSION(4,5,60)
++	d->sourcesToReset = sources();
++	updateAllSources();
++#elif KDE_VERSION_MINOR >= 3
++	emit(resetCompleted(this, true));
+ #endif
+ }
+ 
+diff -rupN yawp-0.3.4.old/ions/ion_wunderground.cpp yawp.trunk/ions/ion_wunderground.cpp
+--- yawp-0.3.4.old/ions/ion_wunderground.cpp	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/ions/ion_wunderground.cpp	2010-08-08 16:04:49.000000000 -0400
+@@ -33,6 +52,7 @@
+ #include <KLocale>
+ #include <KDateTime>
+ #include <KSystemTimeZones>
++#include <kdeversion.h>
+ 
+ const QString WundergroundIon::IonName("wunderground");
+ const QString WundergroundIon::ActionValidate("validate");
+@@ -120,6 +137,10 @@ struct WundergroundIon::Private
+	QHash<KJob *,  XmlServiceData *>    vServiceJobs;	// contains all running jobs
+	QHash<QString, XmlLookupResult *>   vLookupResults;	// key is the location we're looking for
+	QHash<QString, XmlWeatherData *>    vWeatherData;	// key is ServiceId (e.g.: airport:EDDC)
++	
++#if KDE_IS_VERSION(4,5,60)
++	QStringList                       sourcesToReset;
++#endif
+ 	
+ 	void setup_readStation( const QString & sLocation,
+ 	                        const WeatherStationType type,
+@@ -213,8 +237,11 @@ WundergroundIon::reset()
+ 	}
+ 	d->vWeatherData.clear();
+ 
+-#if KDE_VERSION_MINOR >= 3
+ 	/**  Triggered when we get initial setup data for ions that provide a list of places */
++#if KDE_IS_VERSION(4,5,60)
++	d->sourcesToReset = sources();
++	updateAllSources();
++#elif KDE_VERSION_MINOR >= 3
+ 	emit(resetCompleted(this, true));
+ #endif
+ 	dEndFunct();
+@@ -782,7 +809,7 @@ WundergroundIon::updateWeatherSource( co
+ 	}
+ 
+ 	int iTempSystem(0), iSpeedSystem(0), iDistanceSystem(0), iPressureSystem(0);
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 	if( data.measureSystem == KLocale::Metric )
+ 	{
+ 		iTempSystem = KUnitConversion::Celsius;
+diff -rupN yawp-0.3.4.old/ions/units.h yawp.trunk/ions/units.h
+--- yawp-0.3.4.old/ions/units.h	2010-07-07 14:42:28.000000000 -0400
++++ yawp.trunk/ions/units.h	2010-07-17 05:59:27.000000000 -0400
+@@ -25,8 +25,7 @@
+ #include <kdeversion.h>
+ 
+ 
+-//#if KDE_IS_VERSION(4,3,70)
+-#if (KDE_VERSION_MINOR == 3 && KDE_VERSION_RELEASE >= 70) || KDE_VERSION_MINOR == 4
++#if KDE_IS_VERSION(4,3,70)
+ 	#include <KUnitConversion/Converter>
+ 	#define FAHRENHEIT KUnitConversion::Fahrenheit
+ 	#define CELSIUS KUnitConversion::Celsius


More information about the scm-commits mailing list