Git commit b25faa381be44b6fc35583812bb1b1037a8d0db5 by Friedrich W. H. Kossebau. Committed on 15/02/2013 at 22:41. Pushed by kossebau into branch 'master'.
Bump min. kdelibs version to 4.6.0 Additionally * remove no longer needed KDE_IS_VERSION branches * port remaining calls of deprecated KCalendarSystem methods REVIEW: 108870 CCMAIL: calligra-devel@kde.org M +2 -2 CMakeLists.txt M +0 -4 filters/plan/mpxj/import/mpxjimport.cpp M +0 -4 filters/sheets/opencalc/opencalcexport.cc M +0 -8 kexi/formeditor/widgetfactory.cpp M +0 -4 kexi/kexiutils/KexiCategorizedView.h M +1 -4 libs/main/KoApplication.cpp M +0 -4 libs/main/KoMainWindow.cpp M +0 -2 libs/main/config/KoConfigGridPage.cpp M +0 -7 plan/kpttaskdefaultpanel.cpp M +0 -4 plan/libs/kernel/KPlatoXmlLoaderBase.cpp M +0 -16 plan/libs/kernel/kptcommand.cpp M +0 -8 plan/libs/kernel/kptdebug.cpp M +0 -8 plan/libs/kernel/kptproject.cpp M +23 -12 plan/libs/models/kcalendar/kdatepicker.cpp M +20 -9 plan/libs/models/kcalendar/kdatetable.cpp M +0 -8 plan/libs/models/kptcalendarmodel.cpp M +0 -7 plan/libs/ui/kptmainprojectpanel.cpp M +0 -7 plan/libs/ui/kptresourcedialog.cpp M +0 -7 plan/libs/ui/kptsummarytaskgeneralpanel.cpp M +0 -7 plan/libs/ui/kpttaskgeneralpanel.cpp M +0 -13 plan/libs/ui/locale/localemon.cpp M +0 -4 plan/plugins/scripting/ScriptingPart.cpp M +0 -4 plan/workpackage/debugarea.cpp M +0 -12 sheets/Localization.cpp M +49 -49 sheets/ValueFormatter.cpp M +8 -3 sheets/plugins/calendar/CalendarTool.cpp M +0 -4 sheets/ui/CellToolBase.cpp M +0 -4 sheets/ui/CellToolBase_p.cpp M +0 -4 tools/calligra/main.cpp http://commits.kde.org/calligra/b25faa381be44b6fc35583812bb1b1037a8d0db5 diff --git a/CMakeLists.txt b/CMakeLists.txt index 5e3f9ca..d9945a1 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -101,8 +101,8 @@ ENDIF() ## Look for KDE and Qt ## ######################### ######################## -set(KDE_MIN_VERSION "4.3.0") -find_package(KDE4 4.3.0 REQUIRED) +set(KDE_MIN_VERSION "4.6.0") +find_package(KDE4 4.6.0 REQUIRED) if (QT3SUPPORT) find_package(Qt4 4.7.0 REQUIRED QtCore QtGui QtXml QtScript QtSvg QtTest QtWebKit QtDBus QtOpenGL Qt3Support) diff --git a/filters/plan/mpxj/import/mpxjimport.cpp b/filters/plan/mpxj/import/mpxjimport.cpp index cebe50d..2c34e6c 100644 --- a/filters/plan/mpxj/import/mpxjimport.cpp +++ b/filters/plan/mpxj/import/mpxjimport.cpp @@ -33,11 +33,7 @@ #include <kprocess.h> int planMpxjDbg() { -#if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "plan(MPXJ import)" ); -#else - static int s_area = 0; -#endif return s_area; } diff --git a/filters/sheets/opencalc/opencalcexport.cc b/filters/sheets/opencalc/opencalcexport.cc index 46d7c59..fd18542 100644 --- a/filters/sheets/opencalc/opencalcexport.cc +++ b/filters/sheets/opencalc/opencalcexport.cc @@ -753,11 +753,7 @@ void OpenCalcExport::exportDefaultCellStyle(QDomDocument & doc, QDomElement & of QDomElement style = doc.createElement("style:properties"); style.setAttribute("style:font-name", font.family()); style.setAttribute("fo:font-size", QString("%1pt").arg(font.pointSize())); -#if KDE_IS_VERSION(4,4,0) style.setAttribute("style:decimal-places", QString::number(locale->decimalPlaces())); -#else - style.setAttribute("style:decimal-places", QString::number(locale->fracDigits())); -#endif style.setAttribute("fo:language", language); style.setAttribute("fo:country", country); style.setAttribute("style:font-name-asian", "HG Mincho Light J"); diff --git a/kexi/formeditor/widgetfactory.cpp b/kexi/formeditor/widgetfactory.cpp index 3dc9cfa..a612b9c 100644 --- a/kexi/formeditor/widgetfactory.cpp +++ b/kexi/formeditor/widgetfactory.cpp @@ -30,11 +30,7 @@ #include <klineedit.h> #include <kdialog.h> -#if KDE_IS_VERSION(4,5,90) # include <keditlistwidget.h> -#else -# include <keditlistbox.h> -#endif #include <kactioncollection.h> @@ -163,11 +159,7 @@ bool WidgetFactory::editList(QWidget *w, QStringList &list) const dialog.setWindowTitle(i18n("Edit Contents of %1", w->objectName())); dialog.setButtons(KDialog::Ok | KDialog::Cancel); -#if KDE_IS_VERSION(4,5,90) KEditListWidget *edit = new KEditListWidget(&dialog); -#else - KEditListBox *edit = new KEditListBox(&dialog); -#endif edit->setObjectName("editlist"); dialog.setMainWidget(edit); edit->insertStringList(list); diff --git a/kexi/kexiutils/KexiCategorizedView.h b/kexi/kexiutils/KexiCategorizedView.h index 57eb945..cb499d6 100644 --- a/kexi/kexiutils/KexiCategorizedView.h +++ b/kexi/kexiutils/KexiCategorizedView.h @@ -31,11 +31,7 @@ class QAbstractItemModel; class QRect; class QMouseEvent; -#if KDE_IS_VERSION(4,5,0) typedef KCategoryDrawerV3 KexiCategoryDrawerBase; -#else -typedef KCategoryDrawerV2 KexiCategoryDrawerBase; -#endif //! Modification of category drawer for KCategorizedView: disallows clicking on the drawer class KEXIUTILS_EXPORT KexiCategoryDrawer : public KexiCategoryDrawerBase diff --git a/libs/main/KoApplication.cpp b/libs/main/KoApplication.cpp index 87536f1..02a8722 100644 --- a/libs/main/KoApplication.cpp +++ b/libs/main/KoApplication.cpp @@ -47,9 +47,7 @@ #include <kdebug.h> #include <kmimetype.h> -#if KDE_IS_VERSION(4,6,0) #include <krecentdirs.h> -#endif #include <QFile> #include <QSplashScreen> @@ -206,13 +204,12 @@ bool KoApplication::start() } // No argument -> create an empty document if (!argsCount) { -#if KDE_IS_VERSION(4,6,0) // if there's no document, add the current working directory // to the recent dirs so the open dialog and open pane show // the directory from where the app was started, instead of // the last directory from where we opened a file KRecentDirs::add(":OpenDialog", QDir::currentPath()); -#endif + QString errorMsg; KoPart *part = entry.createKoPart(&errorMsg); diff --git a/libs/main/KoMainWindow.cpp b/libs/main/KoMainWindow.cpp index 625a742..14169f0 100644 --- a/libs/main/KoMainWindow.cpp +++ b/libs/main/KoMainWindow.cpp @@ -45,9 +45,7 @@ #include <KoConfig.h> #include <kdeversion.h> -#if KDE_IS_VERSION(4,6,0) #include <krecentdirs.h> -#endif #include <krecentfilesaction.h> #include <kaboutdata.h> #include <ktoggleaction.h> @@ -582,9 +580,7 @@ void KoMainWindow::addRecentURL(const KUrl& url) ok = false; // it's in the tmp resource if (ok) { KRecentDocument::add(path); -#if KDE_IS_VERSION(4,6,0) KRecentDirs::add(":OpenDialog", QFileInfo(path).dir().canonicalPath()); -#endif } } else { KRecentDocument::add(url.url(KUrl::RemoveTrailingSlash), true); diff --git a/libs/main/config/KoConfigGridPage.cpp b/libs/main/config/KoConfigGridPage.cpp index aa3394b..12c6fc8 100644 --- a/libs/main/config/KoConfigGridPage.cpp +++ b/libs/main/config/KoConfigGridPage.cpp @@ -70,9 +70,7 @@ KoConfigGridPage::KoConfigGridPage(KoDocument* doc, char* name) d->snapChBox = new QCheckBox(generalGrp); d->snapChBox->setChecked(gd.snapToGrid()); d->gridColorBtn = new KColorButton(gd.gridColor(), generalGrp); -#if KDE_IS_VERSION(4,5,0) d->gridColorBtn->setAlphaChannelEnabled(true); -#endif layoutGeneral->addRow(i18n("Show grid:"), d->gridChBox); layoutGeneral->addRow(i18n("Snap to grid:"), d->snapChBox); layoutGeneral->addRow(i18n("Grid color:"), d->gridColorBtn); diff --git a/plan/kpttaskdefaultpanel.cpp b/plan/kpttaskdefaultpanel.cpp index 3b54e42..ec15644 100644 --- a/plan/kpttaskdefaultpanel.cpp +++ b/plan/kpttaskdefaultpanel.cpp @@ -24,12 +24,10 @@ #include "plansettings.h" #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) #include <akonadi/contact/emailaddressselectiondialog.h> #include <akonadi/contact/emailaddressselectionwidget.h> #include <akonadi/contact/emailaddressselection.h> #endif -#endif #include <QDateTime> #include <QDateTimeEdit> @@ -59,9 +57,6 @@ ConfigTaskPanelImpl::ConfigTaskPanelImpl(QWidget *p ) #ifndef PLAN_KDEPIMLIBS_FOUND chooseLeader->hide(); #endif -#if ! KDE_IS_VERSION( 4, 5, 0 ) - chooseLeader->hide(); -#endif // FIXME // [Bug 311940] New: Plan crashes when typing a text in the filter textbox before the textbook is fully loaded when selecting a contact from the adressbook @@ -126,7 +121,6 @@ void ConfigTaskPanelImpl::initDescription() void ConfigTaskPanelImpl::changeLeader() { #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) QPointer<Akonadi::EmailAddressSelectionDialog> dlg = new Akonadi::EmailAddressSelectionDialog( this ); if ( dlg->exec() && dlg ) { QStringList names; @@ -151,7 +145,6 @@ void ConfigTaskPanelImpl::changeLeader() } } #endif -#endif } void ConfigTaskPanelImpl::startDateTimeChanged( const QDateTime &dt ) diff --git a/plan/libs/kernel/KPlatoXmlLoaderBase.cpp b/plan/libs/kernel/KPlatoXmlLoaderBase.cpp index fe78979..14d4f5d 100644 --- a/plan/libs/kernel/KPlatoXmlLoaderBase.cpp +++ b/plan/libs/kernel/KPlatoXmlLoaderBase.cpp @@ -43,11 +43,7 @@ using namespace KPlato; KPLATOKERNEL_EXPORT int kplatoXmlDebugArea() { -#if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "plan (kplato xml)" ); -#else - static int s_area = 0; -#endif return s_area; } diff --git a/plan/libs/kernel/kptcommand.cpp b/plan/libs/kernel/kptcommand.cpp index 852faad..691529d 100644 --- a/plan/libs/kernel/kptcommand.cpp +++ b/plan/libs/kernel/kptcommand.cpp @@ -38,11 +38,7 @@ static int insertProjectCmdDba() { -#if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "plan (InsertProjectCmd)" ); -#else - static int s_area = 0; -#endif return s_area; } @@ -3544,28 +3540,16 @@ ModifyCurrencyFractionalDigitsCmd::ModifyCurrencyFractionalDigitsCmd( KLocale * : NamedCommand( name ), m_locale( locale ), m_newvalue( value ), -#if KDE_IS_VERSION(4,4,0) m_oldvalue(locale->monetaryDecimalPlaces()) -#else - m_oldvalue( locale->fracDigits() ) -#endif { }; void ModifyCurrencyFractionalDigitsCmd::execute() { -#if KDE_IS_VERSION(4,4,0) m_locale->setMonetaryDecimalPlaces(m_newvalue); -#else - m_locale->setFracDigits( m_newvalue ); -#endif } void ModifyCurrencyFractionalDigitsCmd::unexecute() { -#if KDE_IS_VERSION(4,4,0) m_locale->setMonetaryDecimalPlaces(m_oldvalue); -#else - m_locale->setFracDigits( m_oldvalue ); -#endif } ModifyPositivePrefixCurrencySymolCmd::ModifyPositivePrefixCurrencySymolCmd( KLocale *locale, bool value, const QString& name ) diff --git a/plan/libs/kernel/kptdebug.cpp b/plan/libs/kernel/kptdebug.cpp index 80f0ef3..e6d113a 100644 --- a/plan/libs/kernel/kptdebug.cpp +++ b/plan/libs/kernel/kptdebug.cpp @@ -22,19 +22,11 @@ #include <kdeversion.h> int planDbg() { - #if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "plan" ); - #else - static int s_area = 0; - #endif return s_area; } int planDependencyEditorDbg() { - #if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "plan (Dependency Editor)" ); - #else - static int s_area = 0; - #endif return s_area; } diff --git a/plan/libs/kernel/kptproject.cpp b/plan/libs/kernel/kptproject.cpp index d67ff53..a82a25a 100644 --- a/plan/libs/kernel/kptproject.cpp +++ b/plan/libs/kernel/kptproject.cpp @@ -948,11 +948,7 @@ bool Project::load( KoXmlElement &element, XMLLoaderObject &status ) // l->setMonetaryThousandsSeparator( e.attribute( "monetary-thousands-separator", l->monetaryThousandsSeparator() ) ); if ( e.hasAttribute( "currency-digits" ) ) { -#if KDE_IS_VERSION(4,4,0) l->setMonetaryDecimalPlaces(e.attribute("currency-digits").toInt()); -#else - l->setFracDigits( e.attribute( "currency-digits" ).toInt() ); -#endif } if ( e.hasAttribute( "positive-monetary-sign-position" ) ) { l->setPositiveMonetarySignPosition( (KLocale::SignPosition)( e.attribute( "positive-monetary-sign-position" ).toInt() ) ); @@ -1267,11 +1263,7 @@ void Project::save( QDomElement &element ) const loc.setAttribute( "currency-symbol", l->currencySymbol() ); // loc.setAttribute( "monetary-decimal-symbol", l->monetaryDecimalSymbol() ); // loc.setAttribute( "monetary-thousands-separator", l->monetaryThousandsSeparator() ); -#if KDE_IS_VERSION(4,4,0) loc.setAttribute("currency-digits", l->monetaryDecimalPlaces()); -#else - loc.setAttribute( "currency-digits", l->fracDigits() ); -#endif loc.setAttribute( "positive-monetary-sign-position", l->positiveMonetarySignPosition() ); loc.setAttribute( "positive-prefix-currency-symbol", l->positivePrefixCurrencySymbol() ); loc.setAttribute( "negative-monetary-sign-position", l->negativeMonetarySignPosition() ); diff --git a/plan/libs/models/kcalendar/kdatepicker.cpp b/plan/libs/models/kcalendar/kdatepicker.cpp index df82168..ecf5cf7 100644 --- a/plan/libs/models/kcalendar/kdatepicker.cpp +++ b/plan/libs/models/kcalendar/kdatepicker.cpp @@ -42,6 +42,7 @@ #include <klineedit.h> #include <klocale.h> #include <knotification.h> +#include <kdeversion.h> #include <KoIcon.h> #include "kptdebug.h" @@ -106,21 +107,31 @@ void KDatePicker::fillWeeksCombo(const QDate &date) QDate day; int year = calendar->year(date); - calendar->setYMD(day, year, 1, 1); + calendar->setDate(day, year, 1, 1); int lastMonth = calendar->monthsInYear(day); QDate lastDay, firstDayOfLastMonth; - calendar->setYMD(firstDayOfLastMonth, year, lastMonth, 1); - calendar->setYMD(lastDay, year, lastMonth, calendar->daysInMonth(firstDayOfLastMonth)); + calendar->setDate(firstDayOfLastMonth, year, lastMonth, 1); + calendar->setDate(lastDay, year, lastMonth, calendar->daysInMonth(firstDayOfLastMonth)); for (; day <= lastDay ; day = calendar->addDays(day, 7 /*calendar->daysOfWeek()*/) ) { - QString week = i18n("Week %1", calendar->weekNumber(day, &year)); +#if KDE_IS_VERSION(4,7,0) + const int weekNumber = calendar->week(day, &year); +#else + const int weekNumber = calendar->weekNumber(day, &year); +#endif + QString week = i18n("Week %1", weekNumber); if ( year != calendar->year(day) ) week += '*'; // show that this is a week from a different year d->selectWeek->addItem(week); // make sure that the week of the lastDay is always inserted: in Chinese calendar // system, this is not always the case - if(day < lastDay && day.daysTo(lastDay) < 7 && calendar->weekNumber(day) != calendar->weekNumber(lastDay)) + if(day < lastDay && day.daysTo(lastDay) < 7 && +#if KDE_IS_VERSION(4,7,0) + calendar->week(day) != calendar->week(lastDay)) +#else + calendar->weekNumber(day) != calendar->weekNumber(lastDay)) +#endif day = lastDay.addDays(-7); } } @@ -422,9 +433,9 @@ KDatePicker::dateChangedSlot(const QDate &date) // calculate the item num in the week combo box; normalize selected day so as if 1.1. is the first day of the week QDate firstDay; - calendar->setYMD(firstDay, calendar->year(date), 1, 1); + calendar->setDate(firstDay, calendar->year(date), 1, 1); d->selectWeek->setCurrentIndex((calendar->dayOfYear(date) + calendar->dayOfWeek(firstDay) - 2) / 7/*calendar->daysInWeek()*/); - d->selectYear->setText(calendar->yearString(date, KCalendarSystem::ShortFormat)); + d->selectYear->setText(calendar->formatDate(date, KLocale::Year, KLocale::ShortNumber)); emit(dateChanged(date)); } @@ -502,7 +513,7 @@ KDatePicker::weekSelected(int week) QDate date = d->table->date(); int year = calendar->year(date); - calendar->setYMD(date, year, 1, 1); // first day of selected year + calendar->setDate(date, year, 1, 1); // first day of selected year // calculate the first day in the selected week (day 1 is first day of week) date = calendar->addDays(date, week * 7/*calendar->daysOfWeek()*/ -calendar->dayOfWeek(date) + 1); @@ -532,7 +543,7 @@ KDatePicker::selectMonthClicked() int day = calendar->day(date); // ----- construct a valid date in this month: - calendar->setYMD(date, calendar->year(date), item->data().toInt(), 1); + calendar->setDate(date, calendar->year(date), item->data().toInt(), 1); date = date.addDays(qMin(day, calendar->daysInMonth(date)) - 1); // ----- set this month setDate(date); @@ -567,9 +578,9 @@ KDatePicker::selectYearClicked() date=d->table->date(); day=calendar->day(date); // ----- construct a valid date in this month: - //date.setYMD(year, date.month(), 1); - //date.setYMD(year, date.month(), qMin(day, date.daysInMonth())); - calendar->setYMD(date, year, calendar->month(date), + //date.setDate(year, date.month(), 1); + //date.setDate(year, date.month(), qMin(day, date.daysInMonth())); + calendar->setDate(date, year, calendar->month(date), qMin(day, calendar->daysInMonth(date))); // ----- set this month setDate(date); diff --git a/plan/libs/models/kcalendar/kdatetable.cpp b/plan/libs/models/kcalendar/kdatetable.cpp index 378242b..b389345 100644 --- a/plan/libs/models/kcalendar/kdatetable.cpp +++ b/plan/libs/models/kcalendar/kdatetable.cpp @@ -35,6 +35,7 @@ #include "kdatetable.h" #include "kdatetable_p.h" +#include <kdeversion.h> #include <kconfig.h> #include <kcolorscheme.h> #include <kglobal.h> @@ -492,7 +493,7 @@ QDate KDateTable::dateFromPos( int pos ) { QDate pCellDate; const KCalendarSystem * calendar = KGlobal::locale()->calendar(); - calendar->setYMD(pCellDate, calendar->year(d->mDate), calendar->month(d->mDate), 1); + calendar->setDate(pCellDate, calendar->year(d->mDate), calendar->month(d->mDate), 1); int firstWeekDay = KGlobal::locale()->weekStartDay(); int offset = (d->firstday - firstWeekDay + 7) % 7; @@ -532,7 +533,12 @@ bool KDateTable::event( QEvent *event ) if ( d->m_weekNumberDelegate ) { const KCalendarSystem * calendar = KGlobal::locale()->calendar(); - text = d->m_weekNumberDelegate->data( calendar->weekNumber( pCellDate ), Qt::ToolTipRole, d->m_model ).toString(); +#if KDE_IS_VERSION(4,7,0) + const int weekNumber = calendar->week( pCellDate ); +#else + const int weekNumber = calendar->weekNumber( pCellDate ); +#endif + text = d->m_weekNumberDelegate->data( weekNumber, Qt::ToolTipRole, d->m_model ).toString(); } } else @@ -625,7 +631,12 @@ KDateTable::paintCell(QPainter *painter, int row, int column) QDate pCellDate = dateFromPos( pos ); if ( d->m_weekNumberDelegate ) { - size = d->m_weekNumberDelegate->paint( painter, d->m_styleOptionWeekNumber, calendar->weekNumber( pCellDate ), d->m_model ).size(); +#if KDE_IS_VERSION(4,7,0) + const int weekNumber = calendar->week( pCellDate ); +#else + const int weekNumber = calendar->weekNumber( pCellDate ); +#endif + size = d->m_weekNumberDelegate->paint( painter, d->m_styleOptionWeekNumber, weekNumber, d->m_model ).size(); } } else @@ -1014,8 +1025,8 @@ KDateTable::setDate(const QDate& date_) } const KCalendarSystem * calendar = KGlobal::locale()->calendar(); - calendar->setYMD(temp, calendar->year(d->mDate), calendar->month(d->mDate), 1); - //temp.setYMD(d->mDate.year(), d->mDate.month(), 1); + calendar->setDate(temp, calendar->year(d->mDate), calendar->month(d->mDate), 1); + //temp.setDate(d->mDate.year(), d->mDate.month(), 1); //kDebug(planDbg()) << "firstDayInWeek: " << temp.toString(); d->firstday=temp.dayOfWeek(); d->numdays=calendar->daysInMonth(d->mDate); @@ -1129,8 +1140,8 @@ KDateInternalYearSelector::yearEnteredSlot() KNotification::beep(); return; } - //date.setYMD(year, 1, 1); - KGlobal::locale()->calendar()->setYMD(date, year, 1, 1); + //date.setDate(year, 1, 1); + KGlobal::locale()->calendar()->setDate(date, year, 1, 1); if(!date.isValid()) { KNotification::beep(); @@ -1316,7 +1327,7 @@ QRectF KDateTableDateDelegate::paint( QPainter *painter, const StyleOptionViewIt QColor textColor = palette.text().color(); QBrush bg( palette.base() ); Qt::Alignment align = option.displayAlignment; - QString text = calendar->dayString(date, KCalendarSystem::ShortFormat); + QString text = calendar->formatDate(date, KLocale::Day, KLocale::ShortNumber); if ( model ) { @@ -1455,7 +1466,7 @@ QRectF KDateTableCustomDateDelegate::paint( QPainter *painter, const StyleOption painter->drawRect(option.rectF); } painter->setPen(pen); - QString text = calendar->dayString(date, KCalendarSystem::ShortFormat); + QString text = calendar->formatDate(date, KLocale::Day, KLocale::ShortNumber); if ( model ) { QVariant v = model->data( date ); diff --git a/plan/libs/models/kptcalendarmodel.cpp b/plan/libs/models/kptcalendarmodel.cpp index 06a4737..eea678d 100644 --- a/plan/libs/models/kptcalendarmodel.cpp +++ b/plan/libs/models/kptcalendarmodel.cpp @@ -868,16 +868,12 @@ QVariant CalendarDayItemModel::data( const QModelIndex &index, int role ) const if ( d->state() == CalendarDay::NonWorking ) { return i18nc( "@info:tooltip", "Non-working" ); } -#if KDE_IS_VERSION( 4, 3, 80 ) KLocale *l = KGlobal::locale(); QStringList tip; foreach ( TimeInterval *i, d->timeIntervals() ) { tip << i18nc( "@info:tooltip 1=time 2=The work duration (non integer)", "%1, %2", l->formatLocaleTime( i->startTime(), KLocale::TimeWithoutSeconds ), l->formatDuration( i->second ) ); } return tip.join( "\n" ); -#else - return i18nc( "@info:tooltip", "Working" ); -#endif } case Qt::FontRole: { if ( d->state() != CalendarDay::Undefined ) { @@ -1027,16 +1023,12 @@ QVariant DateTableDataModel::data( const QDate &date, int role, int dataType ) c if ( day->state() == CalendarDay::NonWorking ) { return i18nc( "@info:tooltip", "Non-working" ); } -#if KDE_IS_VERSION( 4, 3, 80 ) KLocale *l = KGlobal::locale(); QStringList tip; foreach ( TimeInterval *i, day->timeIntervals() ) { tip << i18nc( "@info:tooltip 1=time 2=The work duration (non integer)", "%1, %2", l->formatLocaleTime( i->startTime(), KLocale::TimeWithoutSeconds ), l->formatDuration( i->second ) ); } return tip.join( "\n" ); -#else - return i18nc( "@info:tooltip", "Working" ); -#endif } switch ( dataType ) { diff --git a/plan/libs/ui/kptmainprojectpanel.cpp b/plan/libs/ui/kptmainprojectpanel.cpp index fa47fc1..e0b1ddd 100644 --- a/plan/libs/ui/kptmainprojectpanel.cpp +++ b/plan/libs/ui/kptmainprojectpanel.cpp @@ -31,12 +31,10 @@ #include <kdeversion.h> #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) #include <akonadi/contact/emailaddressselectiondialog.h> #include <akonadi/contact/emailaddressselectionwidget.h> #include <akonadi/contact/emailaddressselection.h> #endif -#endif #include "kptproject.h" @@ -57,9 +55,6 @@ MainProjectPanel::MainProjectPanel(Project &p, QWidget *parent) #ifndef PLAN_KDEPIMLIBS_FOUND chooseLeader->hide(); #endif -#if ! KDE_IS_VERSION( 4, 5, 0 ) - chooseLeader->hide(); -#endif // FIXME // [Bug 311940] New: Plan crashes when typing a text in the filter textbox before the textbook is fully loaded when selecting a contact from the adressbook @@ -144,7 +139,6 @@ void MainProjectPanel::slotCheckAllFieldsFilled() void MainProjectPanel::slotChooseLeader() { #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) QPointer<Akonadi::EmailAddressSelectionDialog> dlg = new Akonadi::EmailAddressSelectionDialog( this ); if ( dlg->exec() && dlg ) { QStringList names; @@ -169,7 +163,6 @@ void MainProjectPanel::slotChooseLeader() } } #endif -#endif } diff --git a/plan/libs/ui/kptresourcedialog.cpp b/plan/libs/ui/kptresourcedialog.cpp index a25a936..ec09a63 100644 --- a/plan/libs/ui/kptresourcedialog.cpp +++ b/plan/libs/ui/kptresourcedialog.cpp @@ -33,12 +33,10 @@ #include <kdeversion.h> #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) #include <akonadi/contact/emailaddressselectiondialog.h> #include <akonadi/contact/emailaddressselectionwidget.h> #include <akonadi/contact/emailaddressselection.h> #endif -#endif #include <kdatetimewidget.h> #include <kmessagebox.h> @@ -59,9 +57,6 @@ ResourceDialogImpl::ResourceDialogImpl( const Project &project, Resource &resour #ifndef PLAN_KDEPIMLIBS_FOUND chooseBtn->hide(); #endif -#if ! KDE_IS_VERSION( 4, 5, 0 ) - chooseBtn->hide(); -#endif // FIXME // [Bug 311940] New: Plan crashes when typing a text in the filter textbox before the textbook is fully loaded when selecting a contact from the adressbook @@ -223,7 +218,6 @@ void ResourceDialogImpl::slotCalculationNeeded(const QString&) { void ResourceDialogImpl::slotChooseResource() { #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) QPointer<Akonadi::EmailAddressSelectionDialog> dlg = new Akonadi::EmailAddressSelectionDialog( this ); if ( dlg->exec() && dlg ) { QStringList s; @@ -242,7 +236,6 @@ void ResourceDialogImpl::slotChooseResource() } } #endif -#endif } ////////////////// ResourceDialog //////////////////////// diff --git a/plan/libs/ui/kptsummarytaskgeneralpanel.cpp b/plan/libs/ui/kptsummarytaskgeneralpanel.cpp index 540a28f..e1bc51c 100644 --- a/plan/libs/ui/kptsummarytaskgeneralpanel.cpp +++ b/plan/libs/ui/kptsummarytaskgeneralpanel.cpp @@ -32,12 +32,10 @@ #include <kdeversion.h> #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) #include <akonadi/contact/emailaddressselectiondialog.h> #include <akonadi/contact/emailaddressselectionwidget.h> #include <akonadi/contact/emailaddressselection.h> #endif -#endif #include <QPushButton> #include <kdebug.h> @@ -55,9 +53,6 @@ SummaryTaskGeneralPanel::SummaryTaskGeneralPanel(Task &task, QWidget *p, const c #ifndef PLAN_KDEPIMLIBS_FOUND chooseLeader->hide(); #endif -#if ! KDE_IS_VERSION( 4, 5, 0 ) - chooseLeader->hide(); -#endif // FIXME // [Bug 311940] New: Plan crashes when typing a text in the filter textbox before the textbook is fully loaded when selecting a contact from the adressbook @@ -133,7 +128,6 @@ bool SummaryTaskGeneralPanel::ok() { void SummaryTaskGeneralPanel::slotChooseResponsible() { #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) QPointer<Akonadi::EmailAddressSelectionDialog> dlg = new Akonadi::EmailAddressSelectionDialog( this ); if ( dlg->exec() && dlg ) { QStringList names; @@ -158,7 +152,6 @@ void SummaryTaskGeneralPanel::slotChooseResponsible() } } #endif -#endif } diff --git a/plan/libs/ui/kpttaskgeneralpanel.cpp b/plan/libs/ui/kpttaskgeneralpanel.cpp index 1123cf9..e91e883 100644 --- a/plan/libs/ui/kpttaskgeneralpanel.cpp +++ b/plan/libs/ui/kpttaskgeneralpanel.cpp @@ -37,12 +37,10 @@ #include <kdeversion.h> #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) #include <akonadi/contact/emailaddressselectiondialog.h> #include <akonadi/contact/emailaddressselectionwidget.h> #include <akonadi/contact/emailaddressselection.h> #endif -#endif #include <QDateTime> #include <QPushButton> @@ -230,9 +228,6 @@ TaskGeneralPanelImpl::TaskGeneralPanelImpl(QWidget *p, const char *n) #ifndef PLAN_KDEPIMLIBS_FOUND chooseLeader->hide(); #endif -#if ! KDE_IS_VERSION( 4, 5, 0 ) - chooseLeader->hide(); -#endif // FIXME // [Bug 311940] New: Plan crashes when typing a text in the filter textbox before the textbook is fully loaded when selecting a contact from the adressbook @@ -270,7 +265,6 @@ int TaskGeneralPanelImpl::schedulingType() const void TaskGeneralPanelImpl::changeLeader() { #ifdef PLAN_KDEPIMLIBS_FOUND -#if KDE_IS_VERSION( 4, 5, 0 ) QPointer<Akonadi::EmailAddressSelectionDialog> dlg = new Akonadi::EmailAddressSelectionDialog( this ); if ( dlg->exec() && dlg ) { QStringList names; @@ -295,7 +289,6 @@ void TaskGeneralPanelImpl::changeLeader() } } #endif -#endif } void TaskGeneralPanelImpl::setEstimationType( int type ) diff --git a/plan/libs/ui/locale/localemon.cpp b/plan/libs/ui/locale/localemon.cpp index eece046..84abc97 100644 --- a/plan/libs/ui/locale/localemon.cpp +++ b/plan/libs/ui/locale/localemon.cpp @@ -135,13 +135,8 @@ void LocaleConfigMoney::save() i = entGrp.readEntry("FracDigits", 2); group.deleteEntry("FracDigits", KConfig::Persistent | KConfig::Global); -#if KDE_IS_VERSION(4,4,0) if (i != m_locale->monetaryDecimalPlaces()) group.writeEntry("FracDigits", m_locale->monetaryDecimalPlaces(), KConfig::Persistent|KConfig::Global); -#else - if (i != m_locale->fracDigits()) - group.writeEntry("FracDigits", m_locale->fracDigits(), KConfig::Persistent|KConfig::Global); -#endif b = entGrp.readEntry("PositivePrefixCurrencySymbol", true); group.deleteEntry("PositivePrefixCurrencySymbol", KConfig::Persistent | KConfig::Global); @@ -186,11 +181,7 @@ void LocaleConfigMoney::slotLocaleChanged() m_edMonCurSym->setText( m_locale->currencySymbol() ); /* m_edMonDecSym->setText( m_locale->monetaryDecimalSymbol() ); m_edMonThoSep->setText( m_locale->monetaryThousandsSeparator() );*/ -#if KDE_IS_VERSION(4,4,0) m_inMonFraDig->setValue(m_locale->monetaryDecimalPlaces()); -#else - m_inMonFraDig->setValue( m_locale->fracDigits() ); -#endif m_chMonPosPreCurSym->setChecked( m_locale->positivePrefixCurrencySymbol() ); m_chMonNegPreCurSym->setChecked( m_locale->negativePrefixCurrencySymbol() ); @@ -350,11 +341,7 @@ MacroCommand *LocaleConfigMoney::buildCommand() if ( m_locale->currencySymbol() != m_edMonCurSym->text() ) { m->addCommand( new ModifyCurrencySymolCmd( m_locale, m_edMonCurSym->text() ) ); } -#if KDE_IS_VERSION(4,4,0) if (m_locale->monetaryDecimalPlaces() != m_inMonFraDig->value()) { -#else - if ( m_locale->fracDigits() != m_inMonFraDig->value() ) { -#endif m->addCommand( new ModifyCurrencyFractionalDigitsCmd( m_locale, m_inMonFraDig->value() ) ); } if ( m_locale->positivePrefixCurrencySymbol() != m_chMonPosPreCurSym->isChecked() ) { diff --git a/plan/plugins/scripting/ScriptingPart.cpp b/plan/plugins/scripting/ScriptingPart.cpp index c198e46..e6d6004 100644 --- a/plan/plugins/scripting/ScriptingPart.cpp +++ b/plan/plugins/scripting/ScriptingPart.cpp @@ -41,11 +41,7 @@ #include <kptview.h> int planScriptingDebugArea() { -#if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "plan (Scripting)" ); -#else - static int s_area = 32010; -#endif return s_area; } diff --git a/plan/workpackage/debugarea.cpp b/plan/workpackage/debugarea.cpp index 725007b..f7b52ba 100644 --- a/plan/workpackage/debugarea.cpp +++ b/plan/workpackage/debugarea.cpp @@ -21,10 +21,6 @@ #include <kdeversion.h> int planworkDbg() { -#if KDE_IS_VERSION( 4, 3, 80 ) static int s_area = KDebug::registerArea( "planwork" ); -#else - static int s_area = 0; -#endif return s_area; } diff --git a/sheets/Localization.cpp b/sheets/Localization.cpp index 28caec1..04bd417 100644 --- a/sheets/Localization.cpp +++ b/sheets/Localization.cpp @@ -54,11 +54,7 @@ void Localization::load(const KoXmlElement& element) if (element.hasAttribute("negativeSign")) setNegativeSign(element.attribute("negativeSign")); if (element.hasAttribute("fracDigits")) -#if KDE_IS_VERSION(4,4,0) setMonetaryDecimalPlaces(element.attribute("fracDigits").toInt()); -#else - setFracDigits(element.attribute("fracDigits").toInt()); -#endif if (element.hasAttribute("positivePrefixCurrencySymbol")) { QString c = element.attribute("positivePrefixCurrencySymbol"); setPositivePrefixCurrencySymbol(c == "True"); @@ -91,11 +87,7 @@ QDomElement Localization::save(QDomDocument& doc) const element.setAttribute("monetaryThousandsSeparator", monetaryThousandsSeparator()); element.setAttribute("positiveSign", positiveSign()); element.setAttribute("negativeSign", negativeSign()); -#if KDE_IS_VERSION(4,4,0) element.setAttribute("fracDigits", monetaryDecimalPlaces()); -#else - element.setAttribute("fracDigits", fracDigits()); -#endif element.setAttribute("positivePrefixCurrencySymbol", positivePrefixCurrencySymbol() ? "True" : "False"); element.setAttribute("negativePrefixCurrencySymbol", negativePrefixCurrencySymbol() ? "True" : "False"); element.setAttribute("positiveMonetarySignPosition", (int)positiveMonetarySignPosition()); @@ -118,12 +110,8 @@ void Localization::defaultSystemConfig() setMonetaryThousandsSeparator(locale.monetaryThousandsSeparator()); setPositiveSign(locale.positiveSign()); setNegativeSign(locale.negativeSign()); -#if KDE_IS_VERSION(4,4,0) setMonetaryDecimalPlaces(locale.monetaryDecimalPlaces()); setDecimalPlaces(locale.decimalPlaces()); -#else - setFracDigits(locale.fracDigits()); -#endif setPositivePrefixCurrencySymbol(locale.positivePrefixCurrencySymbol()); setNegativePrefixCurrencySymbol(locale.negativePrefixCurrencySymbol()); setPositiveMonetarySignPosition(locale.positiveMonetarySignPosition()); diff --git a/sheets/ValueFormatter.cpp b/sheets/ValueFormatter.cpp index a9850da..d9ab9b4 100644 --- a/sheets/ValueFormatter.cpp +++ b/sheets/ValueFormatter.cpp @@ -597,16 +597,16 @@ QString ValueFormatter::dateFormat(const QDate &date, Format::Type fmtType, cons } else if (fmtType == Format::TextDate) { 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 += QString::number(date.year()).right(2); + tmp = QString().sprintf("%02d", date.day()) + + '-' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '-' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date2) { /*18-Feb-1999 */ - tmp = QString().sprintf("%02d", date.day()); - tmp += '-' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '-'; - tmp += QString::number(date.year()); + tmp = QString().sprintf("%02d", date.day()) + + '-' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '-' + QString::number(date.year()); } else if (fmtType == Format::Date3) { /*18-Feb */ - tmp = QString().sprintf("%02d", date.day()); - tmp += '-' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat); + tmp = QString().sprintf("%02d", date.day()) + + '-' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber); } else if (fmtType == Format::Date4) { /*18-05 */ tmp = QString().sprintf("%02d", date.day()); tmp += '-' + QString().sprintf("%02d", date.month()); @@ -619,43 +619,43 @@ QString ValueFormatter::dateFormat(const QDate &date, Format::Type fmtType, cons tmp += '/' + QString().sprintf("%02d", date.month()) + '/'; tmp += QString::number(date.year()); } else if (fmtType == Format::Date7) { /*Feb-99 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '-'; - tmp += QString::number(date.year()).right(2); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '-' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date8) { /*February-99 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::LongFormat) + '-'; - tmp += QString::number(date.year()).right(2); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::LongNumber) + + '-' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date9) { /*February-1999 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::LongFormat) + '-'; - tmp += QString::number(date.year()); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::LongNumber) + + '-' + QString::number(date.year()); } else if (fmtType == Format::Date10) { /*F-99 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::LongFormat).at(0) + '-'; - tmp += QString::number(date.year()).right(2); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::LongNumber).at(0) + + '-' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date11) { /*18/Feb */ - tmp = QString().sprintf("%02d", date.day()) + '/'; - tmp += m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat); + tmp = QString().sprintf("%02d", date.day()) + + '/' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber); } else if (fmtType == Format::Date12) { /*18/02 */ tmp = QString().sprintf("%02d", date.day()) + '/'; tmp += QString().sprintf("%02d", date.month()); } else if (fmtType == Format::Date13) { /*18/Feb/1999 */ - tmp = QString().sprintf("%02d", date.day()); - tmp += '/' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '/'; - tmp += QString::number(date.year()); + tmp = QString().sprintf("%02d", date.day()) + + '/' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString::number(date.year()); } else if (fmtType == Format::Date14) { /*2000/Feb/18 */ - tmp = QString::number(date.year()); - tmp += '/' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '/'; - tmp += QString().sprintf("%02d", date.day()); + tmp = QString::number(date.year()) + + '/' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString().sprintf("%02d", date.day()); } else if (fmtType == Format::Date15) { /*2000-Feb-18 */ - tmp = QString::number(date.year()); - tmp += '-' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '-'; - tmp += QString().sprintf("%02d", date.day()); + tmp = QString::number(date.year()) + + '-' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '-' + QString().sprintf("%02d", date.day()); } else if (fmtType == Format::Date16) { /*2000-02-18 */ tmp = QString::number(date.year()); tmp += '-' + QString().sprintf("%02d", date.month()) + '-'; tmp += QString().sprintf("%02d", date.day()); } else if (fmtType == Format::Date17) { /*2 february 2000 */ - tmp = QString().sprintf("%d", date.day()); - tmp += ' ' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::LongFormat) + ' '; - tmp += QString::number(date.year()); + tmp = QString().sprintf("%d", date.day()) + + ' ' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::LongNumber) + + ' ' + QString::number(date.year()); } else if (fmtType == Format::Date18) { /*02/18/1999 */ tmp = QString().sprintf("%02d", date.month()); tmp += '/' + QString().sprintf("%02d", date.day()); @@ -665,16 +665,16 @@ QString ValueFormatter::dateFormat(const QDate &date, Format::Type fmtType, cons tmp += '/' + QString().sprintf("%02d", date.day()); tmp += '/' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date20) { /*Feb/18/99 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat); - tmp += '/' + QString().sprintf("%02d", date.day()); - tmp += '/' + QString::number(date.year()).right(2); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString().sprintf("%02d", date.day()) + + '/' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date21) { /*Feb/18/1999 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat); - tmp += '/' + QString().sprintf("%02d", date.day()); - tmp += '/' + QString::number(date.year()); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString().sprintf("%02d", date.day()) + + '/' + QString::number(date.year()); } else if (fmtType == Format::Date22) { /*Feb-1999 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '-'; - tmp += QString::number(date.year()); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '-' + QString::number(date.year()); } else if (fmtType == Format::Date23) { /*1999 */ tmp = QString::number(date.year()); } else if (fmtType == Format::Date24) { /*99 */ @@ -684,21 +684,21 @@ QString ValueFormatter::dateFormat(const QDate &date, Format::Type fmtType, cons tmp += '/' + QString().sprintf("%02d", date.month()); tmp += '/' + QString().sprintf("%02d", date.day()); } else if (fmtType == Format::Date26) { /*2000/Feb/18 */ - tmp = QString::number(date.year()); - tmp += '/' + m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat); - tmp += '/' + QString().sprintf("%02d", date.day()); + tmp = QString::number(date.year()) + + '/' + m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString().sprintf("%02d", date.day()); } else if (fmtType == Format::Date27) { /*Feb/99 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '/'; - tmp += QString::number(date.year()).right(2); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date28) { /*Feb/1999 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::ShortFormat) + '/'; - tmp += QString::number(date.year()); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::ShortNumber) + + '/' + QString::number(date.year()); } else if (fmtType == Format::Date29) { /*February/99 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::LongFormat) + '/'; - tmp += QString::number(date.year()).right(2); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::LongNumber) + + '/' + QString::number(date.year()).right(2); } else if (fmtType == Format::Date30) { /*February/1999 */ - tmp = m_converter->settings()->locale()->calendar()->monthString(date, KCalendarSystem::LongFormat) + '/'; - tmp += QString::number(date.year()); + tmp = m_converter->settings()->locale()->calendar()->formatDate(date, KLocale::Month, KLocale::LongNumber) + + '/' + QString::number(date.year()); } else if (fmtType == Format::Date31) { /*18-02 */ tmp = QString().sprintf("%02d", date.day()) + '-'; tmp += QString().sprintf("%02d", date.month()); diff --git a/sheets/plugins/calendar/CalendarTool.cpp b/sheets/plugins/calendar/CalendarTool.cpp index 00950e3..71c4332 100644 --- a/sheets/plugins/calendar/CalendarTool.cpp +++ b/sheets/plugins/calendar/CalendarTool.cpp @@ -107,7 +107,7 @@ void CalendarTool::insertCalendar(const QDate &start, const QDate &end) } } - KCalendarSystem* cs = KCalendarSystem::create(); + KCalendarSystem *cs = KCalendarSystem::create(KLocale::GregorianCalendar); Q_ASSERT(cs); @@ -146,7 +146,7 @@ void CalendarTool::insertCalendar(const QDate &start, const QDate &end) if (yearheader) { kDebug() << "inserting year" + QString::number(current.year()); - setText(sheet, row, colstart + 6, cs->yearString(current, KCalendarSystem::LongFormat)); + setText(sheet, row, colstart + 6, cs->formatDate(current, KLocale::Year, KLocale::LongNumber)); row += 2; yearheader = false; @@ -164,7 +164,12 @@ void CalendarTool::insertCalendar(const QDate &start, const QDate &end) monthheader = false; } if (weekheader) { - setText(sheet, row, colstart, QString::number(cs->weekNumber(current))); + setText(sheet, row, colstart, +#if KDE_IS_VERSION(4,7,0) + QString::number(cs->week(current))); +#else + QString::number(cs->weekNumber(current))); +#endif col++; weekheader = false; diff --git a/sheets/ui/CellToolBase.cpp b/sheets/ui/CellToolBase.cpp index ac0a43f..7591d7a 100644 --- a/sheets/ui/CellToolBase.cpp +++ b/sheets/ui/CellToolBase.cpp @@ -2015,11 +2015,7 @@ void CellToolBase::currency(bool enable) command->setSheet(selection()->activeSheet()); command->setText(i18nc("(qtundo-format)", "Format Money")); command->setFormatType(enable ? Format::Money : Format::Generic); -#if KDE_IS_VERSION(4,4,0) command->setPrecision(enable ? selection()->activeSheet()->map()->calculationSettings()->locale()->monetaryDecimalPlaces() : 0); -#else - command->setPrecision(enable ? selection()->activeSheet()->map()->calculationSettings()->locale()->fracDigits() : 0); -#endif command->add(*selection()); command->execute(canvas()); diff --git a/sheets/ui/CellToolBase_p.cpp b/sheets/ui/CellToolBase_p.cpp index aa4312f..93265be 100644 --- a/sheets/ui/CellToolBase_p.cpp +++ b/sheets/ui/CellToolBase_p.cpp @@ -753,11 +753,7 @@ bool CellToolBase::Private::formatKeyPress(QKeyEvent * _ev) case Qt::Key_Dollar: command->setText(i18nc("(qtundo-format)", "Currency Format")); command->setFormatType(Format::Money); -#if KDE_IS_VERSION(4,4,0) command->setPrecision(q->selection()->activeSheet()->map()->calculationSettings()->locale()->monetaryDecimalPlaces()); -#else - command->setPrecision(q->selection()->activeSheet()->map()->calculationSettings()->locale()->fracDigits()); -#endif break; case Qt::Key_Percent: diff --git a/tools/calligra/main.cpp b/tools/calligra/main.cpp index cc30ffa..44590db 100644 --- a/tools/calligra/main.cpp +++ b/tools/calligra/main.cpp @@ -117,11 +117,7 @@ static int handleUrls(const KCmdLineArgs *args) foreach (KService::Ptr service, mimeServices) { //kDebug() << "-" << service->name() << service->property("X-DBUS-ServiceName", QVariant::String); kDebug() << "-" << service->name() << service->hasServiceType("Calligra/Application") -#if KDE_IS_VERSION( 4, 6, 0 ) << service->hasMimeType(mimetype->name()); -#else - << service->hasMimeType(mimetype.data()); -#endif //QVariant isCalligraApp = service->property("X-Calligra-App", QVariant::Bool); /*if (isCalligraApp.isValid() && isCalligraApp.toBool()) { kDebug() << "FOUND:" << service->name(); _______________________________________________ calligra-devel mailing list calligra-devel@kde.org https://mail.kde.org/mailman/listinfo/calligra-devel