Remove some commented code

git-svn-id: svn+ssh://svn.tuxfamily.org/svnroot/qet/qet/trunk@5275 bfdf4180-ca20-0410-9c96-a3a8aa849046
This commit is contained in:
blacksun
2018-03-24 14:35:32 +00:00
parent 0a4bca6acc
commit 8193687894
2 changed files with 26 additions and 35 deletions

View File

@@ -105,7 +105,6 @@ QETDiagramEditor::QETDiagramEditor(const QStringList &files, QWidget *parent) :
connect (&workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subWindowActivated(QMdiSubWindow*))); connect (&workspace, SIGNAL(subWindowActivated(QMdiSubWindow *)), this, SLOT(subWindowActivated(QMdiSubWindow*)));
connect (QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updatePasteAction())); connect (QApplication::clipboard(), SIGNAL(dataChanged()), this, SLOT(slot_updatePasteAction()));
//connect (&undo_group, SIGNAL(cleanChanged(bool)), this, SLOT(activeUndoStackCleanChanged(bool)));
readSettings(); readSettings();
show(); show();
@@ -708,7 +707,7 @@ bool QETDiagramEditor::event(QEvent *e)
Imprime le schema courant Imprime le schema courant
*/ */
void QETDiagramEditor::printDialog() { void QETDiagramEditor::printDialog() {
ProjectView *current_project = currentProject(); ProjectView *current_project = currentProjectView();
if (!current_project) return; if (!current_project) return;
current_project -> printProject(); current_project -> printProject();
} }
@@ -717,7 +716,7 @@ void QETDiagramEditor::printDialog() {
Gere l'export de schema sous forme d'image Gere l'export de schema sous forme d'image
*/ */
void QETDiagramEditor::exportDialog() { void QETDiagramEditor::exportDialog() {
ProjectView *current_project = currentProject(); ProjectView *current_project = currentProjectView();
if (!current_project) return; if (!current_project) return;
current_project -> exportProject(); current_project -> exportProject();
} }
@@ -727,7 +726,7 @@ void QETDiagramEditor::exportDialog() {
* Ask the current active project to save * Ask the current active project to save
*/ */
void QETDiagramEditor::save() { void QETDiagramEditor::save() {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProjectView()) {
QETResult saved = project_view -> save(); QETResult saved = project_view -> save();
if (saved.isOk()) { if (saved.isOk()) {
@@ -751,7 +750,7 @@ void QETDiagramEditor::save() {
* Ask the current active project to save as * Ask the current active project to save as
*/ */
void QETDiagramEditor::saveAs() { void QETDiagramEditor::saveAs() {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProjectView()) {
QETResult save_file = project_view -> saveAs(); QETResult save_file = project_view -> saveAs();
if (save_file.isOk()) { if (save_file.isOk()) {
QETApp::projectsRecentFiles() -> fileWasOpened(project_view -> project() -> filePath()); QETApp::projectsRecentFiles() -> fileWasOpened(project_view -> project() -> filePath());
@@ -860,7 +859,7 @@ bool QETDiagramEditor::closeProject(QETProject *project) {
Note : cette methode renvoie true s'il n'y a pas de projet courant Note : cette methode renvoie true s'il n'y a pas de projet courant
*/ */
bool QETDiagramEditor::closeCurrentProject() { bool QETDiagramEditor::closeCurrentProject() {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProjectView()) {
return(closeProject(project_view)); return(closeProject(project_view));
} }
return(true); return(true);
@@ -1011,7 +1010,7 @@ QList<ProjectView *> QETDiagramEditor::openedProjects() const {
@return Le projet actuellement edite (= qui a le focus dans l'interface @return Le projet actuellement edite (= qui a le focus dans l'interface
MDI) ou 0 s'il n'y en a pas MDI) ou 0 s'il n'y en a pas
*/ */
ProjectView *QETDiagramEditor::currentProject() const { ProjectView *QETDiagramEditor::currentProjectView() const {
QMdiSubWindow *current_window = workspace.activeSubWindow(); QMdiSubWindow *current_window = workspace.activeSubWindow();
if (!current_window) return(nullptr); if (!current_window) return(nullptr);
@@ -1029,7 +1028,7 @@ ProjectView *QETDiagramEditor::currentProject() const {
courant) ou 0 s'il n'y en a pas courant) ou 0 s'il n'y en a pas
*/ */
DiagramView *QETDiagramEditor::currentDiagram() const { DiagramView *QETDiagramEditor::currentDiagram() const {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProjectView()) {
return(project_view -> currentDiagram()); return(project_view -> currentDiagram());
} }
return(nullptr); return(nullptr);
@@ -1310,7 +1309,7 @@ void QETDiagramEditor::rowColumnGroupTriggered(QAction *action)
*/ */
void QETDiagramEditor::slot_setSelectionMode() void QETDiagramEditor::slot_setSelectionMode()
{ {
if (ProjectView *pv = currentProject()) if (ProjectView *pv = currentProjectView())
foreach(DiagramView *dv, pv -> diagram_views()) foreach(DiagramView *dv, pv -> diagram_views())
dv -> setSelectionMode(); dv -> setSelectionMode();
} }
@@ -1321,7 +1320,7 @@ void QETDiagramEditor::slot_setSelectionMode()
*/ */
void QETDiagramEditor::slot_setVisualisationMode() void QETDiagramEditor::slot_setVisualisationMode()
{ {
if (ProjectView *pv = currentProject()) if (ProjectView *pv = currentProjectView())
foreach(DiagramView *dv, pv -> diagram_views()) foreach(DiagramView *dv, pv -> diagram_views())
dv -> setVisualisationMode(); dv -> setVisualisationMode();
} }
@@ -1333,7 +1332,7 @@ void QETDiagramEditor::slot_setVisualisationMode()
void QETDiagramEditor::slot_updateActions() void QETDiagramEditor::slot_updateActions()
{ {
DiagramView *dv = currentDiagram(); DiagramView *dv = currentDiagram();
ProjectView *pv = currentProject(); ProjectView *pv = currentProjectView();
bool opened_project = pv; bool opened_project = pv;
bool opened_diagram = dv; bool opened_diagram = dv;
@@ -1373,8 +1372,8 @@ void QETDiagramEditor::slot_updateActions()
void QETDiagramEditor::slot_updateAutoNumDock() { void QETDiagramEditor::slot_updateAutoNumDock() {
if ( workspace.subWindowList().indexOf(workspace.activeSubWindow()) != activeSubWindowIndex) { if ( workspace.subWindowList().indexOf(workspace.activeSubWindow()) != activeSubWindowIndex) {
activeSubWindowIndex = workspace.subWindowList().indexOf(workspace.activeSubWindow()); activeSubWindowIndex = workspace.subWindowList().indexOf(workspace.activeSubWindow());
if (currentProject() != nullptr && currentDiagram() != nullptr) { if (currentProjectView() != nullptr && currentDiagram() != nullptr) {
m_autonumbering_dock->setProject(currentProject()->project(),currentProject()); m_autonumbering_dock->setProject(currentProjectView()->project(),currentProjectView());
} }
} }
} }
@@ -1385,16 +1384,8 @@ void QETDiagramEditor::slot_updateAutoNumDock() {
*/ */
void QETDiagramEditor::slot_updateUndoStack() void QETDiagramEditor::slot_updateUndoStack()
{ {
ProjectView *pv = currentProject(); if(currentProjectView())
if (pv) undo_group.setActiveStack(currentProjectView()->project()->undoStack());
{
undo_group.setActiveStack(pv->project()->undoStack());
// save_file -> setEnabled (undo_group.activeStack() -> count() && !pv -> project() -> isReadOnly());
// }
// else
// {
// //save_file -> setDisabled(true);
}
} }
/** /**
@@ -1520,7 +1511,7 @@ void QETDiagramEditor::slot_updateModeActions()
} }
} }
if (ProjectView *pv = currentProject()) if (ProjectView *pv = currentProjectView())
{ {
m_auto_conductor -> setEnabled (true); m_auto_conductor -> setEnabled (true);
m_auto_conductor -> setChecked (pv -> project() -> autoConductor()); m_auto_conductor -> setChecked (pv -> project() -> autoConductor());
@@ -1649,7 +1640,7 @@ bool QETDiagramEditor::drawGrid() const {
* Retrieve current DiagramView used in diagram editor * Retrieve current DiagramView used in diagram editor
*/ */
DiagramView *QETDiagramEditor::acessCurrentDiagramView () { DiagramView *QETDiagramEditor::acessCurrentDiagramView () {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProjectView()) {
return(project_view -> currentDiagram()); return(project_view -> currentDiagram());
} }
return(nullptr); return(nullptr);
@@ -1692,7 +1683,7 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
windows_actions -> addAction(action); windows_actions -> addAction(action);
action -> setStatusTip(QString(tr("Active le projet « %1 »")).arg(pv_title)); action -> setStatusTip(QString(tr("Active le projet « %1 »")).arg(pv_title));
action -> setCheckable(true); action -> setCheckable(true);
action -> setChecked(project_view == currentProject()); action -> setChecked(project_view == currentProjectView());
connect(action, SIGNAL(triggered()), &windowMapper, SLOT(map())); connect(action, SIGNAL(triggered()), &windowMapper, SLOT(map()));
windowMapper.setMapping(action, project_view); windowMapper.setMapping(action, project_view);
} }
@@ -1702,7 +1693,7 @@ void QETDiagramEditor::slot_updateWindowsMenu() {
Edite les informations du schema en cours Edite les informations du schema en cours
*/ */
void QETDiagramEditor::editCurrentDiagramProperties() { void QETDiagramEditor::editCurrentDiagramProperties() {
if (ProjectView *project_view = currentProject()) { if (ProjectView *project_view = currentProjectView()) {
activateProject(project_view); activateProject(project_view);
project_view -> editCurrentDiagramProperties(); project_view -> editCurrentDiagramProperties();
} }
@@ -1755,7 +1746,7 @@ void QETDiagramEditor::slot_resetConductors() {
*/ */
void QETDiagramEditor::slot_autoConductor(bool ac) void QETDiagramEditor::slot_autoConductor(bool ac)
{ {
if (ProjectView *pv = currentProject()) if (ProjectView *pv = currentProjectView())
pv -> project() -> setAutoConductor(ac); pv -> project() -> setAutoConductor(ac);
} }
@@ -1865,7 +1856,7 @@ void QETDiagramEditor::projectWasClosed(ProjectView *project_view) {
Edite les proprietes du projet courant. Edite les proprietes du projet courant.
*/ */
void QETDiagramEditor::editCurrentProjectProperties() { void QETDiagramEditor::editCurrentProjectProperties() {
editProjectProperties(currentProject()); editProjectProperties(currentProjectView());
} }
/** /**
@@ -1890,7 +1881,7 @@ void QETDiagramEditor::editProjectProperties(QETProject *project) {
Ajoute un nouveau schema au projet courant Ajoute un nouveau schema au projet courant
*/ */
void QETDiagramEditor::addDiagramToProject() { void QETDiagramEditor::addDiagramToProject() {
if (ProjectView *current_project = currentProject()) { if (ProjectView *current_project = currentProjectView()) {
current_project -> addNewDiagram(); current_project -> addNewDiagram();
} }
} }
@@ -1900,7 +1891,7 @@ void QETDiagramEditor::addDiagramToProject() {
* Add new folio list to project * Add new folio list to project
*/ */
void QETDiagramEditor::addDiagramFolioListToProject() { void QETDiagramEditor::addDiagramFolioListToProject() {
if (ProjectView *current_project = currentProject()) if (ProjectView *current_project = currentProjectView())
current_project -> addNewDiagramFolioList(); current_project -> addNewDiagramFolioList();
} }
@@ -2044,7 +2035,7 @@ void QETDiagramEditor::moveDiagramDownx10(Diagram *diagram) {
Nettoie le projet courant Nettoie le projet courant
*/ */
void QETDiagramEditor::cleanCurrentProject() { void QETDiagramEditor::cleanCurrentProject() {
if (ProjectView *current_project = currentProject()) { if (ProjectView *current_project = currentProjectView()) {
int clean_count = current_project -> cleanProject(); int clean_count = current_project -> cleanProject();
if (clean_count) pa -> reloadAndFilter(); if (clean_count) pa -> reloadAndFilter();
} }
@@ -2059,7 +2050,7 @@ void QETDiagramEditor::reloadOldElementPanel() {
*/ */
void QETDiagramEditor::nomenclatureProject() { void QETDiagramEditor::nomenclatureProject() {
//TODO: Test nomenclature CYRIL F. //TODO: Test nomenclature CYRIL F.
nomenclature nomencl(currentProject()->project() ,this); nomenclature nomencl(currentProjectView()->project() ,this);
nomencl.saveToCSVFile(); nomencl.saveToCSVFile();
} }
@@ -2067,7 +2058,7 @@ void QETDiagramEditor::nomenclatureProject() {
Supprime le schema courant du projet courant Supprime le schema courant du projet courant
*/ */
void QETDiagramEditor::removeDiagramFromProject() { void QETDiagramEditor::removeDiagramFromProject() {
if (ProjectView *current_project = currentProject()) { if (ProjectView *current_project = currentProjectView()) {
if (DiagramView *current_diagram = current_project -> currentDiagram()) { if (DiagramView *current_diagram = current_project -> currentDiagram()) {
bool isFolioList = false; bool isFolioList = false;

View File

@@ -76,7 +76,7 @@ class QETDiagramEditor : public QETMainWindow {
private: private:
bool addProject(QETProject *, bool = true); bool addProject(QETProject *, bool = true);
ProjectView *currentProject() const; ProjectView *currentProjectView() const;
DiagramView *currentDiagram() const; DiagramView *currentDiagram() const;
Element *currentElement() const; Element *currentElement() const;
CustomElement * currentCustomElement() const; CustomElement * currentCustomElement() const;