diff --git a/src/sieveeditoremptytabwidgetlabel.cpp b/src/sieveeditoremptytabwidgetlabel.cpp index 29e70094416301f104990414bae73c310540b5c8..a0595895cfd376fd11630c1b5a3d726ad10b0cc4 100644 --- a/src/sieveeditoremptytabwidgetlabel.cpp +++ b/src/sieveeditoremptytabwidgetlabel.cpp @@ -35,12 +35,11 @@ void SieveEditorEmptyTabWidgetLabel::init() //TODO improve text QString placeholderText = QStringLiteral("" "
"); - const QMap map = { - {i18n("Debug a script:"), i18nc("These action in from menu tools submenu debug sieve script", "Tools > Debug Sieve Script")}, - {i18n("Create Rules Graphically:"), i18nc("Action is from menu tools, submenu autogenerate script", "Tools > Autogenerate script")}, - {i18n("Import script:"), i18nc("Action is from file menu, import submenu", "File > Import")}, - {i18n("Import Sieve Settings"), i18nc("Action is from tools menu, import IMAP settings", "Tools > Import IMAP settings")} - }; + QVector map; + map.append(placeHolderTextInfo(i18n("Import script:"), i18nc("Action is from file menu, import submenu", "File > Import"))); + map.append(placeHolderTextInfo(i18n("Create Rules Graphically:"), i18nc("Action is from menu tools, submenu autogenerate script", "Tools > Autogenerate script"))); + map.append(placeHolderTextInfo(i18n("Debug a script:"), i18nc("These action in from menu tools submenu debug sieve script", "Tools > Debug Sieve Script"))); + map.append(placeHolderTextInfo(i18n("Import Sieve Settings"), i18nc("Action is from tools menu, import IMAP settings", "Tools > Import IMAP settings"))); addInfo(placeholderText, map); placeholderText += QStringLiteral("
" "
" @@ -48,13 +47,11 @@ void SieveEditorEmptyTabWidgetLabel::init() setText(placeholderText); } -void SieveEditorEmptyTabWidgetLabel::addInfo(QString &placeholderText, const QMap &map) +void SieveEditorEmptyTabWidgetLabel::addInfo(QString &placeholderText, const QVector &map) { - QMap::const_iterator i = map.constBegin(); - while (i != map.constEnd()) { + for (int i = 0; i < map.size(); ++i) { placeholderText += QStringLiteral("
%1
" "
" - "
  • %2").arg(i.key(), i.value()); - ++i; + "
  • %2").arg(map.at(i).text, map.at(i).menuInfo); } } diff --git a/src/sieveeditoremptytabwidgetlabel.h b/src/sieveeditoremptytabwidgetlabel.h index 55fea18963776a985d5ec5b0c8ce6271efa80217..6293604318c341c7e977ebaed7b02fd610a75113 100644 --- a/src/sieveeditoremptytabwidgetlabel.h +++ b/src/sieveeditoremptytabwidgetlabel.h @@ -41,7 +41,7 @@ #define SIEVEEDITOREMPTYTABWIDGETLABEL_H #include -#include +#include class SieveEditorEmptyTabWidgetLabel : public QLabel { @@ -51,7 +51,24 @@ public: ~SieveEditorEmptyTabWidgetLabel(); private: - void addInfo(QString &placeholderText, const QMap &map); + struct placeHolderTextInfo { + placeHolderTextInfo() + { + + } + + placeHolderTextInfo(const QString &t, const QString &info) + : text(t), + menuInfo(info) + { + + } + + QString text; + QString menuInfo; + }; + + void addInfo(QString &placeholderText, const QVector &map); void init(); };