mirror of
https://bitbucket.org/smil3y/kdelibs.git
synced 2025-02-24 02:42:48 +00:00

is interesting how much simpler it can be by assuming that the tags are strict and by using Qt::mightBeRichText() for the rich text detection. while mostly compatible (entities are not converted, some tags were not used and some even did not do anything) it is subject to optimization by using QStringMatcher or other tricks (like using a separate tag for the numbers precision) overall - no regular expression matching, no XML parser is used and does what the old implementation was doing but with less code. also passes most tests (the exception is KLocalizedString test case that expect entities to be replaced) Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
280 lines
10 KiB
Text
280 lines
10 KiB
Text
// This file is generated by kconfig_compiler from test11.kcfg.
|
|
// All changes you do to this file will be lost.
|
|
|
|
#include "test11.h"
|
|
|
|
#include <klocale.h>
|
|
|
|
Test11::Test11( )
|
|
: MyPrefs( QLatin1String( "korganizerrc" ) )
|
|
{
|
|
setCurrentGroup( QLatin1String( "General" ) );
|
|
|
|
mAutoSaveItem = new MyPrefs::ItemBool( currentGroup(), QLatin1String( "Auto Save" ), mAutoSave, false );
|
|
mAutoSaveItem->setLabel( i18n("Enable automatic saving of calendar") );
|
|
mAutoSaveItem->setWhatsThis( i18n("WhatsThis text for AutoSave option") );
|
|
addItem( mAutoSaveItem, QLatin1String( "AutoSave" ) );
|
|
mAutoSaveIntervalItem = new MyPrefs::ItemInt( currentGroup(), QLatin1String( "Auto Save Interval" ), mAutoSaveInterval, 10 );
|
|
mAutoSaveIntervalItem->setLabel( i18n("Auto Save Interval") );
|
|
addItem( mAutoSaveIntervalItem, QLatin1String( "AutoSaveInterval" ) );
|
|
mConfirmItem = new MyPrefs::ItemBool( currentGroup(), QLatin1String( "Confirm Deletes" ), mConfirm, true );
|
|
mConfirmItem->setLabel( i18n("Confirm deletes") );
|
|
addItem( mConfirmItem, QLatin1String( "Confirm" ) );
|
|
mArchiveFileItem = new MyPrefs::ItemString( currentGroup(), QLatin1String( "Archive File" ), mArchiveFile );
|
|
mArchiveFileItem->setLabel( i18n("Archive File") );
|
|
addItem( mArchiveFileItem, QLatin1String( "ArchiveFile" ) );
|
|
QList<MyPrefs::ItemEnum::Choice> valuesDestination;
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("standardDestination");
|
|
valuesDestination.append( choice );
|
|
}
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("askDestination");
|
|
valuesDestination.append( choice );
|
|
}
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("argl1");
|
|
choice.label = i18n("Argl1 Label");
|
|
valuesDestination.append( choice );
|
|
}
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("argl2");
|
|
choice.whatsThis = i18n("Argl2 Whatsthis");
|
|
valuesDestination.append( choice );
|
|
}
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("argl3");
|
|
choice.label = i18n("Argl3 Label");
|
|
choice.whatsThis = i18n("Argl3 Whatsthis");
|
|
valuesDestination.append( choice );
|
|
}
|
|
mDestinationItem = new MyPrefs::ItemEnum( currentGroup(), QLatin1String( "Destination" ), mDestination, valuesDestination, EnumDestination::standardDestination );
|
|
mDestinationItem->setLabel( i18n("New Events/Todos Should") );
|
|
addItem( mDestinationItem, QLatin1String( "Destination" ) );
|
|
|
|
setCurrentGroup( QLatin1String( "Views" ) );
|
|
|
|
mHourSizeItem = new MyPrefs::ItemInt( currentGroup(), QLatin1String( "Hour Size" ), mHourSize, 10 );
|
|
mHourSizeItem->setLabel( i18n("Hour Size") );
|
|
addItem( mHourSizeItem, QLatin1String( "HourSize" ) );
|
|
mSelectionStartsEditorItem = new MyPrefs::ItemBool( currentGroup(), QLatin1String( "SelectionStartsEditor" ), mSelectionStartsEditor, false );
|
|
mSelectionStartsEditorItem->setLabel( i18n("Time range selection in agenda view starts event editor") );
|
|
addItem( mSelectionStartsEditorItem, QLatin1String( "SelectionStartsEditor" ) );
|
|
|
|
setCurrentGroup( QLatin1String( "KOrganizer Plugins" ) );
|
|
|
|
QStringList defaultSelectedPlugins;
|
|
defaultSelectedPlugins.append( QString::fromUtf8( "holidays" ) );
|
|
defaultSelectedPlugins.append( QString::fromUtf8( "webexport" ) );
|
|
|
|
mSelectedPluginsItem = new MyPrefs::ItemStringList( currentGroup(), QLatin1String( "SelectedPlugins" ), mSelectedPlugins, defaultSelectedPlugins );
|
|
mSelectedPluginsItem->setLabel( i18n("SelectedPlugins") );
|
|
addItem( mSelectedPluginsItem, QLatin1String( "SelectedPlugins" ) );
|
|
|
|
setCurrentGroup( QLatin1String( "Colors" ) );
|
|
|
|
mHighlightColorItem = new MyPrefs::ItemColor( currentGroup(), QLatin1String( "Highlight Color" ), mHighlightColor, QColor( 100, 100, 255 ) );
|
|
mHighlightColorItem->setLabel( i18n("Highlight color") );
|
|
addItem( mHighlightColorItem, QLatin1String( "HighlightColor" ) );
|
|
mAgendaBgColorItem = new MyPrefs::ItemColor( currentGroup(), QLatin1String( "Agenda Background Color" ), mAgendaBgColor, QColor( 255, 255, 255 ) );
|
|
mAgendaBgColorItem->setLabel( i18n("Agenda view background color") );
|
|
addItem( mAgendaBgColorItem, QLatin1String( "AgendaBgColor" ) );
|
|
|
|
setCurrentGroup( QLatin1String( "Fonts" ) );
|
|
|
|
mTimeBarFontItem = new MyPrefs::ItemFont( currentGroup(), QLatin1String( "TimeBar Font" ), mTimeBarFont );
|
|
mTimeBarFontItem->setLabel( i18n("Time bar") );
|
|
addItem( mTimeBarFontItem, QLatin1String( "TimeBarFont" ) );
|
|
|
|
setCurrentGroup( QLatin1String( "Email" ) );
|
|
|
|
QList<MyPrefs::ItemEnum::Choice> valuesEmailClient;
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("sendmail");
|
|
choice.label = i18nc("@option", "Sendmail");
|
|
valuesEmailClient.append( choice );
|
|
}
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("kmail");
|
|
choice.label = i18nc("@option", "KMail");
|
|
valuesEmailClient.append( choice );
|
|
}
|
|
mEmailClientItem = new MyPrefs::ItemEnum( currentGroup(), QLatin1String( "EmailClient" ), mEmailClient, valuesEmailClient, kmail );
|
|
mEmailClientItem->setLabel( i18nc("@label", "Email client") );
|
|
mEmailClientItem->setWhatsThis( i18nc("@info:whatsthis", "<para>How to send email when an email alarm is triggered.<para>KMail: The email is sent automatically via <application>KMail</application>. <application>KMail</application> is started first if necessary.</para><para>Sendmail: The email is sent automatically. This option will only work if your system is configured to use <application>sendmail</application> or a sendmail compatible mail transport agent.</para></para>") );
|
|
addItem( mEmailClientItem, QLatin1String( "EmailClient" ) );
|
|
QList<MyPrefs::ItemEnum::Choice> valuesDefaultReminderUnits;
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("Minutes");
|
|
valuesDefaultReminderUnits.append( choice );
|
|
}
|
|
{
|
|
MyPrefs::ItemEnum::Choice choice;
|
|
choice.name = QLatin1String("HoursMinutes");
|
|
choice.label = i18nc("@option", "Hours/Minutes");
|
|
valuesDefaultReminderUnits.append( choice );
|
|
}
|
|
mDefaultReminderUnitsItem = new MyPrefs::ItemEnum( currentGroup(), QLatin1String( "RemindUnits" ), mDefaultReminderUnits, valuesDefaultReminderUnits, TimePeriod::HoursMinutes );
|
|
mDefaultReminderUnitsItem->setLabel( i18nc("@label", "Reminder units") );
|
|
mDefaultReminderUnitsItem->setToolTip( i18nc("@info:tooltip", "Default reminder time units in the alarm edit dialog.") );
|
|
mDefaultReminderUnitsItem->setWhatsThis( i18nc("@info:whatsthis", "Default reminder time units in the alarm edit dialog.") );
|
|
addItem( mDefaultReminderUnitsItem, QLatin1String( "DefaultReminderUnits" ) );
|
|
|
|
setCurrentGroup( QLatin1String( "QueueRates" ) );
|
|
|
|
QList< QList<int> > defaultRate;
|
|
QList< int > defaultRateInit;
|
|
|
|
defaultRateInit.append( 15 );
|
|
defaultRateInit.append( 60 );
|
|
defaultRateInit.append( 0 );
|
|
defaultRate.append( defaultRateInit );
|
|
|
|
defaultRateInit.clear();
|
|
defaultRateInit.append( 40 );
|
|
defaultRateInit.append( 60 );
|
|
defaultRateInit.append( 0 );
|
|
defaultRate.append( defaultRateInit );
|
|
|
|
defaultRateInit.clear();
|
|
defaultRateInit.append( 1 );
|
|
defaultRateInit.append( 1 );
|
|
defaultRateInit.append( 0 );
|
|
defaultRate.append( defaultRateInit );
|
|
|
|
QList<int> defaultqueueRate;
|
|
|
|
mQueueRateItem[0] = new MyPrefs::ItemIntList( currentGroup(), QLatin1String( "EmptyingRate 0" ), mQueueRate[0], defaultRate[0] );
|
|
mQueueRateItem[0]->setLabel( i18n("EmptyingRate queueRate$(QueueIndex)") );
|
|
addItem( mQueueRateItem[0], QLatin1String( "queueRate0" ) );
|
|
mQueueRateItem[1] = new MyPrefs::ItemIntList( currentGroup(), QLatin1String( "EmptyingRate 1" ), mQueueRate[1], defaultqueueRate );
|
|
mQueueRateItem[1]->setLabel( i18n("EmptyingRate queueRate$(QueueIndex)") );
|
|
addItem( mQueueRateItem[1], QLatin1String( "queueRate1" ) );
|
|
mQueueRateItem[2] = new MyPrefs::ItemIntList( currentGroup(), QLatin1String( "EmptyingRate 2" ), mQueueRate[2], defaultRate[2] );
|
|
mQueueRateItem[2]->setLabel( i18n("EmptyingRate queueRate$(QueueIndex)") );
|
|
addItem( mQueueRateItem[2], QLatin1String( "queueRate2" ) );
|
|
mShowQueueTunerItem = new MyPrefs::ItemBool( currentGroup(), QLatin1String( "ShowQueueTuner" ), mShowQueueTuner, false );
|
|
mShowQueueTunerItem->setLabel( i18n("ShowQueueTuner") );
|
|
addItem( mShowQueueTunerItem, QLatin1String( "ShowQueueTuner" ) );
|
|
}
|
|
|
|
bool Test11::defaultAutoSaveValue_helper() const
|
|
{
|
|
|
|
return false;
|
|
}
|
|
|
|
int Test11::defaultAutoSaveIntervalValue_helper() const
|
|
{
|
|
|
|
return 10;
|
|
}
|
|
|
|
bool Test11::defaultConfirmValue_helper() const
|
|
{
|
|
|
|
return true;
|
|
}
|
|
|
|
int Test11::defaultDestinationValue_helper() const
|
|
{
|
|
|
|
return EnumDestination::standardDestination;
|
|
}
|
|
|
|
int Test11::defaultHourSizeValue_helper() const
|
|
{
|
|
|
|
return 10;
|
|
}
|
|
|
|
bool Test11::defaultSelectionStartsEditorValue_helper() const
|
|
{
|
|
|
|
return false;
|
|
}
|
|
|
|
QStringList Test11::defaultSelectedPluginsValue_helper() const
|
|
{
|
|
QStringList defaultSelectedPlugins;
|
|
defaultSelectedPlugins.append( QString::fromUtf8( "holidays" ) );
|
|
defaultSelectedPlugins.append( QString::fromUtf8( "webexport" ) );
|
|
|
|
return defaultSelectedPlugins;
|
|
}
|
|
|
|
QColor Test11::defaultHighlightColorValue_helper() const
|
|
{
|
|
|
|
return QColor( 100, 100, 255 );
|
|
}
|
|
|
|
QColor Test11::defaultAgendaBgColorValue_helper() const
|
|
{
|
|
|
|
return QColor( 255, 255, 255 );
|
|
}
|
|
|
|
int Test11::defaultEmailClientValue_helper() const
|
|
{
|
|
|
|
return kmail;
|
|
}
|
|
|
|
int Test11::defaultDefaultReminderUnitsValue_helper() const
|
|
{
|
|
|
|
return TimePeriod::HoursMinutes;
|
|
}
|
|
|
|
QList<int> Test11::defaultQueueRateValue_helper( int i ) const
|
|
{
|
|
QList< QList<int> > defaultRate;
|
|
QList< int > defaultRateInit;
|
|
|
|
defaultRateInit.append( 15 );
|
|
defaultRateInit.append( 60 );
|
|
defaultRateInit.append( 0 );
|
|
defaultRate.append( defaultRateInit );
|
|
|
|
defaultRateInit.clear();
|
|
defaultRateInit.append( 40 );
|
|
defaultRateInit.append( 60 );
|
|
defaultRateInit.append( 0 );
|
|
defaultRate.append( defaultRateInit );
|
|
|
|
defaultRateInit.clear();
|
|
defaultRateInit.append( 1 );
|
|
defaultRateInit.append( 1 );
|
|
defaultRateInit.append( 0 );
|
|
defaultRate.append( defaultRateInit );
|
|
|
|
QList<int> defaultqueueRate;
|
|
|
|
switch (i) {
|
|
case 0: return defaultRate[0];
|
|
case 2: return defaultRate[2];
|
|
default:
|
|
return defaultqueueRate;
|
|
}
|
|
|
|
}
|
|
|
|
bool Test11::defaultShowQueueTunerValue_helper() const
|
|
{
|
|
|
|
return false;
|
|
}
|
|
|
|
Test11::~Test11()
|
|
{
|
|
}
|
|
|