[kad-general] [PATCH] RS_Debug-print-need-const-char-as-argument |
[ Thread Index |
Date Index
| More lists.tuxfamily.org/kad-general Archives
]
From 1c07365d1368d1ebdb10e12b1b0a566a53251512 Mon Sep 17 00:00:00 2001
From: Riccardo Gori <goric@xxxxxxxxxxx>
Date: Wed, 2 Apr 2008 00:43:25 +0200
Subject: [PATCH] RS_Debug::print need const char* as argument
---
kad/src/qc_applicationwindow.cpp | 12 ++++++------
kadgui/src/qg_filedialog.cpp | 12 ++++++------
kadgui/src/qg_fontbox.cpp | 4 ++--
kadgui/src/qg_layerbox.cpp | 2 +-
kadgui/src/qg_recentfiles.cpp | 2 +-
kadgui/src/ui/qg_dlgoptionsdrawing.ui.h | 2 +-
kadgui/src/ui/qg_dlgoptionsgeneral.ui.h | 4 ++--
kadgui/src/ui/qg_librarywidget.ui.h | 20 ++++++++++----------
qcadlib/src/debug/rs_debug.cpp | 2 +-
qcadlib/src/engine/rs_font.cpp | 4 ++--
qcadlib/src/engine/rs_insert.cpp | 2 +-
qcadlib/src/engine/rs_layerlist.cpp | 2 +-
qcadlib/src/engine/rs_patternlist.cpp | 8 ++++----
qcadlib/src/fileio/rs_fileio.cpp | 10 +++++-----
qcadlib/src/gui/rs_eventhandler.cpp | 6 +++---
qcadlib/src/scripting/rs_scriptlist.cpp | 10 +++++-----
16 files changed, 51 insertions(+), 51 deletions(-)
diff --git a/kad/src/qc_applicationwindow.cpp b/kad/src/qc_applicationwindow.cpp
index a1465b0..4c8c4d9 100644
--- a/kad/src/qc_applicationwindow.cpp
+++ b/kad/src/qc_applicationwindow.cpp
@@ -193,11 +193,11 @@ void QC_ApplicationWindow::slotRunScript(const QString& name) {
for (QStringList::Iterator it = scriptList.begin(); it!=scriptList.end(); ++it) {
RS_DEBUG->print("QC_ApplicationWindow::slotRunScript: "
- "checking script '%s'", (*it).toLatin1());
+ "checking script '%s'", (*it).toLatin1().constData());
QFileInfo fi(*it);
if (fi.exists() && fi.fileName()==name) {
RS_DEBUG->print("QC_ApplicationWindow::slotRunScript: running '%s'",
- (*it).toLatin1());
+ (*it).toLatin1().constData());
scripter->runScript(*it, "main");
}
}
@@ -215,7 +215,7 @@ void QC_ApplicationWindow::slotInsertBlock() {
if (s!=NULL) {
QString block = ((QAction*)s)->text();
RS_DEBUG->print("QC_ApplicationWindow::slotInsertBlock: %s",
- block.toLatin1());
+ block.toLatin1().constData());
slotInsertBlock(block);
}
}
@@ -226,7 +226,7 @@ void QC_ApplicationWindow::slotInsertBlock() {
* Called to insert blocks.
*/
void QC_ApplicationWindow::slotInsertBlock(const QString& name) {
- RS_DEBUG->print("QC_ApplicationWindow::slotInsertBlock: '%s'", name.toLatin1());
+ RS_DEBUG->print("QC_ApplicationWindow::slotInsertBlock: '%s'", name.toLatin1().constData());
statusBar()->message(tr("Inserting block '%1'").arg(name), 2000);
@@ -1965,9 +1965,9 @@ void QC_ApplicationWindow::slotHelpManual() {
if (assistant==NULL) {
RS_DEBUG->print("QC_ApplicationWindow::slotHelpManual(): appdir: %s",
- RS_SYSTEM->getAppDir().toLatin1());
+ RS_SYSTEM->getAppDir().toLatin1().constData());
RS_DEBUG->print("QC_ApplicationWindow::slotHelpManual(): appdir: %s",
- RS_SYSTEM->getAppDir().toLatin1());
+ RS_SYSTEM->getAppDir().toLatin1().constData());
assistant = new QAssistantClient(RS_SYSTEM->getAppDir()+"/bin", this);
connect(assistant, SIGNAL(error(const QString&)),
this, SLOT(slotError(const QString&)));
diff --git a/kadgui/src/qg_filedialog.cpp b/kadgui/src/qg_filedialog.cpp
index 6bbff45..ea57fdb 100644
--- a/kadgui/src/qg_filedialog.cpp
+++ b/kadgui/src/qg_filedialog.cpp
@@ -170,16 +170,16 @@ QString QG_FileDialog::getOpenFileName(QWidget* parent, RS2::FormatType* type) {
QString defFilter = "Drawing Exchange (*.dxf *.DXF)";
RS_SETTINGS->endGroup();
- RS_DEBUG->print("defDir: %s", defDir.toLatin1());
- RS_DEBUG->print("defFilter: %s", defFilter.toLatin1());
+ RS_DEBUG->print("defDir: %s", defDir.toLatin1().constData());
+ RS_DEBUG->print("defFilter: %s", defFilter.toLatin1().constData());
QString fDxf(QObject::tr("Drawing Exchange %1").arg("(*.dxf *.DXF)"));
QString fDxf1(QObject::tr("QCad 1.x file %1").arg("(*.dxf *.DXF)"));
QString fCxf(QObject::tr("Font %1").arg("(*.cxf)"));
- RS_DEBUG->print("fDxf: %s", fDxf.toLatin1());
- RS_DEBUG->print("fDxf1: %s", fDxf1.toLatin1());
- RS_DEBUG->print("fCxf: %s", fCxf.toLatin1());
+ RS_DEBUG->print("fDxf: %s", fDxf.toLatin1().constData());
+ RS_DEBUG->print("fDxf1: %s", fDxf1.toLatin1().constData());
+ RS_DEBUG->print("fCxf: %s", fCxf.toLatin1().constData());
QString fn = "";
bool cancel = false;
@@ -232,7 +232,7 @@ QString QG_FileDialog::getOpenFileName(QWidget* parent, RS2::FormatType* type) {
RS_SETTINGS->endGroup();
}
- RS_DEBUG->print("QG_FileDialog::getOpenFileName: fileName: %s", fn.toLatin1());
+ RS_DEBUG->print("QG_FileDialog::getOpenFileName: fileName: %s", fn.toLatin1().constData());
RS_DEBUG->print("QG_FileDialog::getOpenFileName: OK");
delete prev;
diff --git a/kadgui/src/qg_fontbox.cpp b/kadgui/src/qg_fontbox.cpp
index 8101e8b..ad1fc2c 100644
--- a/kadgui/src/qg_fontbox.cpp
+++ b/kadgui/src/qg_fontbox.cpp
@@ -78,7 +78,7 @@ void QG_FontBox::init() {
*/
void QG_FontBox::setFont(const QString& fName) {
- RS_DEBUG->print("QG_FontBox::setFont %s\n", fName.toLatin1());
+ RS_DEBUG->print("QG_FontBox::setFont %s\n", fName.toLatin1().constData());
#if QT_VERSION>=0x030000
setCurrentText(fName);
@@ -103,7 +103,7 @@ void QG_FontBox::slotFontChanged(int index) {
if (currentFont!=NULL) {
RS_DEBUG->print("Current font is (%d): %s\n",
- index, currentFont->getFileName().toLatin1());
+ index, currentFont->getFileName().toLatin1().constData());
}
emit fontChanged(currentFont);
diff --git a/kadgui/src/qg_layerbox.cpp b/kadgui/src/qg_layerbox.cpp
index 13489bd..f3094d9 100644
--- a/kadgui/src/qg_layerbox.cpp
+++ b/kadgui/src/qg_layerbox.cpp
@@ -126,7 +126,7 @@ void QG_LayerBox::slotLayerChanged(int index) {
currentLayer = layerList->find(itemText(index));
//printf("Current color is (%d): %s\n",
- // index, currentLayer.name().toLatin1());
+ // index, currentLayer.name().toLatin1().constData());
emit layerChanged(currentLayer);
}
diff --git a/kadgui/src/qg_recentfiles.cpp b/kadgui/src/qg_recentfiles.cpp
index 36b7d65..522eedd 100644
--- a/kadgui/src/qg_recentfiles.cpp
+++ b/kadgui/src/qg_recentfiles.cpp
@@ -68,7 +68,7 @@ void QG_RecentFiles::add(const QString& filename) {
}
//for (int i=0; i<(int)files.count(); ++i) {
- // printf("recent file[%d]: %s\n", i, files[i].toLatin1());
+ // printf("recent file[%d]: %s\n", i, files[i].toLatin1().constData());
//}
RS_DEBUG->print("QG_RecentFiles::add: OK");
}
diff --git a/kadgui/src/ui/qg_dlgoptionsdrawing.ui.h b/kadgui/src/ui/qg_dlgoptionsdrawing.ui.h
index b35f391..a5c3512 100644
--- a/kadgui/src/ui/qg_dlgoptionsdrawing.ui.h
+++ b/kadgui/src/ui/qg_dlgoptionsdrawing.ui.h
@@ -280,7 +280,7 @@ void QG_DlgOptionsDrawing::validate() {
(int)RS_Math::eval(cbSplineSegs->currentText()), 70);
RS_DEBUG->print("QG_DlgOptionsDrawing::validate: splinesegs is: %s",
- cbSplineSegs->currentText().toLatin1());
+ cbSplineSegs->currentText().toLatin1().constData());
// update all dimension and spline entities in the graphic to match the new settings:
graphic->updateDimensions();
diff --git a/kadgui/src/ui/qg_dlgoptionsgeneral.ui.h b/kadgui/src/ui/qg_dlgoptionsgeneral.ui.h
index bb7a07d..93c1134 100644
--- a/kadgui/src/ui/qg_dlgoptionsgeneral.ui.h
+++ b/kadgui/src/ui/qg_dlgoptionsgeneral.ui.h
@@ -22,11 +22,11 @@ void QG_DlgOptionsGeneral::init() {
it++) {
RS_DEBUG->print("QG_DlgOptionsGeneral::init: adding %s to combobox",
- (*it).toLatin1());
+ (*it).toLatin1().constData());
QString l = RS_SYSTEM->symbolToLanguage(*it);
if (l.isEmpty()==false) {
- RS_DEBUG->print("QG_DlgOptionsGeneral::init: %s", l.toLatin1());
+ RS_DEBUG->print("QG_DlgOptionsGeneral::init: %s", l.toLatin1().constData());
cbLanguage->insertItem(l);
cbLanguageCmd->insertItem(l);
}
diff --git a/kadgui/src/ui/qg_librarywidget.ui.h b/kadgui/src/ui/qg_librarywidget.ui.h
index 5dc00ac..5c62b51 100644
--- a/kadgui/src/ui/qg_librarywidget.ui.h
+++ b/kadgui/src/ui/qg_librarywidget.ui.h
@@ -62,7 +62,7 @@ void QG_LibraryWidget::insert() {
}
} else {
RS_DEBUG->print(RS_Debug::D_ERROR,
- "QG_LibraryWidget::insert: Can't read file: '%s'", dxfPath.toLatin1());
+ "QG_LibraryWidget::insert: Can't read file: '%s'", dxfPath.toLatin1().constData());
}
}
@@ -248,7 +248,7 @@ QString QG_LibraryWidget::getPathToPixmap(const QString& dir,
RS_DEBUG->print("QG_LibraryWidget::getPathToPixmap: "
"dir: '%s' dxfFile: '%s' dxfPath: '%s'",
- dir.toLatin1(), dxfFile.toLatin1(), dxfPath.toLatin1());
+ dir.toLatin1(), dxfFile.toLatin1(), dxfPath.toLatin1().constData());
// List of all directories that contain part libraries:
QStringList directoryList = RS_SYSTEM->getDirectoryList("library");
@@ -265,20 +265,20 @@ QString QG_LibraryWidget::getPathToPixmap(const QString& dir,
itemDir = (*it)+dir;
pngPath = itemDir + "/" + fiDxf.baseName(true) + ".png";
RS_DEBUG->print("QG_LibraryWidget::getPathToPixmap: checking: '%s'",
- pngPath.toLatin1());
+ pngPath.toLatin1().constData());
QFileInfo fiPng(pngPath);
// the thumbnail exists:
if (fiPng.isFile()) {
RS_DEBUG->print("QG_LibraryWidget::getPathToPixmap: dxf date: %s, png date: %s",
- fiDxf.lastModified().toString().toLatin1(), fiPng.lastModified().toString().toLatin1());
+ fiDxf.lastModified().toString().toLatin1(), fiPng.lastModified().toString().toLatin1().constData());
if (fiPng.lastModified() > fiDxf.lastModified()) {
RS_DEBUG->print("QG_LibraryWidget::getPathToPixmap: thumbnail found: '%s'",
- pngPath.toLatin1());
+ pngPath.toLatin1().constData());
return pngPath;
} else {
RS_DEBUG->print("QG_LibraryWidget::getPathToPixmap: thumbnail needs to be updated: '%s'",
- pngPath.toLatin1());
+ pngPath.toLatin1().constData());
}
}
}
@@ -297,12 +297,12 @@ QString QG_LibraryWidget::getPathToPixmap(const QString& dir,
if (created.isEmpty() || QFileInfo(created).isDir() || dr.mkdir(created, true)) {
RS_DEBUG->print("QG_LibraryWidget: Created directory '%s'",
- created.toLatin1());
+ created.toLatin1().constData());
}
else {
RS_DEBUG->print(RS_Debug::D_ERROR,
"QG_LibraryWidget: Cannot create directory '%s'",
- created.toLatin1());
+ created.toLatin1().constData());
return "";
}
}
@@ -343,12 +343,12 @@ QString QG_LibraryWidget::getPathToPixmap(const QString& dir,
pngPath = "";
RS_DEBUG->print(RS_Debug::D_ERROR,
"QG_LibraryWidget::getPathToPixmap: Cannot write thumbnail: '%s'",
- pngPath.toLatin1());
+ pngPath.toLatin1().constData());
}
} else {
RS_DEBUG->print(RS_Debug::D_ERROR,
"QG_LibraryWidget::getPathToPixmap: Cannot open file: '%s'",
- dxfPath.toLatin1());
+ dxfPath.toLatin1().constData());
}
// GraphicView deletes painter
diff --git a/qcadlib/src/debug/rs_debug.cpp b/qcadlib/src/debug/rs_debug.cpp
index 28311ab..28b47f9 100644
--- a/qcadlib/src/debug/rs_debug.cpp
+++ b/qcadlib/src/debug/rs_debug.cpp
@@ -152,7 +152,7 @@ void RS_Debug::timestamp() {
*/
void RS_Debug::printUnicode(const QString& text) {
for (int i=0; i<(int)text.length(); i++) {
- print("[%X] %c", text.at(i).unicode(), text.at(i).toLatin1());
+ print("[%X] %c", text.at(i).unicode(), text.at(i).toLatin1().constData());
}
}
diff --git a/qcadlib/src/engine/rs_font.cpp b/qcadlib/src/engine/rs_font.cpp
index 451e2a6..a27f93e 100644
--- a/qcadlib/src/engine/rs_font.cpp
+++ b/qcadlib/src/engine/rs_font.cpp
@@ -106,12 +106,12 @@ bool RS_Font::loadFont() {
if (!f.open(QIODevice::ReadOnly)) {
RS_DEBUG->print(RS_Debug::D_WARNING,
"RS_Font::loadFont: Cannot open font file: %s",
- path.toLatin1());
+ path.toLatin1().constData());
return false;
} else {
RS_DEBUG->print("RS_Font::loadFont: "
"Successfully opened font file: %s",
- path.toLatin1());
+ path.toLatin1().constData());
}
RS_TextStream ts(&f);
diff --git a/qcadlib/src/engine/rs_insert.cpp b/qcadlib/src/engine/rs_insert.cpp
index 3df9661..5a7e0d7 100644
--- a/qcadlib/src/engine/rs_insert.cpp
+++ b/qcadlib/src/engine/rs_insert.cpp
@@ -60,7 +60,7 @@ RS_Insert::~RS_Insert() {}
void RS_Insert::update() {
RS_DEBUG->print("RS_Insert::update");
- RS_DEBUG->print("RS_Insert::update: name: %s", data.name.toLatin1());
+ RS_DEBUG->print("RS_Insert::update: name: %s", data.name.toLatin1().constData());
RS_DEBUG->print("RS_Insert::update: insertionPoint: %f/%f",
data.insertionPoint.x, data.insertionPoint.y);
diff --git a/qcadlib/src/engine/rs_layerlist.cpp b/qcadlib/src/engine/rs_layerlist.cpp
index 41f68ad..3f1bbb7 100644
--- a/qcadlib/src/engine/rs_layerlist.cpp
+++ b/qcadlib/src/engine/rs_layerlist.cpp
@@ -72,7 +72,7 @@ void RS_LayerList::activate(RS_Layer* layer, bool notify) {
/*if (layer!=NULL) {
RS_DEBUG->print("RS_LayerList::activate: %s",
- layer->getName().toLatin1());
+ layer->getName().toLatin1().constData());
} else {
RS_DEBUG->print("RS_LayerList::activate: NULL");
}*/
diff --git a/qcadlib/src/engine/rs_patternlist.cpp b/qcadlib/src/engine/rs_patternlist.cpp
index 4b55ba5..edadf94 100644
--- a/qcadlib/src/engine/rs_patternlist.cpp
+++ b/qcadlib/src/engine/rs_patternlist.cpp
@@ -58,13 +58,13 @@ void RS_PatternList::init() {
for (QStringList::Iterator it = list.begin();
it != list.end(); ++it) {
- RS_DEBUG->print("pattern: %s:", (*it).toLatin1());
+ RS_DEBUG->print("pattern: %s:", (*it).toLatin1().constData());
RS_FileInfo fi(*it);
pattern = new RS_Pattern(fi.baseName().lower());
patterns.append(pattern);
- RS_DEBUG->print("base: %s", pattern->getFileName().toLatin1());
+ RS_DEBUG->print("base: %s", pattern->getFileName().toLatin1().constData());
}
}
@@ -104,12 +104,12 @@ void RS_PatternList::removePattern(RS_Pattern* pattern) {
* memory if it's not already.
*/
RS_Pattern* RS_PatternList::requestPattern(const QString& name) {
- RS_DEBUG->print("RS_PatternList::requestPattern %s", name.toLatin1());
+ RS_DEBUG->print("RS_PatternList::requestPattern %s", name.toLatin1().constData());
QString name2 = name.lower();
RS_Pattern* foundPattern = NULL;
- RS_DEBUG->print("name2: %s", name2.toLatin1());
+ RS_DEBUG->print("name2: %s", name2.toLatin1().constData());
// Search our list of available patterns:
for (RS_Pattern* p=patterns.first();
diff --git a/qcadlib/src/fileio/rs_fileio.cpp b/qcadlib/src/fileio/rs_fileio.cpp
index 5457c71..ec095e8 100644
--- a/qcadlib/src/fileio/rs_fileio.cpp
+++ b/qcadlib/src/fileio/rs_fileio.cpp
@@ -46,7 +46,7 @@ RS_FileIO* RS_FileIO::uniqueInstance = NULL;
bool RS_FileIO::fileImport(RS_Graphic& graphic, const RS_String& file,
RS2::FormatType type) {
- RS_DEBUG->print("Trying to import file '%s'...", file.toLatin1());
+ RS_DEBUG->print("Trying to import file '%s'...", file.toLatin1().constData());
RS_FilterInterface* filter = NULL;
@@ -85,7 +85,7 @@ bool RS_FileIO::fileImport(RS_Graphic& graphic, const RS_String& file,
else {
RS_DEBUG->print(RS_Debug::D_WARNING,
"RS_FileIO::fileImport: failed to import file: %s",
- file.toLatin1());
+ file.toLatin1().constData());
}
return false;
@@ -103,7 +103,7 @@ bool RS_FileIO::fileExport(RS_Graphic& graphic, const RS_String& file,
RS2::FormatType type) {
RS_DEBUG->print("RS_FileIO::fileExport");
- //RS_DEBUG->print("Trying to export file '%s'...", file.toLatin1());
+ //RS_DEBUG->print("Trying to export file '%s'...", file.toLatin1().constData());
if (type==RS2::FormatUnknown) {
RS_String extension;
@@ -145,12 +145,12 @@ RS2::FormatType RS_FileIO::detectFormat(const RS_String& file) {
if (!f.open(QIODevice::ReadOnly)) {
// Error opening file:
RS_DEBUG->print(RS_Debug::D_WARNING,
- "RS_FileIO::detectFormat: Cannot open file: %s", file.toLatin1());
+ "RS_FileIO::detectFormat: Cannot open file: %s", file.toLatin1().constData());
type = RS2::FormatUnknown;
} else {
RS_DEBUG->print("RS_FileIO::detectFormat: "
"Successfully opened DXF file: %s",
- file.toLatin1());
+ file.toLatin1().constData());
RS_TextStream ts(&f);
RS_String line;
diff --git a/qcadlib/src/gui/rs_eventhandler.cpp b/qcadlib/src/gui/rs_eventhandler.cpp
index 6de2acb..245d0e9 100644
--- a/qcadlib/src/gui/rs_eventhandler.cpp
+++ b/qcadlib/src/gui/rs_eventhandler.cpp
@@ -130,7 +130,7 @@ void RS_EventHandler::mouseReleaseEvent(RS_MouseEvent* e) {
if (actionIndex>=0 && currentActions[actionIndex]!=NULL &&
!currentActions[actionIndex]->isFinished()) {
RS_DEBUG->print("call action %s",
- currentActions[actionIndex]->getName().toLatin1());
+ currentActions[actionIndex]->getName().toLatin1().constData());
currentActions[actionIndex]->mouseReleaseEvent(e);
@@ -496,7 +496,7 @@ void RS_EventHandler::setCurrentAction(RS_ActionInterface* action) {
// Set current action:
currentActions[actionIndex] = action;
RS_DEBUG->print("RS_EventHandler::setCurrentAction: current action is: %s",
- currentActions[actionIndex]->getName().toLatin1());
+ currentActions[actionIndex]->getName().toLatin1().constData());
// Initialisation of our new action:
RS_DEBUG->print("RS_EventHandler::setCurrentAction: init current action");
@@ -677,7 +677,7 @@ void RS_EventHandler::debugActions() {
}
if (currentActions[c]!=NULL) {
RS_DEBUG->print("Action %03d: %s [%s]",
- c, currentActions[c]->getName().toLatin1(),
+ c, currentActions[c]->getName().toLatin1().constData(),
currentActions[c]->isFinished() ? "finished" : "active");
} else {
RS_DEBUG->print("Action %03d: NULL", c);
diff --git a/qcadlib/src/scripting/rs_scriptlist.cpp b/qcadlib/src/scripting/rs_scriptlist.cpp
index 1f38715..39a0bc2 100644
--- a/qcadlib/src/scripting/rs_scriptlist.cpp
+++ b/qcadlib/src/scripting/rs_scriptlist.cpp
@@ -57,14 +57,14 @@ void RS_ScriptList::init() {
for ( RS_StringList::Iterator it = list.begin();
it != list.end(); ++it ) {
- RS_DEBUG->print("script: %s:", (*it).toLatin1());
+ RS_DEBUG->print("script: %s:", (*it).toLatin1().constData());
RS_FileInfo fi(*it);
script = new RS_Script(fi.baseName(), fi.absFilePath());
scripts.append(script);
- RS_DEBUG->print("base: %s", fi.baseName().toLatin1());
- RS_DEBUG->print("path: %s", fi.absFilePath().toLatin1());
+ RS_DEBUG->print("base: %s", fi.baseName().toLatin1().constData());
+ RS_DEBUG->print("path: %s", fi.absFilePath().toLatin1().constData());
}
//RS_Script* f = new RS_Script("normal");
@@ -114,12 +114,12 @@ void RS_ScriptList::removeScript(RS_Script* script) {
* memory if it's not already.
*/
RS_Script* RS_ScriptList::requestScript(const RS_String& name) {
- RS_DEBUG->print("RS_ScriptList::requestScript %s", name.toLatin1());
+ RS_DEBUG->print("RS_ScriptList::requestScript %s", name.toLatin1().constData());
RS_String name2 = name.lower();
RS_Script* foundScript = NULL;
- RS_DEBUG->print("name2: %s", name2.toLatin1());
+ RS_DEBUG->print("name2: %s", name2.toLatin1().constData());
// Search our list of available scripts:
for (RS_Script* s=scripts.first();
--
1.5.3.7