Differential D26003 Diff 71622 src/ksieveui/autocreatescripts/sieveconditions/sieveconditionaddress.cpp
Changeset View
Changeset View
Standalone View
Standalone View
src/ksieveui/autocreatescripts/sieveconditions/sieveconditionaddress.cpp
Show First 20 Lines • Show All 120 Lines • ▼ Show 20 Line(s) | 116 | while (element.readNextStartElement()) { | |||
---|---|---|---|---|---|
121 | } else if (tagName == QLatin1String("str")) { | 121 | } else if (tagName == QLatin1String("str")) { | ||
122 | if (indexStr == 0) { | 122 | if (indexStr == 0) { | ||
123 | SelectHeaderTypeComboBox *selectHeaderType = w->findChild<SelectHeaderTypeComboBox *>(QStringLiteral("headertypecombobox")); | 123 | SelectHeaderTypeComboBox *selectHeaderType = w->findChild<SelectHeaderTypeComboBox *>(QStringLiteral("headertypecombobox")); | ||
124 | selectHeaderType->setCode(element.readElementText()); | 124 | selectHeaderType->setCode(element.readElementText()); | ||
125 | } else if (indexStr == 1) { | 125 | } else if (indexStr == 1) { | ||
126 | AbstractRegexpEditorLineEdit *edit = w->findChild<AbstractRegexpEditorLineEdit *>(QStringLiteral("editaddress")); | 126 | AbstractRegexpEditorLineEdit *edit = w->findChild<AbstractRegexpEditorLineEdit *>(QStringLiteral("editaddress")); | ||
127 | edit->setCode(AutoCreateScriptUtil::quoteStr(element.readElementText())); | 127 | edit->setCode(AutoCreateScriptUtil::quoteStr(element.readElementText())); | ||
128 | } else { | 128 | } else { | ||
129 | tooManyArgument(tagName, indexStr, 2, error); | 129 | tooManyArguments(tagName, indexStr, 2, error); | ||
130 | qCDebug(LIBKSIEVE_LOG) << " SieveConditionAddress::setParamWidgetValue too many argument :" << index; | 130 | qCDebug(LIBKSIEVE_LOG) << " SieveConditionAddress::setParamWidgetValue too many argument :" << index; | ||
131 | } | 131 | } | ||
132 | ++indexStr; | 132 | ++indexStr; | ||
133 | } else if (tagName == QLatin1String("list")) { | 133 | } else if (tagName == QLatin1String("list")) { | ||
134 | if (indexStr == 0) { | 134 | if (indexStr == 0) { | ||
135 | SelectHeaderTypeComboBox *selectHeaderType = w->findChild<SelectHeaderTypeComboBox *>(QStringLiteral("headertypecombobox")); | 135 | SelectHeaderTypeComboBox *selectHeaderType = w->findChild<SelectHeaderTypeComboBox *>(QStringLiteral("headertypecombobox")); | ||
136 | selectHeaderType->setCode(AutoCreateScriptUtil::listValueToStr(element)); | 136 | selectHeaderType->setCode(AutoCreateScriptUtil::listValueToStr(element)); | ||
137 | } else if (indexStr == 1) { | 137 | } else if (indexStr == 1) { | ||
138 | AbstractRegexpEditorLineEdit *edit = w->findChild<AbstractRegexpEditorLineEdit *>(QStringLiteral("editaddress")); | 138 | AbstractRegexpEditorLineEdit *edit = w->findChild<AbstractRegexpEditorLineEdit *>(QStringLiteral("editaddress")); | ||
139 | edit->setCode(AutoCreateScriptUtil::listValueToStr(element)); | 139 | edit->setCode(AutoCreateScriptUtil::listValueToStr(element)); | ||
140 | } else { | 140 | } else { | ||
141 | tooManyArgument(tagName, indexStr, 2, error); | 141 | tooManyArguments(tagName, indexStr, 2, error); | ||
142 | qCDebug(LIBKSIEVE_LOG) << " SieveConditionAddress::setParamWidgetValue too many argument :" << index; | 142 | qCDebug(LIBKSIEVE_LOG) << " SieveConditionAddress::setParamWidgetValue too many argument :" << index; | ||
143 | } | 143 | } | ||
144 | ++indexStr; | 144 | ++indexStr; | ||
145 | } else if (tagName == QLatin1String("crlf")) { | 145 | } else if (tagName == QLatin1String("crlf")) { | ||
146 | element.skipCurrentElement(); | 146 | element.skipCurrentElement(); | ||
147 | //nothing | 147 | //nothing | ||
148 | } else if (tagName == QLatin1String("comment")) { | 148 | } else if (tagName == QLatin1String("comment")) { | ||
149 | commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText()); | 149 | commentStr = AutoCreateScriptUtil::loadConditionComment(commentStr, element.readElementText()); | ||
Show All 21 Lines | 170 | if (errorStr.isEmpty()) { | |||
171 | SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtypecombobox")); | 171 | SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtypecombobox")); | ||
172 | selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(lstTagValue.at(1), notCondition), name(), error); | 172 | selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(lstTagValue.at(1), notCondition), name(), error); | ||
173 | } else { //Problem with order | 173 | } else { //Problem with order | ||
174 | SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtypecombobox")); | 174 | SelectMatchTypeComboBox *selectMatchCombobox = w->findChild<SelectMatchTypeComboBox *>(QStringLiteral("matchtypecombobox")); | ||
175 | selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(lstTagValue.at(0), notCondition), name(), error); | 175 | selectMatchCombobox->setCode(AutoCreateScriptUtil::tagValueWithCondition(lstTagValue.at(0), notCondition), name(), error); | ||
176 | selectAddressPart->setCode(AutoCreateScriptUtil::tagValue(lstTagValue.at(1)), name(), error); | 176 | selectAddressPart->setCode(AutoCreateScriptUtil::tagValue(lstTagValue.at(1)), name(), error); | ||
177 | } | 177 | } | ||
178 | } else if (lstTagValue.count() > 2) { | 178 | } else if (lstTagValue.count() > 2) { | ||
179 | tooManyArgument(QStringLiteral("tag"), lstTagValue.count(), 2, error); | 179 | tooManyArguments(QStringLiteral("tag"), lstTagValue.count(), 2, error); | ||
180 | qCDebug(LIBKSIEVE_LOG) << "SieveConditionAddress::setParamWidgetValue too many argument :" << lstTagValue.count(); | 180 | qCDebug(LIBKSIEVE_LOG) << "SieveConditionAddress::setParamWidgetValue too many argument :" << lstTagValue.count(); | ||
181 | } | 181 | } | ||
182 | 182 | | |||
183 | return true; | 183 | return true; | ||
184 | } | 184 | } | ||
185 | 185 | | |||
186 | QUrl SieveConditionAddress::href() const | 186 | QUrl SieveConditionAddress::href() const | ||
187 | { | 187 | { | ||
188 | return SieveEditorUtil::helpUrl(SieveEditorUtil::strToVariableName(name())); | 188 | return SieveEditorUtil::helpUrl(SieveEditorUtil::strToVariableName(name())); | ||
189 | } | 189 | } |