Commit ac792e5c authored by Tobias Koenig's avatar Tobias Koenig
Browse files

Fixed krazy issues

svn path=/trunk/playground/graphics/okular/; revision=619843
parent 4aa85cdb
......@@ -759,7 +759,7 @@ class OKULAR_EXPORT LineAnnotation : public Annotation
/**
* Creates a new line annotation from the xml @p description
*/
LineAnnotation( const QDomNode &description );
explicit LineAnnotation( const QDomNode &description );
/**
* Destroys the line annotation.
......@@ -990,7 +990,7 @@ class OKULAR_EXPORT HighlightAnnotation : public Annotation
/**
* Creates a new highlight annotation from the xml @p description
*/
HighlightAnnotation( const QDomNode &description );
explicit HighlightAnnotation( const QDomNode &description );
/**
* Destroys the highlight annotation.
......@@ -1130,7 +1130,7 @@ class OKULAR_EXPORT StampAnnotation : public Annotation
/**
* Creates a new stamp annotation from the xml @p description
*/
StampAnnotation( const QDomNode &description );
explicit StampAnnotation( const QDomNode &description );
/**
* Destroys the stamp annotation.
......
......@@ -29,7 +29,7 @@ class OKULAR_EXPORT BookmarkManager : public QObject, public KBookmarkOwner
Q_OBJECT
public:
BookmarkManager( Document * document );
explicit BookmarkManager( Document * document );
virtual ~BookmarkManager();
virtual QString currentUrl() const;
......
......@@ -496,7 +496,7 @@ class OKULAR_EXPORT Document : public QObject
void openUrl( const KUrl &url );
/**
* This signal is emitted whenever an error occured.
* This signal is emitted whenever an error occurred.
*
* @param text The description of the error.
* @param duration The time in seconds the message should be shown to the user.
......@@ -536,7 +536,7 @@ class OKULAR_EXPORT Document : public QObject
* @short A view on the document.
*
* The Viewport structure is the 'current view' over the document. Contained
* data is broadcasted between observers to syncronize their viewports to get
* data is broadcasted between observers to synchronize their viewports to get
* the 'I scroll one view and others scroll too' views.
*/
class OKULAR_EXPORT DocumentViewport
......
......@@ -43,8 +43,8 @@ class Page;
class PixmapRequest;
class TextPage;
/* Note: on contents generation and asyncronous queries.
* Many observers may want to request data syncronously or asyncronously.
/* Note: on contents generation and asynchronous queries.
* Many observers may want to request data syncronously or asynchronously.
* - Sync requests. These should be done in-place.
* - Async request must be done in real background. That usually means a
* thread, such as QThread derived classes.
......
......@@ -244,7 +244,7 @@ class OKULAR_EXPORT LinkAction : public Link
*
* @param actionType The type of action.
*/
LinkAction( enum ActionType actionType );
explicit LinkAction( enum ActionType actionType );
/**
* Destroys the action link.
......
......@@ -48,12 +48,12 @@ class OKULAR_EXPORT Sound
* Creates a new sound object with the given embedded
* sound @p data.
*/
Sound( const QByteArray& data );
explicit Sound( const QByteArray& data );
/**
* Creates a new sound object with the given external @p filename.
*/
Sound( const QString& filename );
explicit Sound( const QString& filename );
/**
* Destroys the sound object.
......
......@@ -253,7 +253,7 @@ void ProtocolMSITS::listDir (const KUrl & url)
if ( !parseLoadAndLookup ( url, filepath ) )
return; // error() has been called by parseLoadAndLookup
filepath += "/";
filepath += '/';
if ( !isDirectory (filepath) )
{
......
......@@ -30,12 +30,12 @@
#include "iconstorage.h"
KCHMMainTreeViewItem::KCHMMainTreeViewItem( K3ListViewItem * parent, K3ListViewItem * after, QString name, QString aurl, int image) :
KCHMMainTreeViewItem::KCHMMainTreeViewItem( K3ListViewItem * parent, K3ListViewItem * after, const QString &name, const QString &aurl, int image) :
K3ListViewItem (parent, after, name), url(aurl), image_number(image)
{
}
KCHMMainTreeViewItem::KCHMMainTreeViewItem( K3ListView * parent, K3ListViewItem * after, QString name, QString aurl, int image) :
KCHMMainTreeViewItem::KCHMMainTreeViewItem( K3ListView * parent, K3ListViewItem * after, const QString &name, QString const &aurl, int image) :
K3ListViewItem (parent, after, name), url(aurl), image_number(image)
{
}
......@@ -89,7 +89,7 @@ QString KCHMMainTreeViewItem::getUrl( ) const
if ( dlg.exec() == QDialog::Accepted )
return dlg.getSelectedItemUrl();
*/
return QString::null;
return QString();
}
void KCHMMainTreeViewItem::paintBranches( QPainter * p, const QColorGroup & cg, int w, int y, int h )
......
......@@ -39,8 +39,8 @@ namespace KCHMImageType
class KCHMMainTreeViewItem : public K3ListViewItem
{
public:
KCHMMainTreeViewItem(K3ListViewItem* parent, K3ListViewItem* after, QString name, QString aurl, int image);
KCHMMainTreeViewItem(K3ListView* parent, K3ListViewItem* after, QString name, QString url, int image);
KCHMMainTreeViewItem(K3ListViewItem* parent, K3ListViewItem* after, const QString &name, const QString &aurl, int image);
KCHMMainTreeViewItem(K3ListView* parent, K3ListViewItem* after, const QString &name, const QString &url, int image);
QString getUrl() const;
virtual void setOpen ( bool open );
......
......@@ -57,7 +57,7 @@ namespace KCHMUrl
// Normalize url, so it becomes absolute
if ( newurl[0] != '/' )
newurl = "/" + newurl;
newurl = '/' + newurl;
newurl = QDir::cleanPath (newurl);
}
......@@ -79,7 +79,7 @@ namespace KCHMUrl
// Normalize url, so it becomes absolute
if ( newurl[0] != '/' )
newurl = "/" + newurl;
newurl = '/' + newurl;
}
//qDebug ("KCHMViewWindow::makeURLabsolute (%s) -> (%s)", url.ascii(), newurl.ascii());
......
......@@ -187,7 +187,7 @@ inline int CHMFile::findStringInQuotes (const QString& tag, int offset, QString&
// If we do not need to decode HTML entities, just return.
if ( decodeentities )
{
QString htmlentity = QString::null;
QString htmlentity;
bool fill_entity = false;
value.reserve (qend - qbegin); // to avoid multiple memory allocations
......@@ -214,7 +214,7 @@ inline int CHMFile::findStringInQuotes (const QString& tag, int offset, QString&
}
value.append (it.value());
htmlentity = QString::null;
htmlentity.clear();
fill_entity = false;
}
else
......@@ -326,7 +326,11 @@ void CHMFile::CloseCHM()
m_chmFile = NULL;
m_home = "/";
m_filename = m_home = m_topicsFile = m_indexFile = m_font = QString::null;
m_filename.clear();
m_home.clear();
m_topicsFile.clear();
m_indexFile.clear();
m_font.clear();
m_PageUrl.clear();
m_UrlPage.clear();
......@@ -465,7 +469,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool
qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty.");
}
name = QString::null;
name.clear();
urls.clear();
in_object = false;
imagenum = defaultimagenum;
......@@ -497,7 +501,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, QDomDocument *tree, bool
else if ( pname == "local" )
urls.push_back (KCHMUrl::makeURLabsoluteIfNeeded(pvalue));
else if ( pname == "see also" && asIndex && name != pvalue )
urls.push_back (KCHMUrl::makeURLabsoluteIfNeeded(":" + pvalue));
urls.push_back (KCHMUrl::makeURLabsoluteIfNeeded(':' + pvalue));
else if ( pname == "imagenumber" )
{
bool bok;
......@@ -642,7 +646,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a
qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty.");
}
name = QString::null;
name.clear();
urls.clear();
in_object = false;
imagenum = defaultimagenum;
......@@ -674,7 +678,7 @@ bool CHMFile::ParseHhcAndFillTree (const QString& file, K3ListView *tree, bool a
else if ( pname == "local" )
urls.push_back (KCHMUrl::makeURLabsoluteIfNeeded (pvalue));
else if ( pname == "see also" && asIndex && name != pvalue )
urls.push_back (":" + pvalue);
urls.push_back (':' + pvalue);
else if ( pname == "imagenumber" )
{
bool bok;
......@@ -1271,7 +1275,7 @@ bool CHMFile::GetFileContentAsString(QString& str, chmUnitInfo *ui)
}
else
{
str = QString::null;
str.clear();
return false;
}
}
......@@ -1279,7 +1283,7 @@ bool CHMFile::GetFileContentAsString(QString& str, chmUnitInfo *ui)
bool CHMFile::GetFileContentAsString( QString & str, QString filename, QString location )
{
str = QString::null;
str.clear();
if ( m_filename == filename )
return GetFileContentAsString (str, location);
......@@ -1379,7 +1383,7 @@ QByteArray CHMFile::convertSearchWord( const QString & src )
QString CHMFile::getTopicByUrl( const QString & search_url )
{
if ( !m_lookupTablesValid )
return QString::null;
return QString();
unsigned char buf[COMMON_BUF_LEN];
int pos = search_url.indexOf ('#');
......@@ -1388,7 +1392,7 @@ QString CHMFile::getTopicByUrl( const QString & search_url )
for ( unsigned int i = 0; i < m_chmTOPICS.length; i += TOPICS_ENTRY_LEN )
{
if ( RetrieveObject ( &m_chmTOPICS, buf, i, TOPICS_ENTRY_LEN) == 0 )
return QString::null;
return QString();
u_int32_t off_title = *(u_int32_t *)(buf + 4);
FIXENDIAN32(off_title);
......@@ -1399,7 +1403,7 @@ QString CHMFile::getTopicByUrl( const QString & search_url )
QString topic, url;
if ( RetrieveObject ( &m_chmURLTBL, buf, off_url, URLTBL_ENTRY_LEN) == 0 )
return QString::null;
return QString();
off_url = *(u_int32_t *)(buf + 8);
FIXENDIAN32(off_url);
......@@ -1424,7 +1428,7 @@ QString CHMFile::getTopicByUrl( const QString & search_url )
return topic;
}
return QString::null;
return QString();
}
void CHMFile::GetSearchResults( const KCHMSearchProgressResults_t & tempres, KCHMSearchResults_t & results, unsigned int limit_results )
......@@ -1560,7 +1564,7 @@ bool CHMFile::ParseChmIndexFile ( const QString& file, bool asIndex, KCHMParsedI
qDebug ("CHMFile::ParseAndFillTopicsTree: <object> tag is parsed, but both name and url are empty.");
}
name = QString::null;
name.clear();
urls.clear();
in_object = false;
imagenum = defaultimagenum;
......
......@@ -100,7 +100,7 @@ public:
*/
CHMFile(const QString& archiveName);
//! Destructor. If a file has been succesfully opened, it closes it.
//! Destructor. If a file has been successfully opened, it closes it.
~CHMFile();
/*!
......@@ -153,9 +153,9 @@ public:
/*!
\brief Checks if the last attempt to load a .chm file was
succesful.
successful.
\return true, if the last attempt to load a .chm file was
succesful, false otherwise.
successful, false otherwise.
*/
bool IsOk() const { return m_chmFile != NULL; }
......@@ -218,7 +218,7 @@ public:
filesystem.
\param ui A pointer to CHMLIB specific data about the file.
The parameter gets filled with useful data if the lookup
was succesful.
was successful.
\return true if the file exists in the archive, false otherwise.
*/
bool ResolveObject(const QString& fileName, chmUnitInfo *ui);
......@@ -226,7 +226,7 @@ public:
/*!
\brief Retrieves an uncompressed chunk of a file in the .chm.
\param ui Pointer to a CHMLIB specific data structure obtained
from a succesful call to ResolveObject().
from a successful call to ResolveObject().
\param buffer The buffer to place the chunk into.
\param fileOffset Where does the chunk we want begin in the file?
\param bufferSize The size of the buffer.
......
......@@ -18,7 +18,7 @@ class TeXFont {
TeXFont(TeXFontDefinition *_parent)
{
parent = _parent;
errorMessage = QString::null;
errorMessage.clear();
};
virtual ~TeXFont();
......
......@@ -30,7 +30,7 @@ extern const int MFResolutions[];
// #define DEBUG_FONT
TeXFontDefinition::TeXFontDefinition(QString nfontname, double _displayResolution_in_dpi, quint32 chk, qint32 _scaled_size_in_DVI_units,
TeXFontDefinition::TeXFontDefinition(const QString &nfontname, double _displayResolution_in_dpi, quint32 chk, qint32 _scaled_size_in_DVI_units,
class fontPool *pool, double _enlargement)
{
#ifdef DEBUG_FONT
......@@ -45,7 +45,7 @@ TeXFontDefinition::TeXFontDefinition(QString nfontname, double _displayResolutio
checksum = chk;
flags = TeXFontDefinition::FONT_IN_USE;
file = 0;
filename = QString::null;
filename.clear();
scaled_size_in_DVI_units = _scaled_size_in_DVI_units;
macrotable = 0;
......@@ -92,8 +92,8 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
flags |= TeXFontDefinition::FONT_LOADED;
filename = fname;
#ifdef HAVE_FREETYPE
fullFontName = QString::null;
fullEncodingName = QString::null;
fullFontName.clear();
fullEncodingName.clear();
#endif
file = fopen(QFile::encodeName(filename), "r");
......@@ -101,7 +101,7 @@ void TeXFontDefinition::fontNameReceiver(const QString& fname)
// in the DVI file's directory. If that works, modify the filename
// accordingly and go on.
if (file == 0) {
QString filename_test(font_pool->getExtraSearchPath() + "/" + filename);
QString filename_test(font_pool->getExtraSearchPath() + '/' + filename);
file = fopen( QFile::encodeName(filename_test), "r");
if (file == 0) {
kError(kvs::dvi) << i18n("Cannot find font %1, file %2.", fontname, filename) << endl;
......@@ -194,7 +194,7 @@ void TeXFontDefinition::reset()
vf_table.clear();
}
filename = QString::null;
filename.clear();
flags = TeXFontDefinition::FONT_IN_USE;
set_char_p = &dviRenderer::set_empty_char;
}
......
......@@ -64,7 +64,7 @@ class TeXFontDefinition {
};
TeXFontDefinition(QString nfontname, double _displayResolution_in_dpi, quint32 chk, qint32 _scaled_size_in_DVI_units,
TeXFontDefinition(const QString &nfontname, double _displayResolution_in_dpi, quint32 chk, qint32 _scaled_size_in_DVI_units,
class fontPool *pool, double _enlargement);
~TeXFontDefinition();
......
......@@ -18,7 +18,7 @@
quint8 bigEndianByteReader::readUINT8()
{
// This check saveguards us against segmentation fault. It is also
// necessary for virtual fonts, which do not end whith EOP.
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer) {
#ifdef DEBUG_ENDIANREADER
kError(kvs::dvi) << "bigEndianByteReader::readUINT8() tried to read past end of data chunk" << endl;
......@@ -34,7 +34,7 @@ quint8 bigEndianByteReader::readUINT8()
quint16 bigEndianByteReader::readUINT16()
{
// This check saveguards us against segmentation fault. It is also
// necessary for virtual fonts, which do not end whith EOP.
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer)
return EOP;
......@@ -47,7 +47,7 @@ quint16 bigEndianByteReader::readUINT16()
quint32 bigEndianByteReader::readUINT32()
{
// This check saveguards us against segmentation fault. It is also
// necessary for virtual fonts, which do not end whith EOP.
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer)
return EOP;
......@@ -62,7 +62,7 @@ quint32 bigEndianByteReader::readUINT32()
void bigEndianByteReader::writeUINT32(quint32 a)
{
// This check saveguards us against segmentation fault. It is also
// necessary for virtual fonts, which do not end whith EOP.
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer)
return;
......@@ -81,7 +81,7 @@ void bigEndianByteReader::writeUINT32(quint32 a)
quint32 bigEndianByteReader::readUINT(quint8 size)
{
// This check saveguards us against segmentation fault. It is also
// necessary for virtual fonts, which do not end whith EOP.
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer)
return EOP;
......@@ -96,7 +96,7 @@ quint32 bigEndianByteReader::readUINT(quint8 size)
qint32 bigEndianByteReader::readINT(quint8 length)
{
// This check saveguards us against segmentation fault. It is also
// necessary for virtual fonts, which do not end whith EOP.
// necessary for virtual fonts, which do not end with EOP.
if (command_pointer >= end_pointer)
return EOP;
......
......@@ -51,7 +51,7 @@ class bigEndianByteReader {
/** Similar to the method above, only that the method reads a big
endian number of length size, where 1 <= size <= 4. Note that
the value 3 is allowed (and is acually used in DVI files)!!! */
the value 3 is allowed (and is actually used in DVI files)!!! */
quint32 readUINT(quint8 size);
/** Similar to the method above, only that the method reads a SIGNED
......
......@@ -69,7 +69,7 @@
dvifile::dvifile(const dvifile *old, fontPool *fp)
{
errorMsg = QString::null;
errorMsg.clear();
errorCounter = 0;
page_offset = 0;
suggestedPageSize = 0;
......@@ -269,7 +269,7 @@ dvifile::dvifile(const QString& fname, fontPool* pool)
kDebug(kvs::dvi) << "init_dvi_file: " << fname << endl;
#endif
errorMsg = QString::null;
errorMsg.clear();
errorCounter = 0;
page_offset = 0;
suggestedPageSize = 0;
......@@ -381,7 +381,7 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename, QString *converrorms
if (!pdf2ps.waitForStarted()) {
// Indicates that conversion failed, won't try again.
convertedFiles[PDFFilename] = QString::null;
convertedFiles[PDFFilename].clear();
if (converrorms != 0 && !have_complainedAboutMissingPDF2PS) {
*converrorms = i18n("<qt><p>The external program <strong>pdf2ps</strong> could not be started. As a result, "
"the PDF-file %1 could not be converted to PostScript. Some graphic elements in your "
......@@ -395,7 +395,7 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename, QString *converrorms
"from the command line to check if it really works.</p><p><b>PATH:</b> %2</p></qt>", PDFFilename, getenv("PATH"));
have_complainedAboutMissingPDF2PS = true;
}
return QString::null;
return QString();
}
// We wait here while the external program runs concurrently.
......@@ -403,7 +403,7 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename, QString *converrorms
if (!QFile::exists(convertedFileName) || pdf2ps.exitCode() != 0) {
// Indicates that conversion failed, won't try again.
convertedFiles[PDFFilename] = QString::null;
convertedFiles[PDFFilename].clear();
if (converrorms != 0) {
const QString output = pdf2ps.readAll();
......@@ -413,7 +413,7 @@ QString dvifile::convertPDFtoPS(const QString &PDFFilename, QString *converrorms
"This is the output of the <strong>pdf2ps</strong> program that KDVI used:</p>"
"<p><strong>%2</strong></p></qt>", PDFFilename, output);
}
return QString::null;
return QString();
}
// Save name of converted file to buffer, so PDF file won't be
// converted again, and files can be deleted when *this is
......
......@@ -170,7 +170,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
QImage img(pageWidth, pageHeight, QImage::Format_RGB32);
foreGroundPainter = new QPainter(&img);
if (foreGroundPainter != 0) {
errorMsg = QString::null;
errorMsg.clear();
draw_page();
delete foreGroundPainter;
foreGroundPainter = 0;
......@@ -231,7 +231,7 @@ void dviRenderer::drawPage(RenderedDocumentPagePixmap* page)
i18n("<qt><strong>File corruption</strong> KDVI could not interprete your DVI file. This is "
"most commonly caused by a corrupted file.</qt>"),
errorMsg, i18n("DVI File Error"));
errorMsg = QString::null;
errorMsg.clear();
currentlyDrawnPage = 0;
return;
}
......@@ -331,7 +331,7 @@ void dviRenderer::embedPostScript()
return;
/* embedPS_progress = new KProgressDialog(parentWidget,
i18n("Embedding PostScript Files"), QString::null, true); */
i18n("Embedding PostScript Files"), QString(), true); */
if (!embedPS_progress)
return;
embedPS_progress->setAllowCancel(false);
......@@ -342,7 +342,7 @@ void dviRenderer::embedPostScript()
embedPS_numOfProgressedFiles = 0;
quint16 currPageSav = current_page;
errorMsg = QString::null;
errorMsg.clear();
for(current_page=0; current_page < dviFile->total_pages; current_page++) {
if (current_page < dviFile->total_pages) {
command_pointer = dviFile->dvi_Data() + dviFile->page_offset[int(current_page)];
......@@ -362,11 +362,11 @@ void dviRenderer::embedPostScript()
if (!errorMsg.isEmpty()) {
errorMsg = "<qt>" + errorMsg + "</qt>";
// KMessageBox::detailedError(parentWidget, "<qt>" + i18n("Not all PostScript files could be embedded into your document.") + "</qt>", errorMsg);
errorMsg = QString::null;
errorMsg.clear();
} else
/* KMessageBox::information(parentWidget, "<qt>" + i18n("All external PostScript files were embedded into your document. You "
"will probably want to save the DVI file now.") + "</qt>",
QString::null, "embeddingDone");*/
QString(), "embeddingDone");*/
// Prescan phase starts here
#ifdef PERFORMANCE_MEASUREMENT
......@@ -707,7 +707,7 @@ void dviRenderer::setResolution(double resolution_in_DPI)
void dviRenderer::clearStatusBar()
{
//emit setStatusBarText( QString::null );
//emit setStatusBarText( QString() );
}
......
......@@ -164,7 +164,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
break;
case 0x7b:
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "-";
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += '-';
break;
case 0x7c:
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "---";
......@@ -173,7 +173,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "\"";
break;
case 0x7e:
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "~";
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += '~';
break;
case 0x7f:
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "@@"; // @@@ check!
......@@ -183,7 +183,7 @@ void dviRenderer::set_char(unsigned int cmd, unsigned int ch)
if ((ch >= 0x21) && (ch <= 0x7a))
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += QChar(ch);
else
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += "?";
currentlyDrawnPage->textBoxList[currentlyDrawnPage->textBoxList.size()-1].text += '?';
break;
}
......
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