mainwindow.cc
changeset 12 84b0f3ca474a
parent 10 e1abdc480485
child 14 3d8176df0461
equal deleted inserted replaced
11:d927333c8ffe 12:84b0f3ca474a
    22 	    this, 
    22 	    this, 
    23 	    tr("Open IGC file"), 
    23 	    tr("Open IGC file"), 
    24 	    "flights", tr("IGC files (*.igc);; All files (*)"));
    24 	    "flights", tr("IGC files (*.igc);; All files (*)"));
    25     if (fileName.isEmpty()) return;
    25     if (fileName.isEmpty()) return;
    26 
    26 
       
    27     if(currentFile.isOpen()) 
       
    28 	currentFile.close();
       
    29 
    27     currentFile.setFileName(fileName);
    30     currentFile.setFileName(fileName);
    28 
    31 
    29     if (!currentFile.open(QFile::ReadOnly)) {
    32     if (!currentFile.open(QFile::ReadOnly)) {
    30 	QMessageBox::critical(this, 
    33 	QMessageBox::critical(this, 
    31 	    tr("Ooops!"),
    34 	    tr("Ooops!"),
    37     setWindowTitle(QFileInfo(fileName).baseName());
    40     setWindowTitle(QFileInfo(fileName).baseName());
    38     statusBar()->showMessage(tr("opening %1").arg(fileName), 5000);
    41     statusBar()->showMessage(tr("opening %1").arg(fileName), 5000);
    39 
    42 
    40     igc.read(input);
    43     igc.read(input);
    41 
    44 
       
    45     qDebug() << igc.device();
       
    46     qDebug() << igc.pilot();
       
    47     qDebug() << igc.date();
       
    48 
    42 }
    49 }