diff --git a/generators/chm/kio-msits/msits.h b/generators/chm/kio-msits/msits.h index d91962c5d..2a730b1bf 100644 --- a/generators/chm/kio-msits/msits.h +++ b/generators/chm/kio-msits/msits.h @@ -52,7 +52,7 @@ private: // Resolve an object inside a CHM file inline bool ResolveObject (const QString& fileName, chmUnitInfo *ui) { - return m_chmFile != NULL && ::chm_resolve_object(m_chmFile, fileName.ascii(), ui) == CHM_RESOLVE_SUCCESS; + return m_chmFile != NULL && ::chm_resolve_object(m_chmFile, fileName.toAscii().constData(), ui) == CHM_RESOLVE_SUCCESS; } // Retrieve an object from the CHM file diff --git a/generators/chm/lib/xchmfile.cpp b/generators/chm/lib/xchmfile.cpp index e4e6a3c64..536e30b30 100644 --- a/generators/chm/lib/xchmfile.cpp +++ b/generators/chm/lib/xchmfile.cpp @@ -177,12 +177,12 @@ inline int CHMFile::findStringInQuotes (const QString& tag, int offset, QString& } int qbegin = tag.indexOf ('"', offset); if ( qbegin == -1 ) - qFatal ("CHMFile::findStringInQuotes: cannot find first quote in tag: '%s'", tag.ascii()); + qFatal ("CHMFile::findStringInQuotes: cannot find first quote in tag: '%s'", tag.toAscii().constData()); int qend = firstquote ? tag.indexOf ('"', qbegin + 1) : tag.lastIndexOf ('"'); if ( qend == -1 || qend <= qbegin ) - qFatal ("CHMFile::findStringInQuotes: cannot find last quote in tag: '%s'", tag.ascii()); + qFatal ("CHMFile::findStringInQuotes: cannot find last quote in tag: '%s'", tag.toAscii().constData()); // If we do not need to decode HTML entities, just return. if ( decodeentities ) @@ -209,7 +209,7 @@ inline int CHMFile::findStringInQuotes (const QString& tag, int offset, QString& if ( it == m_entityDecodeMap.end() ) { - qWarning ("CHMFile::DecodeHTMLUnicodeEntity: could not decode HTML entity '%s', abort decoding.", htmlentity.ascii()); + qWarning ("CHMFile::DecodeHTMLUnicodeEntity: could not decode HTML entity '%s', abort decoding.", htmlentity.toAscii().constData()); break; } @@ -363,7 +363,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool int nextpos = src.indexOf (src[i], i+1); if ( nextpos == -1 && (nextpos = src.indexOf ('>', i+1)) == -1 ) { - qWarning ("CHMFile::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).ascii()); + qWarning ("CHMFile::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).toAscii().constData()); return false; } @@ -382,7 +382,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool else tagword = tag.toLower(); -// qDebug ("tag: '%s', tagword: '%s'\n", tag.ascii(), tagword.ascii()); +// qDebug ("tag: '%s', tagword: '%s'\n", tag.toAscii().constData(), tagword.toAscii().constData()); // - a topic entry if ( tagword == "object" && tag.indexOf ("text/sitemap", 0, Qt::CaseInsensitive) != -1 ) @@ -437,7 +437,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool else { if ( !urls.isEmpty() ) - qDebug ("CHMFile::ParseAndFillTopicsTree: tag with url \"%s\" is parsed, but name is empty.", urls[0].ascii()); + qDebug ("CHMFile::ParseAndFillTopicsTree: tag with url \"%s\" is parsed, but name is empty.", urls[0].toAscii().constData()); else qDebug ("CHMFile::ParseAndFillTopicsTree: tag is parsed, but both name and url are empty."); } @@ -455,19 +455,19 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool QString pname, pvalue; if ( (offset = tag.indexOf (name_pattern, 0, Qt::CaseInsensitive)) == -1 ) - qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no name=\n", tag.ascii()); + qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no name=\n", tag.toAscii().constData()); // offset+5 skips 'name=' offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); pname = pname.toLower(); if ( (offset = tag.indexOf (value_pattern, offset, Qt::CaseInsensitive)) == -1 ) - qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no value=\n", tag.ascii()); + qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no value=\n", tag.toAscii().constData()); // offset+6 skips 'value=' findStringInQuotes (tag, offset + value_pattern.length(), pvalue, FALSE, TRUE); -// qDebug (": name '%s', value '%s'", pname.ascii(), pvalue.ascii()); +// qDebug (": name '%s', value '%s'", pname.toAscii().constData(), pvalue.toAscii().constData()); if ( pname == "name" ) name = pvalue; @@ -550,7 +550,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a int nextpos = src.indexOf (src[i], i+1); if ( nextpos == -1 && (nextpos = src.indexOf ('>', i+1)) == -1 ) { - qWarning ("CHMFile::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).ascii()); + qWarning ("CHMFile::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).toAscii().constData()); return false; } @@ -569,7 +569,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a else tagword = tag.toLower(); -//qDebug ("tag: '%s', tagword: '%s'\n", tag.ascii(), tagword.ascii()); +//qDebug ("tag: '%s', tagword: '%s'\n", tag.toAscii().constData(), tagword.toAscii().constData()); // - a topic entry if ( tagword == "object" && tag.indexOf ("text/sitemap", 0, Qt::CaseInsensitive) != -1 ) @@ -613,7 +613,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a else { if ( !urls.isEmpty() ) - qDebug ("CHMFile::ParseAndFillTopicsTree: tag with url \"%s\" is parsed, but name is empty.", urls[0].ascii()); + qDebug ("CHMFile::ParseAndFillTopicsTree: tag with url \"%s\" is parsed, but name is empty.", urls[0].toAscii().constData()); else qDebug ("CHMFile::ParseAndFillTopicsTree: tag is parsed, but both name and url are empty."); } @@ -631,19 +631,19 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a QString pname, pvalue; if ( (offset = tag.indexOf (name_pattern, 0, Qt::CaseInsensitive)) == -1 ) - qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no name=\n", tag.ascii()); + qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no name=\n", tag.toAscii().constData()); // offset+5 skips 'name=' offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); pname = pname.toLower(); if ( (offset = tag.indexOf (value_pattern, offset, Qt::CaseInsensitive)) == -1 ) - qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no value=\n", tag.ascii()); + qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no value=\n", tag.toAscii().constData()); // offset+6 skips 'value=' findStringInQuotes (tag, offset + value_pattern.length(), pvalue, FALSE, TRUE); -//qDebug (": name '%s', value '%s'", pname.ascii(), pvalue.ascii()); +//qDebug (": name '%s', value '%s'", pname.toAscii().constData(), pvalue.toAscii().constData()); if ( pname == "name" ) name = pvalue; @@ -823,7 +823,7 @@ bool CHMFile::SearchWord (const QString& text, bool wholeWords, bool titlesOnly, bool CHMFile::ResolveObject(const QString& fileName, chmUnitInfo *ui) { return m_chmFile != NULL - && ::chm_resolve_object(m_chmFile, fileName.ascii(), ui) == + && ::chm_resolve_object(m_chmFile, fileName.toAscii().constData(), ui) == CHM_RESOLVE_SUCCESS; } @@ -1127,12 +1127,12 @@ inline bool CHMFile::InfoFromSystem() tmp = topicAttempt + ".hhc"; - if ( ResolveObject (tmp.ascii(), &ui) ) + if ( ResolveObject (tmp.toAscii().constData(), &ui) ) m_topicsFile = tmp; tmp = topicAttempt + ".hhk"; - if ( ResolveObject(tmp.ascii(), &ui) ) + if ( ResolveObject(tmp.toAscii().constData(), &ui) ) m_indexFile = tmp; } break; @@ -1469,7 +1469,7 @@ bool CHMFile::ParseChmIndexFile ( const QString& file, bool asIndex, KCHMParsedI int nextpos = src.find ( src[i], i+1 ); if ( nextpos == -1 && ( nextpos = src.find ('>', i+1) ) == -1 ) { - qWarning ("CHMFile::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).ascii()); + qWarning ("CHMFile::ParseHhcAndFillTree: corrupted TOC: %s", src.mid(i).toAscii().constData()); return false; } @@ -1488,7 +1488,7 @@ bool CHMFile::ParseChmIndexFile ( const QString& file, bool asIndex, KCHMParsedI else tagword = tag.toLower(); -//qDebug ("tag: '%s', tagword: '%s'\n", tag.ascii(), tagword.ascii()); +//qDebug ("tag: '%s', tagword: '%s'\n", tag.toAscii().constData(), tagword.toAscii().constData()); // - a topic entry if ( tagword == "object" && tag.find ("text/sitemap", 0, false) != -1 ) @@ -1527,7 +1527,7 @@ bool CHMFile::ParseChmIndexFile ( const QString& file, bool asIndex, KCHMParsedI else { if ( !urls.isEmpty() ) - qDebug ("CHMFile::ParseAndFillTopicsTree: tag with url \"%s\" is parsed, but name is empty.", urls[0].ascii()); + qDebug ("CHMFile::ParseAndFillTopicsTree: tag with url \"%s\" is parsed, but name is empty.", urls[0].toAscii().constData()); else qDebug ("CHMFile::ParseAndFillTopicsTree: tag is parsed, but both name and url are empty."); } @@ -1545,19 +1545,19 @@ bool CHMFile::ParseChmIndexFile ( const QString& file, bool asIndex, KCHMParsedI QString pname, pvalue; if ( (offset = tag.find (name_pattern, 0, FALSE)) == -1 ) - qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no name=\n", tag.ascii()); + qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no name=\n", tag.toAscii().constData()); // offset+5 skips 'name=' offset = findStringInQuotes (tag, offset + name_pattern.length(), pname, TRUE, FALSE); pname = pname.toLower(); if ( (offset = tag.find (value_pattern, offset, FALSE)) == -1 ) - qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no value=\n", tag.ascii()); + qFatal ("CHMFile::ParseAndFillTopicsTree: bad tag '%s': no value=\n", tag.toAscii().constData()); // offset+6 skips 'value=' findStringInQuotes (tag, offset + value_pattern.length(), pvalue, FALSE, TRUE); -//qDebug (": name '%s', value '%s'", pname.ascii(), pvalue.ascii()); +//qDebug (": name '%s', value '%s'", pname.toAscii().constData(), pvalue.toAscii().constData()); if ( pname == "name" ) name = pvalue; diff --git a/generators/fax/libkfaximage/kfaximage.cpp b/generators/fax/libkfaximage/kfaximage.cpp index 73c885a22..cc45eb355 100644 --- a/generators/fax/libkfaximage/kfaximage.cpp +++ b/generators/fax/libkfaximage/kfaximage.cpp @@ -224,7 +224,7 @@ KFaxImage::notetiff() unsigned int rowsperstrip = 0; t32bits nstrips = 1; - if (!file.at(IFDoff)) { + if (!file.seek(IFDoff)) { realbad: kfaxerror( i18n("Invalid or incomplete TIFF file.") ); bad: @@ -285,7 +285,7 @@ KFaxImage::notetiff() strips[1].offset = get2(dp+10, endian); break; } - if (!file.at(value)) + if (!file.seek(value)) goto realbad; for (count = 0; count < nstrips; count++) { if (file.read(SC(buf), (ftype == 3) ? 2 : 4) <= 0) @@ -338,7 +338,7 @@ KFaxImage::notetiff() strips[1].size = get2(dp+10, endian); break; } - if (!file.at(value)) + if (!file.seek(value)) goto realbad; for (count = 0; count < nstrips; count++) { if (file.read(SC(buf), (ftype == 3) ? 2 : 4) <= 0) @@ -348,7 +348,7 @@ KFaxImage::notetiff() } break; case 283: /* YResolution */ - if (!file.at(value) || + if (!file.seek(value) || file.read(SC(buf), 8) != 8) goto realbad; yres = get4(buf, endian) / get4(buf+4, endian); @@ -484,7 +484,7 @@ KFaxImage::getstrip(pagenode *pn, int strip) *((t32bits *) Data + roundup/4 - 1) = 0; /* we expect to get it in one gulp... */ - if (!file.at(offset) || + if (!file.seek(offset) || (size_t) file.read((char *)Data, pn->length) != pn->length) { badfile(pn); free(Data);