Skip to content

Commit

Permalink
Fix naming issue that was causing release mode to crash
Browse files Browse the repository at this point in the history
  • Loading branch information
AleksandrHovhannisyan committed Jun 22, 2019
1 parent e9c197d commit 22dbe64
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
16 changes: 8 additions & 8 deletions CustomTextEditor/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWi
// Add metric reporter and simulate a tab switch
metricReporter = new MetricReporter();
ui->statusBar->addPermanentWidget(metricReporter);
on_currentTab_changed(0);
on_currentTabChanged(0);

// Connect tabbedEditor's signals to their handlers
connect(tabbedEditor, SIGNAL(currentChanged(int)), this, SLOT(on_currentTab_changed(int)));
connect(tabbedEditor, SIGNAL(currentChanged(int)), this, SLOT(on_currentTabChanged(int)));
connect(tabbedEditor, SIGNAL(tabCloseRequested(int)), this, SLOT(closeTab(int)));

// Connect action signals to their handlers
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(on_actionSave_or_actionSaveAs_triggered()));
connect(ui->actionSave_As, SIGNAL(triggered()), this, SLOT(on_actionSave_or_actionSaveAs_triggered()));
connect(ui->actionSave, SIGNAL(triggered()), this, SLOT(on_actionSaveTriggered()));
connect(ui->actionSave_As, SIGNAL(triggered()), this, SLOT(on_actionSaveTriggered()));
connect(ui->actionReplace, SIGNAL(triggered()), this, SLOT(on_actionFind_triggered()));

// Have to add this shortcut manually because we can't define it via the GUI editor
Expand Down Expand Up @@ -154,7 +154,7 @@ void MainWindow::on_languageSelected(QAction* languageAction)


/* Given a Language enum, this function checks the corresponding radio option from the Format > Language
* menu. Used by on_currentTab_changed to reflect the current tab's selected language.
* menu. Used by on_currentTabChanged to reflect the current tab's selected language.
*/
void MainWindow::triggerCorrespondingMenuLanguageOption(Language lang)
{
Expand Down Expand Up @@ -289,7 +289,7 @@ void MainWindow::reconnectEditorDependentSignals()
/* Called each time the current tab changes in the tabbed editor. Sets the main window's current editor,
* reconnects any relevant signals, and updates the window.
*/
void MainWindow::on_currentTab_changed(int index)
void MainWindow::on_currentTabChanged(int index)
{
// Happens when the tabbed editor's last tab is closed
if(index == -1)
Expand Down Expand Up @@ -418,7 +418,7 @@ void MainWindow::on_actionNew_triggered()
* user chose Save As, the program prompts the user to specify a name and directory for the file.
* Returns true if the file was saved and false otherwise.
*/
bool MainWindow::on_actionSave_or_actionSaveAs_triggered()
bool MainWindow::on_actionSaveTriggered()
{
bool saveAs = sender() == ui->actionSave_As;
QString currentFilePath = editor->getCurrentFilePath();
Expand Down Expand Up @@ -562,7 +562,7 @@ bool MainWindow::closeTab(Editor *tabToClose)

if(selection == QMessageBox::StandardButton::Yes)
{
bool fileSaved = on_actionSave_or_actionSaveAs_triggered();
bool fileSaved = on_actionSaveTriggered();

if(!fileSaved)
{
Expand Down
4 changes: 2 additions & 2 deletions CustomTextEditor/mainwindow.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,10 @@ public slots:

// All UI and/or keyboard shortcut interactions
private slots:
void on_currentTab_changed(int index);
void on_currentTabChanged(int index);
void on_languageSelected(QAction* languageAction);
void on_actionNew_triggered();
bool on_actionSave_or_actionSaveAs_triggered();
bool on_actionSaveTriggered();
void on_actionOpen_triggered();
void on_actionExit_triggered();
void on_actionUndo_triggered();
Expand Down

0 comments on commit 22dbe64

Please sign in to comment.