[Qgis-developer] Current Edits and Toggle Editing move to public slots?

Larry Shaffer larrys at dakotacarto.com
Thu Dec 27 12:26:49 PST 2012


Hi,

I would like to move the following private slots in qgisapp.h [0] to
public slots:

    // older slots
    void toggleEditing();
    bool toggleEditing( QgsMapLayer *layer, bool allowCancel = true );
    void saveEdits( QgsMapLayer *layer, bool leaveEditable = true );

    // ones I recently added
    void cancelEdits( QgsMapLayer *layer, bool leaveEditable = true );
    void saveEdits();
    void saveAllEdits( bool verifyAction = true );
    void rollbackEdits();
    void rollbackAllEdits( bool verifyAction = true );
    void cancelEdits();
    void cancelAllEdits( bool verifyAction = true );

This would be to allow better access from other dialogs, not just from
the main window interface. This would also allow calling them directly
without requiring a signal/slot or QMetaObject setup. It will also
help fix a bug [1] (see two variations on fix here [2]).

Is there a reason these slots should stay private?

Also, why are so many slots in QgisApp private? (There may be other
slots that make sense to move to public.)

[0] https://github.com/qgis/Quantum-GIS/blob/master/src/app/qgisapp.h#L788
[1] http://hub.qgis.org/issues/6725
[2] https://github.com/dakcarto/Quantum-GIS/commits/attr-table-editor_cancel-editing-fix_1/src/app/qgsattributetabledialog.cpp

Regards,

Larry


More information about the Qgis-developer mailing list