diff --git a/cli/commandadd.cpp b/cli/commandadd.cpp index 1c5f718..67a07e0 100644 --- a/cli/commandadd.cpp +++ b/cli/commandadd.cpp @@ -59,7 +59,7 @@ int CommandAdd::handle(QStringList arguments) if(processedFilesCount != numFilesCount) { Logger::error() << "Errors occured while trying to add files to the database. Processed " << processedFilesCount - << "out of" << numFilesCount << "files" << endl; + << "out of" << numFilesCount << "files" << Qt::endl; return 1; } diff --git a/cli/commanddelete.cpp b/cli/commanddelete.cpp index 860da33..7455153 100644 --- a/cli/commanddelete.cpp +++ b/cli/commanddelete.cpp @@ -22,7 +22,8 @@ int CommandDelete::remove(QString pattern, bool onlyDeleted, bool verbose, bool { if(verbose) { - Logger::info() << "Skipping " << file.absPath << " as the file exists on the file system" << endl; + Logger::info() << "Skipping " << file.absPath << " as the file exists on the file system" + << Qt::endl; } } else @@ -33,19 +34,19 @@ int CommandDelete::remove(QString pattern, bool onlyDeleted, bool verbose, bool { if(verbose) { - Logger::info() << "Deleted" << file.absPath << endl; + Logger::info() << "Deleted" << file.absPath << Qt::endl; } ++deleted; } else { - Logger::error() << "Failed to delete:" << file.absPath << ", exiting." << endl; + Logger::error() << "Failed to delete:" << file.absPath << ", exiting." << Qt::endl; return 1; } } else { - Logger::info() << "Would delete " << file.absPath << endl; + Logger::info() << "Would delete " << file.absPath << Qt::endl; } } } @@ -79,19 +80,19 @@ int CommandDelete::removePaths(const QStringList &paths, bool verbose, bool dryR { if(verbose) { - Logger::info() << "Deleted" << absPath << endl; + Logger::info() << "Deleted" << absPath << Qt::endl; } } else { - Logger::error() << "Failed to delete:" << absPath << endl; + Logger::error() << "Failed to delete:" << absPath << Qt::endl; result = 1; } } } else { - Logger::error() << "No such file in database:" << absPath << endl; + Logger::error() << "No such file in database:" << absPath << Qt::endl; result = 1; } } @@ -124,7 +125,7 @@ int CommandDelete::handle(QStringList arguments) int result = this->remove(pattern, deleted, verbose, dryRun); if(result != 0) { - Logger::error() << "Removal operation did not succeed" << endl; + Logger::error() << "Removal operation did not succeed" << Qt::endl; return result; } } diff --git a/cli/commandlist.cpp b/cli/commandlist.cpp index 0a13e95..31e0ff6 100644 --- a/cli/commandlist.cpp +++ b/cli/commandlist.cpp @@ -28,7 +28,7 @@ int CommandList::handle(QStringList arguments) for(SearchResult &result : results) { - Logger::info() << result.fileData.absPath << endl; + Logger::info() << result.fileData.absPath << Qt::endl; } return 0; diff --git a/cli/commandsearch.cpp b/cli/commandsearch.cpp index 6cc0c33..4350171 100644 --- a/cli/commandsearch.cpp +++ b/cli/commandsearch.cpp @@ -30,7 +30,7 @@ int CommandSearch::handle(QStringList arguments) for(SearchResult &result : results) { - Logger::info() << result.fileData.absPath << endl; + Logger::info() << result.fileData.absPath << Qt::endl; } return 0; diff --git a/cli/commandupdate.cpp b/cli/commandupdate.cpp index ad3fdd9..8b43adc 100644 --- a/cli/commandupdate.cpp +++ b/cli/commandupdate.cpp @@ -64,7 +64,7 @@ int CommandUpdate::handle(QStringList arguments) } else { - Logger::info() << "Would update" << fileData.absPath << endl; + Logger::info() << "Would update" << fileData.absPath << Qt::endl; } } } @@ -76,7 +76,8 @@ int CommandUpdate::handle(QStringList arguments) { if(!this->dbService->deleteFile(fileData.absPath)) { - Logger::error() << "Error: Failed to delete" << fileData.absPath << "from databas" << endl; + Logger::error() + << "Error: Failed to delete" << fileData.absPath << "from databas" << Qt::endl; if(!keepGoing) { return 1; @@ -84,13 +85,13 @@ int CommandUpdate::handle(QStringList arguments) } if(verbose) { - Logger::info() << "Deleted" << fileData.absPath << endl; + Logger::info() << "Deleted" << fileData.absPath << Qt::endl; } } else { - Logger::info() << "Would delete" << fileData.absPath << endl; + Logger::info() << "Would delete" << fileData.absPath << Qt::endl; } } } @@ -103,7 +104,7 @@ int CommandUpdate::handle(QStringList arguments) if(!keepGoing) { Logger::error() << "Failed to update all files selected for updating. Updated" << updatedFilesCount - << "out of" << shouldHaveUpdatedCount << "selected for upating" << endl; + << "out of" << shouldHaveUpdatedCount << "selected for upating" << Qt::endl; return 1; } } diff --git a/cli/databasefactory.cpp b/cli/databasefactory.cpp index 5a10740..567e1ae 100644 --- a/cli/databasefactory.cpp +++ b/cli/databasefactory.cpp @@ -15,7 +15,7 @@ QSqlDatabase DatabaseFactory::createNew() db.setDatabaseName(this->connectionString); if(!db.open()) { - Logger::error() << "Failed to open the database: " << this->connectionString << endl; + Logger::error() << "Failed to open the database: " << this->connectionString << Qt::endl; throw LooqsGeneralException("Failed to create open new connection"); } return db; @@ -32,7 +32,7 @@ QSqlDatabase DatabaseFactory::forCurrentThread() db.setDatabaseName(this->connectionString); if(!db.open()) { - Logger::error() << "Failed to open the database: " << this->connectionString << endl; + Logger::error() << "Failed to open the database: " << this->connectionString << Qt::endl; throw LooqsGeneralException("Failed to create open new connection"); } dbStore.setLocalData(db); diff --git a/cli/filesaver.cpp b/cli/filesaver.cpp index c841bab..2ae1c14 100644 --- a/cli/filesaver.cpp +++ b/cli/filesaver.cpp @@ -73,12 +73,12 @@ int FileSaver::processFiles(const QVector paths, std::function paths, std::functiondbService->saveFile(fileInfo, pageData); diff --git a/cli/main.cpp b/cli/main.cpp index a63cce3..a490269 100644 --- a/cli/main.cpp +++ b/cli/main.cpp @@ -88,12 +88,12 @@ int main(int argc, char *argv[]) } catch(const LooqsGeneralException &e) { - Logger::error() << "Exception caught, message: " << e.message << endl; + Logger::error() << "Exception caught, message: " << e.message << Qt::endl; } } else { - Logger::error() << "Unknown command " << commandName << endl; + Logger::error() << "Unknown command " << commandName << Qt::endl; } return 1; } diff --git a/cli/sqlitedbservice.cpp b/cli/sqlitedbservice.cpp index b1226b9..57525e9 100644 --- a/cli/sqlitedbservice.cpp +++ b/cli/sqlitedbservice.cpp @@ -57,7 +57,7 @@ bool SqliteDbService::deleteFile(QString path) bool result = query.exec(); if(!result) { - Logger::error() << "Failed to delete file" << path << endl; + Logger::error() << "Failed to delete file" << path << Qt::endl; } return result; } @@ -128,20 +128,20 @@ SaveFileResult SqliteDbService::saveFile(QFileInfo fileInfo, QVector & if(!db.transaction()) { - Logger::error() << "Failed to open transaction for " << absPath << " : " << db.lastError() << endl; + Logger::error() << "Failed to open transaction for " << absPath << " : " << db.lastError() << Qt::endl; return DBFAIL; } if(!delQuery.exec()) { - Logger::error() << "Failed DELETE query" << delQuery.lastError() << endl; + Logger::error() << "Failed DELETE query" << delQuery.lastError() << Qt::endl; db.rollback(); return DBFAIL; } if(!inserterQuery.exec()) { - Logger::error() << "Failed INSERT query" << inserterQuery.lastError() << endl; + Logger::error() << "Failed INSERT query" << inserterQuery.lastError() << Qt::endl; db.rollback(); return DBFAIL; } @@ -157,7 +157,7 @@ SaveFileResult SqliteDbService::saveFile(QFileInfo fileInfo, QVector & if(!contentQuery.exec()) { db.rollback(); - Logger::error() << "Failed content insertion " << contentQuery.lastError() << endl; + Logger::error() << "Failed content insertion " << contentQuery.lastError() << Qt::endl; return DBFAIL; } } @@ -165,7 +165,7 @@ SaveFileResult SqliteDbService::saveFile(QFileInfo fileInfo, QVector & if(!db.commit()) { db.rollback(); - Logger::error() << "Failed to commit transaction for " << absPath << " : " << db.lastError() << endl; + Logger::error() << "Failed to commit transaction for " << absPath << " : " << db.lastError() << Qt::endl; return DBFAIL; } return OK;