From 3d6b09ddb444332afbe363b6d7f01d8e974fa642 Mon Sep 17 00:00:00 2001 From: Peinthor Rene Date: Mon, 25 Mar 2013 06:15:27 +0100 Subject: [PATCH] kill too long lines, no functional changes --- src/sqlitedb.cpp | 56 ++++++++++++++++++++++++++++++++---------------- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/src/sqlitedb.cpp b/src/sqlitedb.cpp index 483597d6..622ca670 100644 --- a/src/sqlitedb.cpp +++ b/src/sqlitedb.cpp @@ -174,8 +174,11 @@ void DBBrowserDB::close (){ { if (getDirty()) { - QString msg = QObject::tr("Do you want to save the changes made to the database file %1?").arg(curDBFilename); - if (QMessageBox::question( 0, QApplication::applicationName() ,msg, QMessageBox::Yes, QMessageBox::No)==QMessageBox::Yes) + if (QMessageBox::question( 0, + QApplication::applicationName(), + QObject::tr("Do you want to save the changes " + "made to the database file %1?").arg(curDBFilename), + QMessageBox::Yes, QMessageBox::No) == QMessageBox::Yes) save(); else revert(); //not really necessary, I think... but will not hurt. @@ -221,13 +224,16 @@ bool DBBrowserDB::dump(const QString& filename) QFile file(filename); if(file.open(QIODevice::WriteOnly)) { - // Create progress dialog. For this count the number of all table rows to be exported first; this does neither take the table creation itself nor + // Create progress dialog. For this count the number of all table rows to be exported first; + // this does neither take the table creation itself nor // indices, views or triggers into account but compared to the number of rows those should be neglectable unsigned int numRecordsTotal = 0, numRecordsCurrent = 0; QList tables = objMap.values("table"); for(QList::ConstIterator it=tables.begin();it!=tables.end();++it) - numRecordsTotal += getFindResults(QString("SELECT COUNT(*) FROM `%1`;").arg((*it).getname())).value(0).toInt(); - QProgressDialog progress(QObject::tr("Exporting database to SQL file..."), QObject::tr("Cancel"), 0, numRecordsTotal); + numRecordsTotal += getFindResults( + QString("SELECT COUNT(*) FROM `%1`;").arg((*it).getname())).value(0).toInt(); + QProgressDialog progress(QObject::tr("Exporting database to SQL file..."), + QObject::tr("Cancel"), 0, numRecordsTotal); progress.setWindowModality(Qt::ApplicationModal); // Regular expression to check for numeric strings @@ -352,14 +358,16 @@ bool DBBrowserDB::executeMultiSQL(const QString& statement, bool dirty, bool log if(sqlite3_step(vm) == SQLITE_ERROR) { sqlite3_finalize(vm); - lastErrorMessage = QObject::tr("Error in statement #%1: %2.\nAborting execution.").arg(line).arg(sqlite3_errmsg(_db)); + lastErrorMessage = QObject::tr("Error in statement #%1: %2.\n" + "Aborting execution.").arg(line).arg(sqlite3_errmsg(_db)); qDebug(lastErrorMessage.toStdString().c_str()); return false; } else { sqlite3_finalize(vm); } } else { - lastErrorMessage = QObject::tr("Error in statement #%1: %2.\nAborting execution.").arg(line).arg(sqlite3_errmsg(_db)); + lastErrorMessage = QObject::tr("Error in statement #%1: %2.\n" + "Aborting execution.").arg(line).arg(sqlite3_errmsg(_db)); qDebug(lastErrorMessage.toStdString().c_str()); return false; } @@ -503,7 +511,8 @@ bool DBBrowserDB::addColumn(const QString& tablename, const sqlb::FieldPtr& fiel bool DBBrowserDB::renameColumn(const QString& tablename, const QString& from, const QString& to, const QString& type) { - // NOTE: This function is working around the incomplete ALTER TABLE command in SQLite. If SQLite should fully support this command one day, this entire + // NOTE: This function is working around the incomplete ALTER TABLE command in SQLite. + // If SQLite should fully support this command one day, this entire // function can be changed to executing something like this: //QString sql = QString("ALTER TABLE `%1` MODIFY `%2` %3").arg(tablename).arg(to).arg(type); //return executeSQL(sql); @@ -525,7 +534,8 @@ bool DBBrowserDB::renameColumn(const QString& tablename, const QString& from, co return false; } - // Create a new table with a name that hopefully doesn't exist yet. Its layout is exactly the same as the one of the table to change - except for the column to change + // Create a new table with a name that hopefully doesn't exist yet. + // Its layout is exactly the same as the one of the table to change - except for the column to change // of course QList new_table_structure; for(int i=0;i