diff --git a/cmake/modules/KDE4Macros.cmake b/cmake/modules/KDE4Macros.cmake index ba19425f..c769c5c3 100644 --- a/cmake/modules/KDE4Macros.cmake +++ b/cmake/modules/KDE4Macros.cmake @@ -77,7 +77,7 @@ macro(KDE4_ADD_KCFG_FILES _sources ) ) if(_kcfg_generatemoc) - qt4_generate_moc(${_header_FILE} ${_moc_FILE} ) + qt4_generate_moc(${_header_FILE} ${_moc_FILE}) set_source_files_properties(${_src_FILE} PROPERTIES SKIP_AUTOMOC TRUE) list(APPEND ${_sources} ${_moc_FILE}) endif() diff --git a/kdecore/config/kcoreconfigskeleton.cpp b/kdecore/config/kcoreconfigskeleton.cpp index dcb49304..ebdbfb3c 100644 --- a/kdecore/config/kcoreconfigskeleton.cpp +++ b/kdecore/config/kcoreconfigskeleton.cpp @@ -436,18 +436,7 @@ KCoreConfigSkeleton::ItemEnum::ItemEnum( const QString &_group, const QString &_ qint32 defaultValue ) : ItemInt( _group, _key, reference, defaultValue ) { - foreach (const ItemEnum::Choice &c, choices) { - ItemEnum::Choice2 cc = { c.name, c.label, QString(), c.whatsThis }; - mChoices.append(cc); - } -} - -KCoreConfigSkeleton::ItemEnum::ItemEnum( const QString &_group, const QString &_key, - qint32 &reference, - const QList &choices, - qint32 defaultValue ) - : ItemInt( _group, _key, reference, defaultValue ), mChoices(choices) -{ + mChoices = choices; } void KCoreConfigSkeleton::ItemEnum::readConfig( KConfig *config ) @@ -462,7 +451,7 @@ void KCoreConfigSkeleton::ItemEnum::readConfig( KConfig *config ) int i = 0; mReference = -1; QString tmp = cg.readEntry( mKey, QString() ).toLower(); - for(QList::ConstIterator it = mChoices.constBegin(); + for(QList::ConstIterator it = mChoices.constBegin(); it != mChoices.constEnd(); ++it, ++i) { if ((*it).name.toLower() == tmp) @@ -494,16 +483,6 @@ void KCoreConfigSkeleton::ItemEnum::writeConfig( KConfig *config ) } QList KCoreConfigSkeleton::ItemEnum::choices() const -{ - QList r; - foreach (const KCoreConfigSkeleton::ItemEnum::Choice2 &c, mChoices) { - KCoreConfigSkeleton::ItemEnum::Choice cc = { c.name, c.label, c.whatsThis }; - r.append(cc); - } - return r; -} - -QList KCoreConfigSkeleton::ItemEnum::choices2() const { return mChoices; } diff --git a/kdecore/config/kcoreconfigskeleton.h b/kdecore/config/kcoreconfigskeleton.h index c52ee6be..aa6cc4cf 100644 --- a/kdecore/config/kcoreconfigskeleton.h +++ b/kdecore/config/kcoreconfigskeleton.h @@ -601,7 +601,6 @@ public: class KDECORE_EXPORT ItemEnum:public ItemInt { public: - //KDE5: remove the old Choice struct, rename Choice2 to Choice struct Choice { QString name; @@ -609,28 +608,13 @@ public: QString whatsThis; }; - struct Choice2 - { - QString name; - QString label; - QString toolTip; - QString whatsThis; - }; - /** @copydoc KConfigSkeletonGenericItem::KConfigSkeletonGenericItem @param choices The list of enums that can be stored in this item */ ItemEnum(const QString & _group, const QString & _key, qint32 &reference, const QList &choices, qint32 defaultValue = 0); - /** @copydoc KConfigSkeletonGenericItem::KConfigSkeletonGenericItem - @param choices The list of enums that can be stored in this item - */ - ItemEnum(const QString & _group, const QString & _key, qint32 &reference, - const QList &choices, qint32 defaultValue = 0); - QList choices() const; - QList choices2() const; /** @copydoc KConfigSkeletonItem::readConfig(KConfig*) */ void readConfig(KConfig * config); @@ -639,7 +623,7 @@ public: void writeConfig(KConfig * config); private: - QList mChoices; + QList mChoices; }; diff --git a/kdecore/kconfig_compiler/kcfg.xsd b/kdecore/kconfig_compiler/kcfg.xsd index 4926fb19..f50520e6 100644 --- a/kdecore/kconfig_compiler/kcfg.xsd +++ b/kdecore/kconfig_compiler/kcfg.xsd @@ -81,7 +81,6 @@ - @@ -90,7 +89,6 @@ - diff --git a/kdecore/kconfig_compiler/kconfig_compiler.cpp b/kdecore/kconfig_compiler/kconfig_compiler.cpp index 5d29efec..4814e952 100644 --- a/kdecore/kconfig_compiler/kconfig_compiler.cpp +++ b/kdecore/kconfig_compiler/kconfig_compiler.cpp @@ -190,7 +190,6 @@ class CfgEntry QString name; QString context; QString label; - QString toolTip; QString whatsThis; }; class Choices @@ -718,10 +717,6 @@ CfgEntry *parseEntry( const QString &group, const QDomElement &element, const Cf choice.label = e3.text(); choice.context = e3.attribute( "context" ); } - if ( e3.tagName() == "tooltip" ) { - choice.toolTip = e3.text(); - choice.context = e3.attribute( "context" ); - } if ( e3.tagName() == "whatsthis" ) { choice.whatsThis = e3.text(); choice.context = e3.attribute( "context" ); @@ -2072,13 +2067,13 @@ int main( int argc, char **argv ) cpp << (*itEntry)->code() << endl; } if ( (*itEntry)->type() == "Enum" ) { - cpp << " QList<"+cfg.inherits+"::ItemEnum::Choice2> values" + cpp << " QList<"+cfg.inherits+"::ItemEnum::Choice> values" << (*itEntry)->name() << ";" << endl; const QList choices = (*itEntry)->choices().choices; QList::ConstIterator it; for( it = choices.constBegin(); it != choices.constEnd(); ++it ) { cpp << " {" << endl; - cpp << " "+cfg.inherits+"::ItemEnum::Choice2 choice;" << endl; + cpp << " "+cfg.inherits+"::ItemEnum::Choice choice;" << endl; cpp << " choice.name = QLatin1String(\"" << (*it).name << "\");" << endl; if ( cfg.setUserTexts ) { if ( !(*it).label.isEmpty() ) { @@ -2089,14 +2084,6 @@ int main( int argc, char **argv ) cpp << "i18n("; cpp << quoteString((*it).label) << ");" << endl; } - if ( !(*it).toolTip.isEmpty() ) { - cpp << " choice.toolTip = "; - if ( !(*it).context.isEmpty() ) - cpp << "i18nc(" + quoteString((*it).context) + ", "; - else - cpp << "i18n("; - cpp << quoteString((*it).toolTip) << ");" << endl; - } if ( !(*it).whatsThis.isEmpty() ) { cpp << " choice.whatsThis = "; if ( !(*it).context.isEmpty() ) diff --git a/kdeui/tests/kconfig_compiler/test1.cpp.ref b/kdeui/tests/kconfig_compiler/test1.cpp.ref index 2f2977c1..611ce5c1 100644 --- a/kdeui/tests/kconfig_compiler/test1.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test1.cpp.ref @@ -16,19 +16,19 @@ Test1::Test1( const QString & transport, const QString & folder ) KConfigSkeleton::ItemInt *itemAnotherOption; itemAnotherOption = new KConfigSkeleton::ItemInt( currentGroup(), QLatin1String( "Another Option" ), mAnotherOption, 5 ); addItem( itemAnotherOption, QLatin1String( "AnotherOption" ) ); - QList valuesListOption; + QList valuesListOption; { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("One"); valuesListOption.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("Two"); valuesListOption.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("Three"); valuesListOption.append( choice ); } diff --git a/kdeui/tests/kconfig_compiler/test11.cpp.ref b/kdeui/tests/kconfig_compiler/test11.cpp.ref index d5b04d07..aa3b8669 100644 --- a/kdeui/tests/kconfig_compiler/test11.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test11.cpp.ref @@ -23,31 +23,31 @@ Test11::Test11( ) mArchiveFileItem = new MyPrefs::ItemString( currentGroup(), QLatin1String( "Archive File" ), mArchiveFile ); mArchiveFileItem->setLabel( i18n("Archive File") ); addItem( mArchiveFileItem, QLatin1String( "ArchiveFile" ) ); - QList valuesDestination; + QList valuesDestination; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("standardDestination"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("askDestination"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl1"); choice.label = i18n("Argl1 Label"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl2"); choice.whatsThis = i18n("Argl2 Whatsthis"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl3"); choice.label = i18n("Argl3 Label"); choice.whatsThis = i18n("Argl3 Whatsthis"); @@ -93,15 +93,15 @@ Test11::Test11( ) setCurrentGroup( QLatin1String( "Email" ) ); - QList valuesEmailClient; + QList valuesEmailClient; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("sendmail"); choice.label = i18nc("@option", "Sendmail"); valuesEmailClient.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("kmail"); choice.label = i18nc("@option", "KMail"); valuesEmailClient.append( choice ); @@ -110,14 +110,14 @@ Test11::Test11( ) mEmailClientItem->setLabel( i18nc("@label", "Email client") ); mEmailClientItem->setWhatsThis( i18nc("@info:whatsthis", "How to send email when an email alarm is triggered.KMail: The email is sent automatically via KMail. KMail is started first if necessary.Sendmail: The email is sent automatically. This option will only work if your system is configured to use sendmail or a sendmail compatible mail transport agent.") ); addItem( mEmailClientItem, QLatin1String( "EmailClient" ) ); - QList valuesDefaultReminderUnits; + QList valuesDefaultReminderUnits; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("Minutes"); valuesDefaultReminderUnits.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("HoursMinutes"); choice.label = i18nc("@option", "Hours/Minutes"); valuesDefaultReminderUnits.append( choice ); diff --git a/kdeui/tests/kconfig_compiler/test11a.cpp.ref b/kdeui/tests/kconfig_compiler/test11a.cpp.ref index 62e61a3b..7951cd09 100644 --- a/kdeui/tests/kconfig_compiler/test11a.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test11a.cpp.ref @@ -23,31 +23,31 @@ Test11a::Test11a( ) mArchiveFileItem = new MyPrefs::ItemString( currentGroup(), QLatin1String( "Archive File" ), mArchiveFile ); mArchiveFileItem->setLabel( i18n("Archive File") ); addItem( mArchiveFileItem, QLatin1String( "ArchiveFile" ) ); - QList valuesDestination; + QList valuesDestination; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("standardDestination"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("askDestination"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl1"); choice.label = i18n("Argl1 Label"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl2"); choice.whatsThis = i18n("Argl2 Whatsthis"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl3"); choice.label = i18n("Argl3 Label"); choice.whatsThis = i18n("Argl3 Whatsthis"); @@ -93,15 +93,15 @@ Test11a::Test11a( ) setCurrentGroup( QLatin1String( "Email" ) ); - QList valuesEmailClient; + QList valuesEmailClient; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("sendmail"); choice.label = i18nc("@option", "Sendmail"); valuesEmailClient.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("kmail"); choice.label = i18nc("@option", "KMail"); valuesEmailClient.append( choice ); @@ -110,14 +110,14 @@ Test11a::Test11a( ) mEmailClientItem->setLabel( i18nc("@label", "Email client") ); mEmailClientItem->setWhatsThis( i18nc("@info:whatsthis", "How to send email when an email alarm is triggered.KMail: The email is sent automatically via KMail. KMail is started first if necessary.Sendmail: The email is sent automatically. This option will only work if your system is configured to use sendmail or a sendmail compatible mail transport agent.") ); addItem( mEmailClientItem, QLatin1String( "EmailClient" ) ); - QList valuesDefaultReminderUnits; + QList valuesDefaultReminderUnits; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("Minutes"); valuesDefaultReminderUnits.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("HoursMinutes"); choice.label = i18nc("@option", "Hours/Minutes"); valuesDefaultReminderUnits.append( choice ); diff --git a/kdeui/tests/kconfig_compiler/test2.cpp.ref b/kdeui/tests/kconfig_compiler/test2.cpp.ref index e1fa9f7f..66f584ec 100644 --- a/kdeui/tests/kconfig_compiler/test2.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test2.cpp.ref @@ -23,31 +23,31 @@ Test2::Test2( ) mArchiveFileItem = new MyPrefs::ItemString( currentGroup(), QLatin1String( "Archive File" ), mArchiveFile ); mArchiveFileItem->setLabel( i18n("Archive File") ); addItem( mArchiveFileItem, QLatin1String( "ArchiveFile" ) ); - QList valuesDestination; + QList valuesDestination; { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("standardDestination"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("askDestination"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl1"); choice.label = i18n("Argl1 Label"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl2"); choice.whatsThis = i18n("Argl2 Whatsthis"); valuesDestination.append( choice ); } { - MyPrefs::ItemEnum::Choice2 choice; + MyPrefs::ItemEnum::Choice choice; choice.name = QLatin1String("argl3"); choice.label = i18n("Argl3 Label"); choice.whatsThis = i18n("Argl3 Whatsthis"); diff --git a/kdeui/tests/kconfig_compiler/test4.cpp.ref b/kdeui/tests/kconfig_compiler/test4.cpp.ref index 906052d5..65c7e055 100644 --- a/kdeui/tests/kconfig_compiler/test4.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test4.cpp.ref @@ -43,24 +43,24 @@ QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; addItem( itemColor[2], QLatin1String( "Color2" ) ); itemColor[3] = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "color #3" ), mColor[3], defaultColor[3] ); addItem( itemColor[3], QLatin1String( "Color3" ) ); - QList valuesMouseAction; + QList valuesMouseAction; { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("Encrypt"); valuesMouseAction.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("Decrypt"); valuesMouseAction.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("CrashNBurn"); valuesMouseAction.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("PumpNDump"); valuesMouseAction.append( choice ); } diff --git a/kdeui/tests/kconfig_compiler/test5.cpp.ref b/kdeui/tests/kconfig_compiler/test5.cpp.ref index d9f8ca1f..7fd85c4d 100644 --- a/kdeui/tests/kconfig_compiler/test5.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test5.cpp.ref @@ -43,24 +43,24 @@ QColor defaultColor[4] = { Qt::red, Qt::blue, Qt::green, Qt::black }; addItem( itemColor[2], QLatin1String( "Color2" ) ); itemColor[3] = new KConfigSkeleton::ItemColor( currentGroup(), QLatin1String( "color #3" ), mColor[3], defaultColor[3] ); addItem( itemColor[3], QLatin1String( "Color3" ) ); - QList valuesMouseAction; + QList valuesMouseAction; { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("Encrypt"); valuesMouseAction.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("Decrypt"); valuesMouseAction.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("CrashNBurn"); valuesMouseAction.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("PumpNDump"); valuesMouseAction.append( choice ); } diff --git a/kdeui/tests/kconfig_compiler/test_dpointer.cpp.ref b/kdeui/tests/kconfig_compiler/test_dpointer.cpp.ref index 5acdc477..32aa47eb 100644 --- a/kdeui/tests/kconfig_compiler/test_dpointer.cpp.ref +++ b/kdeui/tests/kconfig_compiler/test_dpointer.cpp.ref @@ -86,31 +86,31 @@ TestDPointer::TestDPointer( ) d->archiveFileItem = new KConfigSkeleton::ItemString( currentGroup(), QLatin1String( "Archive File" ), d->archiveFile ); d->archiveFileItem->setLabel( i18n("Archive File") ); addItem( d->archiveFileItem, QLatin1String( "ArchiveFile" ) ); - QList valuesDestination; + QList valuesDestination; { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("standardDestination"); valuesDestination.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("askDestination"); valuesDestination.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("argl1"); choice.label = i18n("Argl1 Label"); valuesDestination.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("argl2"); choice.whatsThis = i18n("Argl2 Whatsthis"); valuesDestination.append( choice ); } { - KConfigSkeleton::ItemEnum::Choice2 choice; + KConfigSkeleton::ItemEnum::Choice choice; choice.name = QLatin1String("argl3"); choice.label = i18n("Argl3 Label"); choice.whatsThis = i18n("Argl3 Whatsthis"); diff --git a/kdeui/tests/kconfigdialog_unittest.cpp b/kdeui/tests/kconfigdialog_unittest.cpp index 79c35e45..57a8323d 100644 --- a/kdeui/tests/kconfigdialog_unittest.cpp +++ b/kdeui/tests/kconfigdialog_unittest.cpp @@ -58,19 +58,19 @@ public: colorItem = new ItemColor( currentGroup(), QLatin1String( "Color" ), color, Qt::white ); addItem( colorItem, QLatin1String( "Color" ) ); - QList textValues; + QList textValues; { - ItemEnum::Choice2 choice; + ItemEnum::Choice choice; choice.name = QLatin1String("A"); textValues.append( choice ); } { - ItemEnum::Choice2 choice; + ItemEnum::Choice choice; choice.name = QLatin1String("B"); textValues.append( choice ); } { - ItemEnum::Choice2 choice; + ItemEnum::Choice choice; choice.name = QLatin1String("C"); textValues.append( choice ); }