[kde-plasma-yawp] fix geometry settings (#754407)

nucleo nucleo at fedoraproject.org
Wed Nov 16 17:58:01 UTC 2011


commit a534fe0ee258cc9edbacffcaa3b2de51845754ad
Author: nucleo <nucleo at fedoraproject.org>
Date:   Wed Nov 16 19:57:57 2011 +0200

    fix geometry settings (#754407)

 kde-plasma-yawp-fix-geometry.patch |  542 ++++++++++++++++++++++++++++++++++++
 kde-plasma-yawp.spec               |    9 +-
 2 files changed, 550 insertions(+), 1 deletions(-)
---
diff --git a/kde-plasma-yawp-fix-geometry.patch b/kde-plasma-yawp-fix-geometry.patch
new file mode 100644
index 0000000..c1f5295
--- /dev/null
+++ b/kde-plasma-yawp-fix-geometry.patch
@@ -0,0 +1,542 @@
+Index: applet/yawp.cpp
+===================================================================
+--- applet/yawp.cpp	(revision 483)
++++ applet/yawp.cpp	(revision 484)
+@@ -99,7 +99,7 @@
+ 	WeatherDataProcessor * pDataProcessor = new WeatherDataProcessor( &m_storage );
+ 	m_pWeatherModel = new WeatherServiceModel( &m_storage, this, pDataProcessor );
+ 	m_pWeatherModel->setObjectName("EngineModel");
+-	
++
+ 	m_stateMachine.setServiceModel( m_pWeatherModel );
+ 
+ 	//--- Set Default Configuration Values ---
+@@ -150,7 +150,7 @@
+ 		#endif
+ 	#endif
+ 	}
+-	
++
+ 	m_configData.todaysWeatherPanelFormat	= Yawp::PanelTemperature | Yawp::PanelIcon;
+ 	m_configData.forecastWeatherPanelFormat	= Yawp::PanelTemperature | Yawp::PanelIcon;
+ 	m_configData.iPanelForecastDays = 3;
+@@ -167,7 +167,7 @@
+ 	m_configData.bUseCompactPanelLayout = false;
+ 	m_configData.bUseExtendedTooltip = true;
+ 	m_configData.extendedTooltipOptions = Yawp::PreviewPage | Yawp::SatellitePage;
+-	
++
+ 	m_configData.bTraverseLocationsPeriodically = false;
+ 	m_configData.iTraverseLocationTimeout = 30;
+ 
+@@ -179,7 +179,7 @@
+ 		<< Yawp::Visibility
+ 		<< Yawp::Dewpoint
+ 		<< Yawp::UV;
+-		
++
+ 	// Contextual actions - thanks to Ezequiel, ported from stdin plasmoid :-)
+ 	m_pManualUpdate = new QAction ( i18n ("&Refresh"), this );
+ 	m_pManualUpdate->setIcon ( KIcon ( "view-refresh" ) );
+@@ -208,7 +208,7 @@
+ 	m_actions.append( separator1 );
+ 	m_actions.append( m_pCitySubMenu );
+ 	m_actions.append( separator2 );
+-	
++
+ 	/*** About data ***/
+ 	m_aboutData = new KAboutData ( "plasma_yawp",
+ 		QByteArray (), ki18n( YAWP_NAME ), YAWP_VERSION_STRING,
+@@ -286,7 +286,7 @@
+ 	setHasConfigurationInterface(true);
+ 	setAspectRatioMode(Plasma::KeepAspectRatio);
+ 	setPassivePopup(true);
+-	
++
+ 	dEndFunct();
+ }
+ 
+@@ -294,9 +294,9 @@
+ {
+ 	dStartFunct();
+ 	Plasma::ToolTipManager::self()->clearContent(this);
+-	
++
+ 	destroyExtenderItem();
+-	
++
+ 	if (hasFailedToLaunch())
+ 	{
+ 		// Do some cleanup here
+@@ -306,13 +306,13 @@
+ 		// Save settings
+ 		saveConfig();
+ 	}
+-	
++
+ 	if (m_pAppletPainter != 0)
+ 		delete m_pAppletPainter;
+-	
++
+ 	delete m_pWeatherModel;
+ 	delete m_aboutData;
+-	
++
+ 	dEndFunct();
+ }
+ 
+@@ -326,7 +326,7 @@
+ 	loadConfig();
+ 	loadCustomTheme();
+ 	initAppletPainter();
+-	resize( m_pAppletPainter->getSize(QSize()) );
++	resize( m_pAppletPainter->getSize(QSize(contentsRect().width(), contentsRect().height())) );
+ 
+ 	//--- just 4 debug ---
+ /*	CityWeather dummyCity1;
+@@ -347,25 +347,25 @@
+ 	dummyCity2.setTimeZone("Asia/Shanghai");
+ 	m_pWeatherModel->addCity(dummyCity2);
+ 	//--- end of debug section ---
+-*/	
++*/
+ 	updateCitySubMenu();
+ 	setCityIndex( m_configData.iCityIndex );
+ 
+ 	const bool bHasCities = (m_pWeatherModel->rowCount() > 0);
+ 	m_pManualUpdate->setEnabled( bHasCities );
+ 	m_pCitySubMenu->setEnabled( bHasCities);
+-	
++
+ 	if (bHasCities)
+ 		m_iIdPendingEngineConnection = startTimer( m_configData.iStartDelay*60*1000 );
+ 	else
+ 		QTimer::singleShot(0, this, SLOT(slotConfigurationRequired()) );
+-	
++
+ 	startTraverseLocationTimeout();
+-	
++
+ 	// Every 5 days, 15 minutes after start of applet, cache directory will be checked to remove old files.
+ 	if (QDate::currentDate().dayOfYear() % 5 == 0)
+ 		QTimer::singleShot(15*60*1000, this, SLOT(slotStartCacheCleanUp()) );
+-	
++
+ 	dEndFunct();
+ }
+ 
+@@ -491,7 +491,7 @@
+ 			cityInfo.setCountry(     QUrl::fromPercentEncoding(lst.at(2).toUtf8()) );
+ 			cityInfo.setCountryCode( QUrl::fromPercentEncoding(lst.at(3).toUtf8()) );
+ 			cityInfo.setExtraData(   QUrl::fromPercentEncoding(lst.at(4).toUtf8()) );
+-			
++
+ 			if( lst.count() > 5 )
+ 				cityInfo.setTimeZone( QUrl::fromPercentEncoding(lst.at(5).toUtf8()) );
+ 			if( !cityInfo.timeZone().isValid() )
+@@ -502,10 +502,10 @@
+ 			}
+ 			if( cityInfo.countryCode().isEmpty() && cityInfo.timeZone().isValid() )
+ 				cityInfo.setCountryCode( cityInfo.timeZone().countryCode() );
+-			
++
+ 			dDebug() << cityInfo.provider() << cityInfo.city() << cityInfo.country() << cityInfo.countryCode()
+ 			         << cityInfo.extraData() << cityInfo.timeZone().name() << cityInfo.timeZone().countryCode();
+-			
++
+ 			m_pWeatherModel->addCity( cityInfo );
+ 
+ 			iCityIndex += 1;
+@@ -528,7 +528,7 @@
+ 	cfg.writeEntry( "start delay",				(int)m_configData.iStartDelay );
+ 	cfg.writeEntry( "traverse locations",		m_configData.bTraverseLocationsPeriodically );
+ 	cfg.writeEntry( "traverse locations timeout",	m_configData.iTraverseLocationTimeout );
+-	
++
+ 	cfg.writeEntry( "system.distance",          (int)m_configData.distanceSystem );
+ 	cfg.writeEntry( "system.pressure",          (int)m_configData.pressureSystem );
+ 	cfg.writeEntry( "system.temperature",		(int)m_configData.temperatureSystem );
+@@ -615,11 +615,11 @@
+ YaWP::constraintsEvent(Plasma::Constraints constraints)
+ {
+ 	dStartFunct();
+-	
++
+ 	if (constraints.testFlag(Plasma::FormFactorConstraint))
+ 	{
+ 		initAppletPainter();
+-		
++
+ 		if (m_pAppletPainter->formFactor() == Plasma::Planar)
+ 		{
+ 			if (m_configData.sBackgroundName == QLatin1String("default") &&
+@@ -632,7 +632,7 @@
+ 			{
+ 				setBackgroundHints(NoBackground);
+ 			}
+-			
++
+ 		}
+ 		else if (m_pAppletPainter->formFactor() == Plasma::Horizontal)
+ 		{
+@@ -644,7 +644,7 @@
+ 			// no backround in vertical panel mode
+ 			setBackgroundHints(NoBackground);
+ 		}
+-		
++
+ 		updateSize();
+ 	}
+ 	if (constraints.testFlag(Plasma::SizeConstraint))
+@@ -662,12 +662,12 @@
+ YaWP::updateSize()
+ {
+ 	QSize sizeHint = m_pAppletPainter->getSize(size());
+-	
++
+ 	if (formFactor() == Plasma::Horizontal)
+ 	{
+ 		setMinimumHeight(0);
+ 		setMaximumHeight(QWIDGETSIZE_MAX);
+-	
++
+ 		setMinimumWidth(sizeHint.width());
+ 		setMaximumWidth(sizeHint.width());
+ 	}
+@@ -685,7 +685,7 @@
+ 		setMaximumWidth(QWIDGETSIZE_MAX);
+ 		setMinimumHeight(30);
+ 		setMaximumHeight(QWIDGETSIZE_MAX);
+-		
++
+ 		resize(sizeHint);
+ 	}
+ }
+@@ -773,11 +773,11 @@
+ 		// handle this events. Therefore there is no way for the user to hide the popup manual,
+ 		// unless user is adding at least one city to the applet.
+ 		hidePopup();
+-		
++
+ 		// remove current tooltip
+ 		Plasma::ToolTipManager::self()->clearContent(this);
+ 	}
+-	
++
+ 	// to make sure we will change the theme
+ 	constraintsEvent( Plasma::FormFactorConstraint | Plasma::SizeConstraint );
+ 	initAppletPainter();
+@@ -797,19 +797,19 @@
+ 	{
+ 		return;
+ 	}
+-	
++
+ 	// every time user interacts with this plasmoid, we reset the timer
+ 	// to automatically switch to next location
+ 	stopTraverseLocationTimeout();
+ 
+ 	event->setAccepted(false);
+-	
++
+ 	if (m_pAppletPainter->formFactor() == Plasma::Planar ||
+ 	    m_configData.bUseInteractivePanelWeatherIcons)
+ 	{
+ 		m_pAppletPainter->mousePressEvent(event);
+ 	}
+-	
++
+ 	if (!event->isAccepted() && m_pAppletPainter->formFactor() != Plasma::Planar)
+ 		togglePopup();
+ 
+@@ -829,7 +829,7 @@
+ 	else if (event->timerId() == m_iIdTraverseLocations)
+ 	{
+ 		stopTraverseLocationTimeout();
+-		
++
+ 		int iSelectedCityIndex = (m_configData.iCityIndex + 1) % m_pWeatherModel->rowCount();
+ 		m_pAppletPainter->initCityChangeAnimation(iSelectedCityIndex);
+ 	}
+@@ -842,13 +842,13 @@
+ 	dStartFunct();
+ 	stopPendingEngineConnection();
+ 	const CityWeather * const pCity = m_stateMachine.currentCity();
+-	
++
+ 	if(!pCity)
+ 	{
+ 		dEndFunct();
+ 		return;
+ 	}
+-	
++
+ 	if( updateType.testFlag(WeatherServiceModel::CityInfoUpdate) )
+ 	{
+ 		updateCitySubMenu();
+@@ -859,7 +859,7 @@
+ 	//--- update the paneltooltip when we are in panel mode only ---
+ 	if (m_pAppletPainter->formFactor() != Plasma::Planar)
+ 		createPanelTooltip();
+-	
++
+ 	m_pAppletPainter->update();
+ 	dEndFunct();
+ }
+@@ -904,7 +904,7 @@
+ 	m_stateMachine.setCurrentCityIndex( cityIndex );
+ 	m_configData.iCityIndex = m_stateMachine.currentCityIndex();
+ 	const CityWeather * city = m_stateMachine.currentCity();
+-	
++
+ 	if (city)
+ 	{
+ 		//--- select the right menuitem in the city-submenu ---
+@@ -912,7 +912,7 @@
+ 		int iCityIndex = m_stateMachine.currentCityIndex();
+ 		if (list.count() > iCityIndex)
+ 			list.at(iCityIndex )->setChecked( true );
+-		
++
+ 		//--- update the paneltooltip when we are in panel mode only ---
+ 		if (m_pAppletPainter->formFactor() != Plasma::Planar)
+ 			createPanelTooltip();
+@@ -931,7 +931,7 @@
+ YaWP::slotThemeChanged()
+ {
+ 	setDefaultFontColors();
+-	
++
+ 	if (m_pAppletPainter->formFactor() != Plasma::Planar)
+ 		createPanelTooltip();
+ }
+@@ -946,10 +946,10 @@
+ 		QDir::NoSort,
+ 		QDir::Files | QDir::NoSymLinks | QDir::Writable);
+ 	QFileInfoList cacheFiles = cacheDir.entryInfoList();
+-	
++
+ 	const QDateTime currentDateTime = QDateTime::currentDateTime();
+ 	KUrl::List selectedCacheFiles;
+-	
++
+ 	foreach(QFileInfo info, cacheFiles)
+ 	{
+ 		// When file is older than five days, we add it to the list of files that will be removed.
+@@ -963,7 +963,7 @@
+ 			dTracing() << "Keeping file" << info.absoluteFilePath();
+ 		}
+ 	}
+-	
++
+ 	// Start job to remove selected files. We hide the progress information,
+ 	// because we do not want to bother the user with this stuff.
+ 	if (selectedCacheFiles.count() > 0)
+@@ -1022,7 +1022,7 @@
+ 		action->setData( QVariant(i) );
+ 		m_pGrpActionCities->addAction( action );
+ 		m_pCitySubMenu->addAction( action );
+-		
++
+ 		if( i == m_configData.iCityIndex )
+ 			action->setChecked( true );
+ 	}
+@@ -1033,7 +1033,7 @@
+ YaWP::initAppletPainter()
+ {
+ 	const Plasma::FormFactor form = formFactor();
+-	
++
+ 	if (m_pAppletPainter == 0 || m_pAppletPainter->formFactor() != form)
+ 	{
+ 		if (m_pAppletPainter != 0)
+@@ -1041,7 +1041,7 @@
+ 			m_pAppletPainter->disconnect();
+ 			this->disconnect(m_pAppletPainter);
+ 			this->disconnect(m_pAppletPainter->timeLine());
+-			
++
+ 			delete m_pAppletPainter;
+ 		}
+ 
+@@ -1062,12 +1062,12 @@
+ 		connect(m_pAppletPainter, SIGNAL(signalToggleWeatherIcon(int)), this, SLOT(slotToggleWeatherIcon(int)), Qt::DirectConnection);
+ 		connect(m_pAppletPainter->timeLine(), SIGNAL(finished()),  this, SLOT(animationFinished()));
+ 	}
+-	
++
+ 	if (m_svg.isValid())
+ 		m_pAppletPainter->setSvg(&m_svg);
+ 	if (m_customSvg.isValid())
+ 		m_pAppletPainter->setCustomSvg(&m_customSvg);
+-	
++
+ 	m_pAppletPainter->setupAnimationTimeLine();
+ }
+ 
+@@ -1077,16 +1077,16 @@
+ {
+ 	bool itemFound = extender()->hasItem(PANEL_DESKTOP_INTERFACE_NAME);
+ 	Plasma::ExtenderItem * item = 0;
+-	
++
+ 	if (itemFound)
+ 		item = extender()->item(PANEL_DESKTOP_INTERFACE_NAME);
+-	
++
+ 	// When we already have an extender item, just connect the current painter with this extender item
+ 	if (item != 0 && item->widget() != 0)
+ 	{
+ 		PanelDesktopInterface * popupDesktopInterface = dynamic_cast<PanelDesktopInterface *>(item->widget());
+ 		PanelPainter * panelPainter = dynamic_cast<PanelPainter *>(m_pAppletPainter);
+-		
++
+ 		if (panelPainter != 0 && popupDesktopInterface != 0)
+ 		{
+ 			panelPainter->setPopupPainter(popupDesktopInterface->desktopPainter());
+@@ -1121,14 +1121,14 @@
+ 		popupDesktopInterface->setSvg(&m_svg);
+ 		popupDesktopInterface->setCustomSvg(&m_customSvg);
+ 		popupDesktopInterface->setupAnimationTimeLine();
+-		
++
+ 		popupDesktopInterface->setMinimumSize(QSizeF(100, 93));
+ 		popupDesktopInterface->setPreferredSize(273, 255);
+ 
+ 		panelPainter->setPopupPainter(popupDesktopInterface->desktopPainter());
+-		
++
+ 		connect( m_pWeatherModel, SIGNAL(isBusy(bool)), popupDesktopInterface, SLOT(setBusy(bool)) );
+-		
++
+ 		item->setTitle(i18n("yaWP Desktop Interface"));
+ 		item->setIcon("weather-clear");
+ 		item->setWidget(popupDesktopInterface);
+@@ -1141,7 +1141,7 @@
+ YaWP::destroyExtenderItem()
+ {
+ 	bool itemFound = extender()->hasItem(PANEL_DESKTOP_INTERFACE_NAME);
+-	
++
+ 	if (itemFound)
+ 	{
+ 		extender()->item(PANEL_DESKTOP_INTERFACE_NAME)->deleteLater();
+@@ -1153,7 +1153,7 @@
+ {
+ 	dStartFunct();
+ 	Plasma::ToolTipManager::self()->clearContent(this);
+-	
++
+ 	//--- just exit, when we have no city or no weather information ---
+ 	const CityWeather * city = m_stateMachine.currentCity();
+ 	if( !city || city->days().count() == 0 )
+@@ -1164,7 +1164,7 @@
+ 
+ 	Plasma::ToolTipContent toolTipData;
+ 	toolTipData.setMainText( city->localizedCityString() );
+-	
++
+ 	//--- Create the tooltip pixmap for simple layout and extended tooltip ---
+ 	if (!m_configData.bUseExtendedTooltip ||
+ 	    m_configData.extendedTooltipOptions.testFlag(Yawp::PreviewPage))
+@@ -1172,46 +1172,46 @@
+ 		DesktopPainter toolTipPainter(0, &m_configData, &m_stateMachine);
+ 		toolTipPainter.setSvg(&m_svg);
+ 		toolTipPainter.setCustomSvg(&m_customSvg);
+-		
++
+ 		QPixmap pix;
+ 		if (!m_configData.bUseExtendedTooltip || city->days().count() == 1)
+ 			pix = toolTipPainter.createSimpleToolTip(QSize(218,0));
+ 		else
+ 			pix = toolTipPainter.createExtendedToolTip(QSize(218,0));
+-		
++
+ 		if (!pix.isNull())
+ 			toolTipData.setImage(pix);
+ 	}
+-	
++
+ 	//--- Create the content of the extended tooltip ---
+ 	if (m_configData.bUseExtendedTooltip)
+ 	{
+ 		if (!m_configData.extendedTooltipOptions.testFlag(Yawp::PreviewPage))
+ 		{
+  			KIcon appIcon(icon());
+-			toolTipData.setImage( appIcon.pixmap(48,48) ); 
++			toolTipData.setImage( appIcon.pixmap(48,48) );
+ 		}
+-		
++
+ 		bool showSatellitePage
+ 		      = m_configData.extendedTooltipOptions.testFlag(Yawp::SatellitePage) &&
+ 		        m_stateMachine.hasPage(Yawp::SatellitePage);
+ 		QString toolTipText;
+-		
++
+ 		if (showSatellitePage)
+ 			toolTipText += "<table><tr><td>";
+-		
++
+ 		//--- Create the forecast information for today and the following two days ---
+ 		const int maxDay = qMin(3, city->days().count());
+ 		for (int dayIndex = 0; dayIndex < maxDay; ++dayIndex)
+ 		{
+ 			const YawpDay * day = city->days().at(dayIndex);
+-			
++
+ 			// QDate returns translated nominative case of day
+ 			// name which is grammatically wrong at least in
+ 			// Russian. So fetch base English form and translate
+ 			// into correct one with own catalog
+ 			const KDateTime kDate(day->date());
+-			
++
+ 			toolTipText += "<u>"
+ 			            + i18n("Forecast for %1 (%2)",
+ 			                   i18nc("Forecast for day",
+@@ -1221,7 +1221,7 @@
+ 			toolTipText += i18n("Day: ")
+ 			            + Utils::LocalizedWeatherString(day->weather().description())
+ 			            + "<br />";
+-			
++
+ 			if (day->hasNightValues())
+ 			{
+ 				toolTipText += i18n("Night: ")
+@@ -1253,29 +1253,29 @@
+ 						+ "<br />";
+ 				}
+ 			}
+-			
++
+ 			if (dayIndex+1 < maxDay)
+ 				toolTipText += "<br />";
+ 			else
+ 				// removes the last <br />; because this is the end of text
+ 				toolTipText.remove(toolTipText.length()-6, 6);
+ 		}
+-		
++
+ 		if (showSatellitePage)
+ 		{
+ 			toolTipData.addResource(
+ 				Plasma::ToolTipContent::ImageResource,
+ 				QUrl("wicon://satelite"),
+ 				QVariant(city->satelliteImage().scaledToWidth(218, Qt::SmoothTransformation)));
+-			
++
+ 			toolTipText += "</td><td valign=\"top\">";
+ 			toolTipText += "<img src=\"wicon://satelite\"/>";
+-			toolTipText += "</td></tr></table>";		  
++			toolTipText += "</td></tr></table>";
+ 		}
+-		
++
+ 		toolTipData.setSubText(toolTipText);
+ 	}
+-	
++
+ 	toolTipData.setAutohide(false);
+ 	Plasma::ToolTipManager::self()->setContent(this, toolTipData);
+ 
diff --git a/kde-plasma-yawp.spec b/kde-plasma-yawp.spec
index afc6e18..8592d8b 100644
--- a/kde-plasma-yawp.spec
+++ b/kde-plasma-yawp.spec
@@ -1,11 +1,14 @@
 Name:           kde-plasma-yawp
 Version:        0.4.0
-Release:        2%{?dist}
+Release:        3%{?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
+# fix geometry settings (#754407)
+# http://yawp.svn.sourceforge.net/viewvc/yawp?view=revision&revision=484
+Patch0:         kde-plasma-yawp-fix-geometry.patch
 
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
@@ -25,6 +28,7 @@ This colorful plasmoid shows weather maps, reports and forecasts.
 
 %prep
 %setup -q -n yawp-%{version}
+%patch0
 
 %build
 mkdir -p %{_target_platform}
@@ -62,6 +66,9 @@ rm -rf %{buildroot}
 
 
 %changelog
+* Wed Nov 16 2011 Alexey Kurov <nucleo at fedoraproject.org> - 0.4.0-3
+- fix geometry settings (#754407)
+
 * Sun Nov 13 2011 Alexey Kurov <nucleo at fedoraproject.org> - 0.4.0-2
 - fix unowned dir
 


More information about the scm-commits mailing list