Changeset - 921170ff88f1
[Not reviewed]
Hasan Yavuz Ă–ZDERYA - 10 years ago 2016-04-03 15:18:19
hy@ozderya.net
fix crash when opening snapshot loaded from file, read channel names from the file
1 file changed with 3 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/snapshotmanager.cpp
Show inline comments
 
@@ -147,7 +147,8 @@ void SnapshotManager::loadSnapshotFromFi
 

	
 
    // read first row as headlines and determine number of channels
 
    auto headLine = QString(file.readLine());
 
    unsigned numOfChannels = headLine.split(',').size();
 
    QStringList channelNames = headLine.split(',');
 
    unsigned numOfChannels = channelNames.size();
 

	
 
    // read data
 
    QVector<QVector<QPointF>> data(numOfChannels);
 
@@ -185,6 +186,7 @@ void SnapshotManager::loadSnapshotFromFi
 

	
 
    auto snapshot = new Snapshot(_mainWindow, QFileInfo(fileName).baseName());
 
    snapshot->data = data;
 
    snapshot->setChannelNames(channelNames);
 

	
 
    addSnapshot(snapshot, false);
 
}
0 comments (0 inline, 0 general)