Patch: Remove some deprecated functions

Thorsten Zachmann t.zachmann at zagge.de
Sun Nov 6 04:13:12 GMT 2011


Hello Mauro,

On Saturday, November 05, 2011 23:41:03 Mauro wrote:
>   Hi everyone,
> 
> while building calligra I have noticed many compiler warning related to
> the use of deprecated functions. I have tried to remove as many as
> possible among the most trivial (dates/locale functions).

thanks for the patch.

> 
> While browsing the code I also came upon this strange if construct:
> 
> [filters/words/rtf/import/rtf-qt/src/UserPropsDestination.cpp]
> 38  if ( value == 30 ) {
> 39    m_propertyType = QVariant::String;
> 40  } else if ( value == 3 ) {
> 41    m_propertyType == QVariant::Int; // <-- statement with no effect
> 42  } else if ( value == 5 ) {
> 43    m_propertyType == QVariant::Double; // again, no effect
>     } ........... {
> 49    qDebug() << "unhandled value type in UserPropsDestination:" << value;
> 50  }
> 
> I assumed that the idea was to *set* the m_propertyType field (as in row
> 39), so I have also fixed that in my patch.

good catch

> On IRC boemann told me to post the patch here and to take this
> opportunity to introduce briefly myself to the community. So... My name
> is Mauro and I am a MSc student of Computer Engineering at PoliTO.
> 
> I know this is a patch of little value, but I hope to be able to do more
> in the future.
> Maybe some Junior Jobs...

What part of Calligra does interest you the most?

While looking at the patch I found the following issues:

The indent in 

+++ b/tables/ValueFormatter.cpp                                                                                                                                                               
@@ -598,15 +598,15 @@ QString ValueFormatter::dateFormat(const QDate &date, 
Format::Type fmtType, cons                                                                                        
         tmp = m_converter->settings()->locale()->formatDate(date, 
KLocale::LongDate);                                                                                                        
     } else if (fmtType == Format::Date1) { /*18-Feb-99 */                                                                                                                                    
         tmp = QString().sprintf("%02d", date.day());                                                                                                                                         
-        tmp += '-' + m_converter->settings()->locale()->calendar()-
>monthString(date, KCalendarSystem::ShortFormat) + '-';                                                                   
+   tmp += '-' + m_converter->settings()->locale()->calendar()-
>formatDate(date, KLocale::MonthName, KLocale::ShortName) + '-';                                                               
         tmp += QString::number(date.year()).right(2);                                                                                                                                        
     } else if (fmtType == Format::Date2) { /*18-Feb-1999 */                                                                                                                                  

is wrong.

The function 

formatDate(date, KLocale::MonthName, KLocale::ShortName) 

was introduced in 4.6 so you need to ifdef that as we still support compiling 
against kde 4.4.

It would be good if Marjin and Dan the maintainers of tables/plan would have a 
look too just to make sure all is still fine.

It would be very appreciated if you can post your next patch to reviewboard as 
it makes reviewing much simpler.ggggggggg

Thorsten



More information about the calligra-devel mailing list