Subversion Repositories Programming Utils

Compare Revisions

Ignore whitespace Rev 90 → Rev 91

/trunk/TrainDatabase/traintablemodel.cpp
25,7 → 25,7
if (role == Qt::DisplayRole || role == Qt::EditRole) {
TrainRecord* record = this->access->getRecord( row );
if( record == NULL ){
qDebug() << "ERROR: TrainRecord NULL";
qDebug() << "ERROR: TrainRecord NULL. Row " << row;
return QVariant();
}
switch( col ){
/trunk/TrainDatabase/dbaccess.cpp
106,10 → 106,11
}
 
TrainRecord* DBAccess::getRecord(int num){
if( num < 0 || num > records ){
printf( "RETURN NULL" );
if( num < 0 || (unsigned)num > allRecords.size() ){
qDebug() << "RETURN NULL";
return NULL;
}
 
return allRecords[ num ];
}
 
242,6 → 243,7
sqlite3_column_int( res, 4 ),
(const char*)sqlite3_column_text( res, 5 )
);
 
allRecords.push_back( newRecord );
 
return newRecord;
/trunk/TrainDatabase/trainrecord.cpp
3,7 → 3,7
 
#include "trainrecord.h"
 
TrainRecord::TrainRecord( int key, const char* reporting_mark, uint16_t road_number,
TrainRecord::TrainRecord( int key, const char* reporting_mark, uint32_t road_number,
const char* stock_type, uint16_t costi, const char* notesi ){
if( reporting_mark != NULL ){
reporting.assign( reporting_mark );
27,11 → 27,11
reporting.assign( mark );
}
 
uint16_t TrainRecord::getRoadNumber(){
uint32_t TrainRecord::getRoadNumber(){
return road;
}
 
void TrainRecord::setRoadNumber( uint16_t roadIn ){
void TrainRecord::setRoadNumber( uint32_t roadIn ){
road = roadIn;
}
 
/trunk/TrainDatabase/TrainDatabase.pro
31,3 → 31,6
 
FORMS += traindb.ui \
aboutdialog.ui
 
#need the dynamic loader for some reason
unix:LIBS += -ldl
/trunk/TrainDatabase/trainrecord.h
9,7 → 9,7
public:
TrainRecord( int key,
const char* reporting_mark,
uint16_t road_number,
uint32_t road_number,
const char* stock_type,
uint16_t costi,
const char* notes );
17,8 → 17,8
std::string getReportingMark();
void setReportingMark( std::string );
 
uint16_t getRoadNumber();
void setRoadNumber( uint16_t );
uint32_t getRoadNumber();
void setRoadNumber( uint32_t );
 
std::string getStockType();
void setStockType( std::string );
33,7 → 33,7
 
private:
std::string reporting;
uint16_t road;
uint32_t road;
std::string stock;
uint16_t cost;
std::string notes;