Changeset 47 in projects for punch-card/punch-card-editor/src/qpunchcard/card.cc
- Timestamp:
- Dec 9, 2009, 2:56:54 AM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
punch-card/punch-card-editor/src/qpunchcard/card.cc
r44 r47 10 10 } 11 11 12 bool QPunchCard::Deck::save(FileFormat* format, QFile& file) {12 bool Deck::save(FileFormat* format, QFile& file) { 13 13 if(!format) return false; 14 14 return format->write(file); 15 } 16 17 bool Deck::insert(DeckIndex after) { 18 // TODO: Undo Redo Framework 19 if(!after.assertDeck(this)) 20 return false; 21 DeckIndex new_index = createIndex(after + 1); 22 qDebug("Inserting card at %i", (int)new_index.normalized()); 23 QList< QPointer<Card> >::insert( new_index.normalized(), new Card); 24 qDebug() << "Deck is now:" << *this; 25 emit contentsChanged(after, createIndex(count()) ); 26 return true; 27 } 28 29 bool Deck::move(DeckIndex before, DeckIndex after) { 30 // asdasdas 31 return true; 15 32 } 16 33 … … 48 65 dbg.nospace() << "QPunchCard::File object with [" << c.size() << "] cards:\n\n"; 49 66 for(int i = 0; i < c.size(); i++) { 50 dbg.nospace() << "Card no. #" << i << " \n";51 dbg.nospace() << c.at(i);67 dbg.nospace() << "Card no. #" << i << " (" << c[i] << ")\n"; 68 dbg.nospace() << *c.at(i); 52 69 dbg.nospace() << '\n'; 53 70 } 54 71 return dbg.nospace(); 55 72 } 73 74 QDebug QPunchCard::operator<<(QDebug dbg, const DeckIndex &c) { 75 dbg.nospace() << "QPunchCard::DeckIndex: i=" << c.asInt() << ". Has deck: " << c.hasDeck() << "\n"; 76 return dbg.nospace(); 77 }
Note: See TracChangeset
for help on using the changeset viewer.