@@ -32,12 +32,12 @@ QVariant ChipDbTableModel::data(const QModelIndex &index, int role) const
3232 switch (column)
3333 {
3434 case CHIP_PARAM_NAME:
35- return (* chipDb)[ index.row ()]-> name ;
35+ return chipDb-> getChipName ( index.row ()) ;
3636 case CHIP_PARAM_PAGE_SIZE:
3737 case CHIP_PARAM_BLOCK_SIZE:
3838 case CHIP_PARAM_TOTAL_SIZE:
3939 case CHIP_PARAM_SPARE_SIZE:
40- chipDb->getHexStringFromParam ((* chipDb)[ index.row ()]-> params [ column] ,
40+ chipDb->getHexStringFromParam (chipDb-> getChipParam ( index.row (), column) ,
4141 paramStr);
4242 return paramStr;
4343 case CHIP_PARAM_T_CS:
@@ -57,21 +57,21 @@ QVariant ChipDbTableModel::data(const QModelIndex &index, int role) const
5757 case CHIP_PARAM_ROW_CYCLES:
5858 case CHIP_PARAM_COL_CYCLES:
5959 case CHIP_PARAM_BB_MARK_OFF:
60- return (* chipDb)[ index.row ()]-> params [ column] ;
60+ return chipDb-> getChipParam ( index.row (), column) ;
6161 case CHIP_PARAM_READ1_CMD:
6262 case CHIP_PARAM_READ_ID_CMD:
6363 case CHIP_PARAM_RESET_CMD:
6464 case CHIP_PARAM_WRITE1_CMD:
6565 case CHIP_PARAM_ERASE1_CMD:
6666 case CHIP_PARAM_STATUS_CMD:
67- chipDb->getHexStringFromParam ((* chipDb)[ index.row ()]-> params [ column] ,
67+ chipDb->getHexStringFromParam (chipDb-> getChipParam ( index.row (), column) ,
6868 paramStr);
6969 return paramStr;
7070 case CHIP_PARAM_READ2_CMD:
7171 case CHIP_PARAM_WRITE2_CMD:
7272 case CHIP_PARAM_ERASE2_CMD:
73- chipDb->getHexStringFromOptParam ((* chipDb)[ index.row ()]-> params [column] ,
74- paramStr);
73+ chipDb->getHexStringFromOptParam (chipDb-> getChipParam ( index.row (),
74+ column), paramStr);
7575 return paramStr;
7676 }
7777
@@ -209,15 +209,15 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
209209 switch (index.column ())
210210 {
211211 case CHIP_PARAM_NAME:
212- (* chipDb)[ index.row ()]-> name = value.toString ();
212+ chipDb-> setChipName ( index.row (), value.toString () );
213213 return true ;
214214 case CHIP_PARAM_PAGE_SIZE:
215215 case CHIP_PARAM_BLOCK_SIZE:
216216 case CHIP_PARAM_TOTAL_SIZE:
217217 case CHIP_PARAM_SPARE_SIZE:
218218 if (chipDb->getParamFromHexString (value.toString (), paramVal))
219219 return false ;
220- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
220+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
221221 return true ;
222222 case CHIP_PARAM_T_CS:
223223 case CHIP_PARAM_T_CLS:
@@ -236,7 +236,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
236236 case CHIP_PARAM_BB_MARK_OFF:
237237 if (chipDb->getParamFromString (value.toString (), paramVal))
238238 return false ;
239- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
239+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
240240 return true ;
241241 case CHIP_PARAM_ROW_CYCLES:
242242 case CHIP_PARAM_COL_CYCLES:
@@ -247,7 +247,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
247247 {
248248 return false ;
249249 }
250- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
250+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
251251 return true ;
252252 case CHIP_PARAM_READ1_CMD:
253253 case CHIP_PARAM_READ_ID_CMD:
@@ -259,7 +259,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
259259 return false ;
260260 if (!chipDb->isParamValid (paramVal, 0x00 , 0xFF ))
261261 return false ;
262- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
262+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
263263 return true ;
264264 case CHIP_PARAM_READ2_CMD:
265265 case CHIP_PARAM_WRITE2_CMD:
@@ -268,7 +268,7 @@ bool ChipDbTableModel::setData(const QModelIndex &index, const QVariant &value,
268268 return false ;
269269 if (!chipDb->isOptParamValid (paramVal, 0x00 , 0xFF ))
270270 return false ;
271- (* chipDb)[ index.row ()]-> params [ index.column ()] = paramVal;
271+ chipDb-> setChipParam ( index.row (), index.column (), paramVal) ;
272272 return true ;
273273 }
274274
0 commit comments