mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 02:50:46 -06:00
Fix a few bugs in the CSV import
Start numbering the rows in the preview table view of the ImportCSVForm with #1 instead of 0. Don't create too many columns when filling the preview table view. Keep the UI responsive when reading a CSV file. This way the progress dialog can be seen, too. Don't crash when reading files without an empty line at their end.
This commit is contained in:
@@ -733,8 +733,8 @@ QStringList DBBrowserDB::decodeCSV(const QString & csvfilename, char sep, char q
|
||||
QProgressDialog progress("Decoding CSV file...", "Cancel", 0, file.size());
|
||||
progress.setWindowModality(Qt::ApplicationModal);
|
||||
char c=0;
|
||||
while ( c!=-1) {
|
||||
file.getChar(&c);
|
||||
while(file.getChar(&c))
|
||||
{
|
||||
if (c==quote){
|
||||
if (inquotemode){
|
||||
if (inescapemode){
|
||||
@@ -778,6 +778,7 @@ QStringList DBBrowserDB::decodeCSV(const QString & csvfilename, char sep, char q
|
||||
}
|
||||
recs++;
|
||||
progress.setValue(file.pos());
|
||||
qApp->processEvents();
|
||||
if (progress.wasCanceled()) break;
|
||||
if ((recs>maxrecords)&&(maxrecords!=-1)) {
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user