Show
Ignore:
Timestamp:
01/22/10 19:44:34 (2 years ago)
Author:
sven-win
Message:

Umfangreiche Weiterentwicklung (letzte Entwicklung am Netbook). Driver fuer M200 erstmals testweise implementiert; funktioniert(e mit Netbook).

-- Sven @ netboo

Files:
1 modified

Legend:

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

    r53 r59  
    2929        Q_OBJECT 
    3030 
    31         QSharedPointer<const FileFormat> format; 
     31        FileFormat format; 
    3232        QList< Card > cards; 
    33         QSharedPointer< QFile > file; 
    34         //QPointer<QUndoStack> undo_stack; 
     33        QString filename; 
    3534        QUndoStack undo_stack; 
    3635        friend class FileFormat; 
     
    4847        Deck(QObject* parent = 0); 
    4948        ~Deck() {}; 
    50         /// Create from file/stream/etc., that is, calls format->read() 
    51         Deck(const FileFormat* format, QObject* parent = 0); 
     49        /// Create from file with format 
     50        Deck(FileFormat format, const QString& filename, QObject* parent = 0); 
    5251 
    5352        // =========== Loading and Saving, File Format Handling ================== 
    5453        // (All Functions are just Shorthands for other direct public method calls) 
    5554        bool save(); 
    56         bool save(QFile& file); 
    57         bool save(const FileFormat* format, QFile& file); 
     55        bool save(const QString& filename); 
     56        bool save(FileFormat format, const QString& filename); 
     57        bool save(FileFormat format, QFile& file); 
    5858        bool read(); 
    59         bool read(QFile& file); 
    60         bool read(const FileFormat* format, QFile& file); 
     59        bool read(const QString& filename); 
     60        bool read(FileFormat format, const QString& filename); 
     61        bool read(FileFormat format, QFile& file); 
     62 
    6163 
    6264        bool canRead() const { return hasFile() && hasFormat(); } 
    6365        bool canSave() const { return canRead(); } 
    64         bool hasFormat() const { return format; } 
    65         void setFormat(const FileFormat* format); 
    66         bool hasFile() const { return file; } 
    67         void setFile(QFile* file); 
     66        bool hasFormat() const { return !format.isNull(); } 
     67        FileFormat getFormat() const { return format; } 
     68        void setFormat(FileFormat format) { this->format = format; } 
     69        bool hasFile() const { return filename.isEmpty(); } 
     70        void setFileName(const QString& filename) { this->filename = filename; } 
     71        const QString& getFileName() const { return filename; } 
    6872 
    6973        // =========== Undo Framework ================== 
© 2008 - 2010 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