Commit 9a4294a2 authored by Pierre Ducroquet's avatar Pierre Ducroquet 🛩
Browse files

Just a bunch of krazy fixes

parent 5fb18e34
......@@ -537,7 +537,7 @@ QString DoubleSpinBoxDelegate::displayTextForProperty( const Property* prop ) co
if (unit.isEmpty())
return minValueText;
else
return minValueText + " " + unit;
return minValueText + ' ' + unit;
}
}
//! @todo precision?
......@@ -545,7 +545,7 @@ QString DoubleSpinBoxDelegate::displayTextForProperty( const Property* prop ) co
QString display;
#ifdef KOPROPERTY_USE_KOLIBS
if (!unit.isEmpty()) {
return KGlobal::locale()->formatNumber(KoUnit::unit(unit).toUserValue(prop->value().toDouble())) + " " + unit;
return KGlobal::locale()->formatNumber(KoUnit::unit(unit).toUserValue(prop->value().toDouble())) + ' ' + unit;
}
#endif
return KGlobal::locale()->formatNumber(prop->value().toDouble());
......
......@@ -112,7 +112,7 @@ void IndexEntryChapter::addAttributes(KoXmlWriter* writer) const
IndexEntrySpan::IndexEntrySpan(QString _styleName): IndexEntry(_styleName, IndexEntry::SPAN)
{
text = QString();
text.clear();
}
......@@ -264,7 +264,7 @@ KoTableOfContentsGeneratorInfo::KoTableOfContentsGeneratorInfo()
IndexEntryTabStop *entryTabStop = new IndexEntryTabStop(QString());
entryTabStop->tab.type = QTextOption::RightTab;
entryTabStop->setPosition("");
entryTabStop->tab.leaderText = ".";
entryTabStop->tab.leaderText = '.';
tocEntryTemplate.indexEntries.append(static_cast<IndexEntry*>(entryTabStop));
// index-entry-page-number
......
......@@ -64,11 +64,11 @@ bool KoTextBlockBorderData::hasBorders() const
return false;
}
bool KoTextBlockBorderData::operator==(const KoTextBlockBorderData &border)
bool KoTextBlockBorderData::operator==(const KoTextBlockBorderData &border) const
{
return equals(border);
}
bool KoTextBlockBorderData::equals(const KoTextBlockBorderData &border)
bool KoTextBlockBorderData::equals(const KoTextBlockBorderData &border) const
{
for (int i = Top; i <= Right; i++) {
if (d->edges[i].outerPen != border.d->edges[i].outerPen)
......
......@@ -101,8 +101,8 @@ public:
qreal inset(Side side) const;
/// returns true if the borders of param border are the same as this one.
bool operator==(const KoTextBlockBorderData &border);
bool equals(const KoTextBlockBorderData &border);
bool operator==(const KoTextBlockBorderData &border) const;
bool equals(const KoTextBlockBorderData &border) const;
/**
* Paint the borders.
......
......@@ -203,7 +203,7 @@ public:
void setChangeRecord(const QString& changeRecord)
{
QStringList strList = changeRecord.split(",");
QStringList strList = changeRecord.split(',');
this->changeId = strList.value(0);
this->changeType = strList.value(1);
this->attributeName = strList.value(2);
......@@ -252,23 +252,23 @@ void KoTextLoader::Private::openChangeRegion(const KoXmlElement& element)
if (element.localName() == "change-start") {
//This is a ODF 1.1 Change
id = element.attributeNS(KoXmlNS::text, "change-id");
} else if(element.localName() == "inserted-text-start") {
} else if (element.localName() == "inserted-text-start") {
//This is a ODF 1.2 Change
id = element.attributeNS(KoXmlNS::delta, "insertion-change-idref");
QString textEndId = element.attributeNS(KoXmlNS::delta, "inserted-text-end-idref");
endIdMap.insert(textEndId, id);
} else if((element.localName() == "removed-content") || (element.localName() == "merge")) {
} else if ((element.localName() == "removed-content") || (element.localName() == "merge")) {
id = element.attributeNS(KoXmlNS::delta, "removal-change-idref");
} else if(element.localName() == "remove-leaving-content-start") {
} else if (element.localName() == "remove-leaving-content-start") {
id = element.attributeNS(KoXmlNS::delta, "removal-change-idref");
QString endId = element.attributeNS(KoXmlNS::delta, "end-element-idref");
endIdMap.insert(endId, id);
} else if(element.attributeNS(KoXmlNS::delta, "insertion-type") != "") {
} else if (!element.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) {
QString insertionType = element.attributeNS(KoXmlNS::delta, "insertion-type");
if ((insertionType == "insert-with-content") || (insertionType == "insert-around-content")) {
id = element.attributeNS(KoXmlNS::delta, "insertion-change-idref");
}
} else if(element.attributeNS(KoXmlNS::ac, "change001") != "") {
} else if (!element.attributeNS(KoXmlNS::ac, "change001").isEmpty()) {
attributeChange.setChangeRecord(element.attributeNS(KoXmlNS::ac, "change001"));
id = attributeChange.changeId;
} else {
......@@ -351,23 +351,23 @@ void KoTextLoader::Private::closeChangeRegion(const KoXmlElement& element)
if (element.localName() == "change-end") {
//This is a ODF 1.1 Change
id = element.attributeNS(KoXmlNS::text, "change-id");
} else if(element.localName() == "inserted-text-end"){
} else if (element.localName() == "inserted-text-end"){
// This is a ODF 1.2 Change
QString textEndId = element.attributeNS(KoXmlNS::delta, "inserted-text-end-id");
id = endIdMap.value(textEndId);
endIdMap.remove(textEndId);
} else if((element.localName() == "removed-content") || (element.localName() == "merge")) {
} else if ((element.localName() == "removed-content") || (element.localName() == "merge")) {
id = element.attributeNS(KoXmlNS::delta, "removal-change-idref");
} else if(element.localName() == "remove-leaving-content-end"){
} else if (element.localName() == "remove-leaving-content-end"){
QString endId = element.attributeNS(KoXmlNS::delta, "end-element-id");
id = endIdMap.value(endId);
endIdMap.remove(endId);
} else if(element.attributeNS(KoXmlNS::delta, "insertion-type") != ""){
} else if (!element.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()){
QString insertionType = element.attributeNS(KoXmlNS::delta, "insertion-type");
if ((insertionType == "insert-with-content") || (insertionType == "insert-around-content")) {
id = element.attributeNS(KoXmlNS::delta, "insertion-change-idref");
}
} else if(element.attributeNS(KoXmlNS::ac, "change001") != "") {
} else if (!element.attributeNS(KoXmlNS::ac, "change001").isEmpty()) {
AttributeChangeRecord attributeChange;
attributeChange.setChangeRecord(element.attributeNS(KoXmlNS::ac, "change001"));
id = attributeChange.changeId;
......@@ -490,13 +490,13 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
bool usedParagraph = false; // set to true if we found a tag that used the paragraph, indicating that the next round needs to start a new one.
if (bodyElem.namespaceURI() == KoXmlNS::table && bodyElem.localName() == "table") {
if (bodyElem.attributeNS(KoXmlNS::delta, "insertion-type") != "") {
if (!bodyElem.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) {
d->openChangeRegion(bodyElem);
}
loadTable(bodyElem, cursor);
if (bodyElem.attributeNS(KoXmlNS::delta, "insertion-type") != "") {
if (!bodyElem.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) {
d->closeChangeRegion(bodyElem);
}
}
......@@ -590,10 +590,10 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
usedParagraph = false;
} else if (localName == "p") { // text paragraph
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "insert-around-content") {
if (tag.attributeNS(KoXmlNS::split, "split001-idref") != "")
if (!tag.attributeNS(KoXmlNS::split, "split001-idref").isEmpty())
d->splitPositionMap.insert(tag.attributeNS(KoXmlNS::split, "split001-idref"),cursor.position());
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "") {
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) {
QString insertionType = tag.attributeNS(KoXmlNS::delta, "insertion-type");
if (insertionType == "insert-with-content") {
d->openChangeRegion(tag);
......@@ -605,14 +605,14 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
markBlocksAsInserted(cursor, d->splitPositionMap.value(splitId), changeId);
d->splitPositionMap.remove(splitId);
}
} else if (tag.attributeNS(KoXmlNS::ac, "change001") != "") {
} else if (!tag.attributeNS(KoXmlNS::ac, "change001").isEmpty()) {
d->openChangeRegion(tag);
}
loadParagraph(tag, cursor);
if ((tag.attributeNS(KoXmlNS::delta, "insertion-type") != "") ||
(tag.attributeNS(KoXmlNS::ac, "change001") != "")) {
if ((!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) ||
(!tag.attributeNS(KoXmlNS::ac, "change001").isEmpty())) {
d->closeChangeRegion(tag);
}
......@@ -634,10 +634,10 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
}
} else if (localName == "h") { // heading
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "insert-around-content") {
if (tag.attributeNS(KoXmlNS::split, "split001-idref") != "")
if (!tag.attributeNS(KoXmlNS::split, "split001-idref").isEmpty())
d->splitPositionMap.insert(tag.attributeNS(KoXmlNS::split, "split001-idref"),cursor.position());
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "") {
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) {
QString insertionType = tag.attributeNS(KoXmlNS::delta, "insertion-type");
if (insertionType == "insert-with-content")
d->openChangeRegion(tag);
......@@ -651,12 +651,12 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
loadHeading(tag, cursor);
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(tag);
} else {
QString generatedXmlString;
_node = loadDeleteMerges(tag,&generatedXmlString);
//Parse and Load the generated xml
// Parse and Load the generated xml
QString errorMsg;
int errorLine, errorColumn;
KoXmlDocument doc;
......@@ -672,10 +672,10 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
} else if (localName == "unordered-list" || localName == "ordered-list" // OOo-1.1
|| localName == "list" || localName == "numbered-paragraph") { // OASIS
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "insert-around-content") {
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(tag);
loadList(tag, cursor);
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(tag);
} else {
QString generatedXmlString;
......@@ -716,13 +716,13 @@ void KoTextLoader::loadBody(const KoXmlElement &bodyElem, QTextCursor &cursor)
loadShape(tag, cursor);
} else if (tag.namespaceURI() == KoXmlNS::table) {
if (localName == "table") {
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(tag);
loadTable(tag, cursor);
usedParagraph = false;
if (tag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(tag);
} else {
kWarning(32500) << "KoTextLoader::loadBody unhandled table::" << localName;
......@@ -795,7 +795,7 @@ void KoTextLoader::Private::copyRemoveLeavingContentStart(const KoXmlNode &node,
nameSpacesList.append(element.namespaceURI());
index = nameSpacesList.size() - 1;
}
QString nodeName = QString("ns%1") + ":" + element.localName();
QString nodeName = QString("ns%1") + ':' + element.localName();
nodeName = nodeName.arg(index);
removeLeavingContentMap.insert(changeEndId, nodeName);
......@@ -918,7 +918,7 @@ void KoTextLoader::Private::copyTagStart(const KoXmlElement &element, QTextStrea
nameSpacesList.append(element.namespaceURI());
index = nameSpacesList.size() - 1;
}
QString nodeName = QString("ns%1") + ":" + element.localName();
QString nodeName = QString("ns%1") + ':' + element.localName();
nodeName = nodeName.arg(index);
xmlStream << "<" << nodeName;
QList<QPair<QString, QString> > attributeNSNames = element.attributeFullNames();
......@@ -947,7 +947,7 @@ void KoTextLoader::Private::copyTagStart(const KoXmlElement &element, QTextStrea
void KoTextLoader::Private::copyTagEnd(const KoXmlElement &element, QTextStream &xmlStream)
{
int index = nameSpacesList.indexOf(element.namespaceURI());
QString nodeName = QString("ns%1") + ":" + element.localName();
QString nodeName = QString("ns%1") + ':' + element.localName();
nodeName = nodeName.arg(index);
xmlStream << "</" << nodeName << ">";
}
......@@ -1238,9 +1238,9 @@ void KoTextLoader::loadListItem(KoXmlElement &e, QTextCursor &cursor, int level)
if (!numberedParagraph && e.tagName() != "list-item" && !listHeader)
return;
if (e.attributeNS(KoXmlNS::delta, "insertion-type") != "") {
if (!e.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty()) {
d->openChangeRegion(e);
} else if (e.attributeNS(KoXmlNS::ac, "change001") != "") {
} else if (!e.attributeNS(KoXmlNS::ac, "change001").isEmpty()) {
d->openChangeRegion(e);
}
......@@ -1305,7 +1305,7 @@ void KoTextLoader::loadListItem(KoXmlElement &e, QTextCursor &cursor, int level)
fmt.clearProperty(KoParagraphStyle::ForceDisablingList);
cursor.setBlockFormat(fmt);
}
if (e.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!e.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(e);
kDebug(32500) << "text-style:" << KoTextDebug::textAttributes(cursor.blockCharFormat());
}
......@@ -1581,7 +1581,7 @@ void KoTextLoader::loadSpan(const KoXmlElement &element, QTextCursor &cursor, bo
#ifdef KOOPENDOCUMENTLOADER_DEBUG
kDebug(32500) << " <span> localName=" << localName;
#endif
if (ts.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!ts.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(ts);
QString styleName = ts.attributeNS(KoXmlNS::text, "style-name", QString());
......@@ -1596,24 +1596,24 @@ void KoTextLoader::loadSpan(const KoXmlElement &element, QTextCursor &cursor, bo
loadSpan(ts, cursor, stripLeadingSpace); // recurse
cursor.setCharFormat(cf); // restore the cursor char format
if (ts.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!ts.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(ts);
} else if (isTextNS && localName == "s") { // text:s
int howmany = 1;
if (ts.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!ts.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(ts);
if (ts.hasAttributeNS(KoXmlNS::text, "c")) {
howmany = ts.attributeNS(KoXmlNS::text, "c", QString()).toInt();
}
cursor.insertText(QString().fill(32, howmany));
if (ts.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!ts.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(ts);
} else if ( (isTextNS && localName == "note")) { // text:note
loadNote(ts, cursor);
} else if (isTextNS && localName == "tab") { // text:tab
cursor.insertText("\t");
} else if (isTextNS && localName == "a") { // text:a
if (ts.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!ts.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(ts);
QString target = ts.attributeNS(KoXmlNS::xlink, "href");
QTextCharFormat cf = cursor.charFormat(); // store the current cursor char format
......@@ -1634,7 +1634,7 @@ void KoTextLoader::loadSpan(const KoXmlElement &element, QTextCursor &cursor, bo
}
loadSpan(ts, cursor, stripLeadingSpace); // recurse
cursor.setCharFormat(cf); // restore the cursor char format
if (ts.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!ts.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(ts);
} else if (isTextNS && localName == "line-break") { // text:line-break
#ifdef KOOPENDOCUMENTLOADER_DEBUG
......@@ -1989,10 +1989,10 @@ void KoTextLoader::loadTable(const KoXmlElement &tableElem, QTextCursor &cursor)
}
}
} else if (tblLocalName == "table-row") {
if (tblTag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tblTag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(tblTag);
loadTableRow(tblTag, tbl, spanStore, cursor, rows);
if (tblTag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!tblTag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(tblTag);
} else if (tblLocalName == "table-rows") {
KoXmlElement subTag;
......@@ -2149,7 +2149,7 @@ void KoTextLoader::loadTableCell(KoXmlElement &rowTag, QTextTable *tbl, QList<QR
const int currentRow = tbl->rows() - 1;
QTextTableCell cell = tbl->cellAt(currentRow, currentCell);
if (rowTag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!rowTag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(rowTag);
// store spans until entire table have been loaded
......@@ -2192,7 +2192,7 @@ void KoTextLoader::loadTableCell(KoXmlElement &rowTag, QTextTable *tbl, QList<QR
loadBody(rowTag, cursor);
}
if (rowTag.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!rowTag.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(rowTag);
}
......@@ -2242,7 +2242,7 @@ KoShape *KoTextLoader::loadShape(const KoXmlElement &element, QTextCursor &curso
KoInlineTextObjectManager *textObjectManager = KoTextDocument(cursor.block().document()).inlineTextObjectManager();
if (textObjectManager) {
if (element.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!element.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->openChangeRegion(element);
if (d->changeTracker && d->changeStack.count()) {
......@@ -2259,7 +2259,7 @@ KoShape *KoTextLoader::loadShape(const KoXmlElement &element, QTextCursor &curso
textObjectManager->insertInlineObject(cursor, anchor);
if(element.attributeNS(KoXmlNS::delta, "insertion-type") != "")
if (!element.attributeNS(KoXmlNS::delta, "insertion-type").isEmpty())
d->closeChangeRegion(element);
}
}
......
......@@ -350,7 +350,7 @@ void KoTextWriter::Private::saveODF12Change(QTextCharFormat format)
QString KoTextWriter::Private::generateDeleteChangeXml(KoDeleteChangeMarker *marker)
{
if (!changeTracker) return QString::null;
if (!changeTracker) return QString();
//Create a QTextDocument from the Delete Fragment
QTextDocument doc;
......@@ -723,7 +723,7 @@ QString KoTextWriter::Private::saveTableColumnStyle(const KoTableColumnStyle& ta
QString columnName = QChar('A' + int(columnNumber % 26));
if (columnNumber > 25)
columnName.prepend(QChar('A' + int(columnNumber/26)));
QString generatedName = tableStyleName + "." + columnName;
QString generatedName = tableStyleName + '.' + columnName;
KoGenStyle style(KoGenStyle::TableColumnAutoStyle, "table-column");
......@@ -737,8 +737,7 @@ QString KoTextWriter::Private::saveTableColumnStyle(const KoTableColumnStyle& ta
QString KoTextWriter::Private::saveTableRowStyle(const KoTableRowStyle& tableRowStyle, int rowNumber, const QString& tableStyleName)
{
// 26*26 columns should be enough for everyone
QString generatedName = tableStyleName + "." + QString::number(rowNumber + 1);
QString generatedName = tableStyleName + '.' + QString::number(rowNumber + 1);
KoGenStyle style(KoGenStyle::TableRowAutoStyle, "table-row");
......@@ -756,7 +755,7 @@ QString KoTextWriter::Private::saveTableCellStyle(const QTextTableCellFormat& ce
QString columnName = QChar('A' + int(columnNumber % 26));
if (columnNumber > 25)
columnName.prepend(QChar('A' + int(columnNumber/26)));
QString generatedName = tableStyleName + "." + columnName;
QString generatedName = tableStyleName + '.' + columnName;
KoGenStyle style(KoGenStyle::TableCellAutoStyle, "table-cell");
......@@ -1935,7 +1934,7 @@ void KoTextWriter::Private::generateFinalXml(QTextStream &outputXmlStream, const
handleListItemWithParagraphMerge(outputXmlStream, element);
} else if ((firstChild == "list") && (secondChild == "list")) {
handleListWithListMerge(outputXmlStream, element);
} else if ((firstChild == "list") && (secondChild == "")) {
} else if ((firstChild == "list") && (secondChild.isEmpty())) {
handleListItemWithListItemMerge(outputXmlStream, element);
} else {
//Not Possible
......
......@@ -566,7 +566,7 @@ void KoListLevelProperties::loadOdf(KoShapeLoadingContext& scontext, const KoXml
QString size = style.attributeNS(KoXmlNS::text, "bullet-relative-size", QString());
if (!size.isEmpty()) {
hasBulletRelativeSize=true;
setRelativeBulletSize(size.replace("%", "").toInt());
setRelativeBulletSize(size.replace('%', "").toInt());
}
} else if (style.localName() == "list-level-style-number" || style.localName() == "outline-level-style") { // it's a numbered list
......
......@@ -102,10 +102,10 @@ QStringList Attribute::listValuesFromNode(const QDomElement &m_node)
if (!mergedAllowedValues.contains(baseValue))
mergedAllowedValues << baseValue;
foreach (QString knownValue, mergedAllowedValues) {
if ((knownValue == baseValue) || (knownValue.contains(baseValue + " ")) || (knownValue.contains(" " + baseValue))) {
if ((knownValue == baseValue) || (knownValue.contains(baseValue + ' ')) || (knownValue.contains(' ' + baseValue))) {
continue;
}
QString builtValue = knownValue + " " + baseValue;
QString builtValue = knownValue + ' ' + baseValue;
if (!mergedAllowedValues.contains(builtValue))
mergedAllowedValues << builtValue;
}
......
......@@ -50,5 +50,5 @@ KoUndoStackAction::KoUndoStackAction(KUndo2Stack* stack, Type type)
void KoUndoStackAction::slotUndoTextChanged(const QString& text)
{
QString actionText = (m_type == UNDO) ? i18n("Undo") : i18n("Redo");
setText(actionText + " " + text);
setText(actionText + ' ' + text);
}
......@@ -124,7 +124,7 @@ void Canvas::replayStep()
QString line = m_list.at(m_listId++);
qDebug() << "Line:" << line;
QStringList values = line.split(" ");
QStringList values = line.split(' ');
if (values[0] == "c") {
clear();
} else {
......
......@@ -61,7 +61,7 @@ FrameIterator::FrameIterator(FrameIterator *other)
currentSubFrameIterator = 0;
}
bool FrameIterator::operator ==(const FrameIterator &other)
bool FrameIterator::operator ==(const FrameIterator &other) const
{
if (it != other.it)
return false;
......
......@@ -36,7 +36,7 @@ public:
FrameIterator(QTextTableCell frame);
FrameIterator(FrameIterator *other);
bool operator ==(const FrameIterator &other);
bool operator ==(const FrameIterator &other) const;
TableIterator *tableIterator(QTextTable *);
FrameIterator *subFrameIterator(QTextFrame *);
......
......@@ -43,7 +43,7 @@ KoPointedAt::KoPointedAt(KoPointedAt *other)
void KoPointedAt::fillInBookmark(QTextCursor cursor, KoInlineTextObjectManager *inlineManager)
{
bookmark = 0;
externalHRef = QString();
externalHRef.clear();
if (!inlineManager)
return;
......@@ -76,4 +76,4 @@ void KoPointedAt::fillInBookmark(QTextCursor cursor, KoInlineTextObjectManager *
externalHRef = href;
}
}
}
\ No newline at end of file
}
......@@ -74,7 +74,7 @@ TableIterator::~TableIterator()
}
}
bool TableIterator::operator ==(const TableIterator &other)
bool TableIterator::operator ==(const TableIterator &other) const
{
if (table != other.table)
return false;
......
......@@ -53,7 +53,7 @@ public:
~TableIterator();
/// Compare this iterator to another.
bool operator ==(const TableIterator &other);
bool operator ==(const TableIterator &other) const;
/**
* Returns a frame iterator that iterates over the frames in a given column.
......
......@@ -189,12 +189,12 @@ void KoResourceItemChooser::slotButtonClicked( int button )
foreach(const QString &file, e.installedFiles()) {
QFileInfo fi(file);
d->model->resourceServerAdapter()->importResourceFile( fi.absolutePath()+"/"+fi.fileName() , false );
d->model->resourceServerAdapter()->importResourceFile( fi.absolutePath()+'/'+fi.fileName() , false );
}
foreach(const QString &file, e.uninstalledFiles()) {
QFileInfo fi(file);
d->model->resourceServerAdapter()->removeResourceFile(fi.absolutePath()+"/"+fi.fileName());
d->model->resourceServerAdapter()->removeResourceFile(fi.absolutePath()+'/'+fi.fileName());
}
}
}
......
......@@ -255,9 +255,9 @@ void KoResourceTagging::readXMLFile()
bool KoResourceTagging::isServerResource(QString resourceName)
{
bool removeChild = false;
QStringList extensionsList = m_serverExtensions.split(":");
QStringList extensionsList = m_serverExtensions.split(':');
foreach (QString extension, extensionsList) {
if(resourceName.contains(extension.remove("*"))) {
if(resourceName.contains(extension.remove('*'))) {
removeChild = true;
break;
}
......@@ -268,7 +268,7 @@ bool KoResourceTagging::isServerResource(QString resourceName)
QString KoResourceTagging::getAdjustedFileName(QString fileName)
{
if(!isServerResource(fileName)) {
return fileName + "-krita" + m_serverExtensions.split(":").takeFirst().remove("*");
return fileName + "-krita" + m_serverExtensions.split(':').takeFirst().remove('*');
}
return fileName;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment