Commit a98b766a authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Remove endl at the end of qDebug + use \n when necessary + flush

parent c73a2887
......@@ -406,7 +406,7 @@ void ActionsImpl::slotInsertSeparator()
void ActionsImpl::slotImport() {
KEBApp::self()->bkInfo()->commitChanges();
qDebug() << "ActionsImpl::slotImport() where sender()->name() == "
<< sender()->objectName() << endl;
<< sender()->objectName();
ImportCommand* import
= ImportCommand::performImport(m_model, sender()->objectName(), KEBApp::self());
if (!import)
......
......@@ -32,7 +32,7 @@ HTMLExporter::HTMLExporter()
void HTMLExporter::write(const KBookmarkGroup &grp, const QString &filename, bool showAddress) {
QFile file(filename);
if (!file.open(QIODevice::WriteOnly)) {
qCritical() << "Can't write to file " << filename << endl;
qCritical() << "Can't write to file " << filename;
return;
}
QTextStream tstream(&file);
......@@ -59,31 +59,34 @@ void HTMLExporter::visit(const KBookmark &bk) {
// //qDebug() << "visit(" << bk.text() << ")";
if(bk.isSeparator())
{
m_out << bk.fullText() << "<br>"<<endl;
m_out << bk.fullText() << "<br>"<< QLatin1Char('\n');
}
else
{
if(m_showAddress)
{
m_out << bk.fullText() <<"<br>"<< endl;
m_out << bk.fullText() <<"<br>"<< QLatin1Char('\n');
m_out << "<i><div style =\"margin-left: 1em\">" << bk.url().url().toUtf8() << "</div></i>";
}
else
{
m_out << "<a href=\"" << bk.url().url().toUtf8() << "\">";
m_out << bk.fullText() << "</a><br>" << endl;
m_out << bk.fullText() << "</a><br>"<< QLatin1Char('\n');
}
}
m_out.flush();
}
void HTMLExporter::visitEnter(const KBookmarkGroup &grp) {
// //qDebug() << "visitEnter(" << grp.text() << ")";
m_out << "<b>" << grp.fullText() << "</b><br>" << endl;
m_out << "<div style=\"margin-left: 2em\">"<< endl;
m_out << "<b>" << grp.fullText() << "</b><br>"<< QLatin1Char('\n');
m_out << "<div style=\"margin-left: 2em\">"<< QLatin1Char('\n');
m_out.flush();
}
void HTMLExporter::visitLeave(const KBookmarkGroup &) {
// //qDebug() << "visitLeave()";
m_out << "</div>" << endl;
m_out << "</div>" << QLatin1Char('\n');
m_out.flush();
}
......@@ -70,7 +70,7 @@ ImportCommand* ImportCommand::importerFactory(KBookmarkModel* model, const QStri
else if (type == QLatin1String("Moz")) return new MozImportCommand(model);
else if (type == QLatin1String("NS")) return new NSImportCommand(model);
else {
qCritical() << "ImportCommand::importerFactory() - invalid type (" << type << ")!" << endl;
qCritical() << "ImportCommand::importerFactory() - invalid type (" << type << ")!";
return nullptr;
}
}
......
......@@ -63,7 +63,7 @@ int main( int argc, char**argv )
aboutData.processCommandLine(&parser);
if ( parser.positionalArguments().count() != 1 ) {
qCritical() << "No directory to scan for bookmarks specified." << endl;
qCritical() << "No directory to scan for bookmarks specified.";
return 1;
}
......@@ -88,7 +88,7 @@ int main( int argc, char**argv )
QString extraBookmarksDirName = parser.positionalArguments().at(0);
QDir extraBookmarksDir( extraBookmarksDirName, QStringLiteral("*.xml") );
if ( !extraBookmarksDir.isReadable() ) {
qCritical() << "Failed to read files in directory " << extraBookmarksDirName << endl;
qCritical() << "Failed to read files in directory " << extraBookmarksDirName;
return 1;
}
......
......@@ -408,7 +408,7 @@ void KViewSearchLine::slotColumnsRemoved(const QModelIndex &, int first, int las
{
if(d->listView->modelColumn()>last)
qCritical()<<"Columns were removed, the modelColumn() doesn't exist anymore. "
"K4listViewSearchLine can't cope with that."<<endl;
"K4listViewSearchLine can't cope with that.";
updateSearch();
}
}
......
......@@ -84,7 +84,7 @@ void TestLinkItr::slotJobResult(KJob *job)
const QString modDate = transfer->queryMetaData(QStringLiteral("modified"));
if (transfer->error() || transfer->isErrorPage()) {
//qDebug()<<"***********"<<transfer->error()<<" "<<transfer->isErrorPage()<<endl;
//qDebug()<<"***********"<<transfer->error()<<" "<<transfer->isErrorPage();
// can we assume that errorString will contain no entities?
QString err = transfer->errorString();
err.replace(QLatin1String("\n"), QLatin1String(" "));
......
......@@ -214,8 +214,7 @@ SelcAbilities KEBApp::getSelectionAbilities() const
<<"\nsa.root "<<selctionAbilities.root
<<"\nsa.multiSelect "<<selctionAbilities.multiSelect
<<"\nsa.singleSelect "<<selctionAbilities.singleSelect
<<"\nsa.deleteEnabled"<<selctionAbilities.deleteEnabled
<<endl;
<<"\nsa.deleteEnabled"<<selctionAbilities.deleteEnabled;
*/
return selctionAbilities;
}
......
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