Ignore:
Timestamp:
Dec 11, 2009, 9:35:47 PM (10 years ago)
Author:
sven
Message:
  • Text editing part:

Improved Column counting
80 column line bar

  • Saving with Jones Format works
File:
1 edited

Legend:

Unmodified
Added
Removed
  • punch-card/punch-card-editor/src/qpunchcard/card.h

    r48 r49  
    99#include <QUndoStack>
    1010#include <QFile>
     11#include <QSharedPointer>
    1112
    1213#include <QModelIndex>
     
    9495        Q_OBJECT
    9596
    96         QPointer<FileFormat> created_format;
     97        QSharedPointer<const FileFormat> created_format;
    9798        void init();
    9899
     
    106107        ~Deck() {};
    107108        /// Create from file/stream/etc., that is, calls format->read()
    108         Deck(FileFormat* format) : QList< QPointer<Card> >(), created_format(format) { init(); }
     109        Deck(const FileFormat* format) : QList< QPointer<Card> >(), created_format(format) { init(); }
    109110        /// Save with same device/format as created
    110         bool save(QFile& file) { return save(created_format, file); }
     111        bool save(QFile& file) { return save(created_format.data(), file); }
    111112        /// Save
    112         bool save(FileFormat* format, QFile& file);
     113        bool save(const FileFormat* format, QFile& file);
     114        bool read(QFile& file) { return read(created_format.data(), file); }
     115        bool read(const FileFormat* format, QFile& file);
    113116
    114117        bool canSave() const { return created_format; }
    115         void setFormat(FileFormat* format) { created_format = format; } // TODO: was ist mit altem format?
     118        void setFormat(const FileFormat* format);
    116119        //File* getFile() { if(created_format && created_format->file) return created_format->file; }
    117120
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License