File tree Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Expand file tree Collapse file tree 3 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -24,9 +24,6 @@ class CodeEditor : public QPlainTextEdit
24
24
signals:
25
25
void statusMessageChanged (const QString &message);
26
26
27
- signals:
28
- void statusMessageChanged (const QString &message);
29
-
30
27
protected:
31
28
void keyPressEvent (QKeyEvent *event) override ;
32
29
void resizeEvent (QResizeEvent *event) override ;
Original file line number Diff line number Diff line change 5
5
#include < QPainter>
6
6
#include < QTextBlock>
7
7
#include < QStatusBar>
8
+ #include < QFileInfo>
8
9
9
10
CodeEditor::CodeEditor (QWidget *parent)
10
11
: QPlainTextEdit(parent),
Original file line number Diff line number Diff line change @@ -170,13 +170,13 @@ void MainWindow::openFile()
170
170
171
171
void MainWindow::saveFile ()
172
172
{
173
- if (editor ->getCurrentFileName ().isEmpty ())
173
+ if (m_editor ->getCurrentFileName ().isEmpty ())
174
174
{
175
175
saveFileAs ();
176
176
return ;
177
177
}
178
178
179
- QFile file (editor ->getCurrentFileName ());
179
+ QFile file (m_editor ->getCurrentFileName ());
180
180
if (!file.open (QFile::WriteOnly | QFile::Text))
181
181
{
182
182
QMessageBox::warning (this , " Error" , " Cannot save file: " + file.errorString ());
@@ -205,7 +205,7 @@ void MainWindow::saveFileAs()
205
205
206
206
if (!fileName.isEmpty ())
207
207
{
208
- editor ->setCurrentFileName (fileName);
208
+ m_editor ->setCurrentFileName (fileName);
209
209
saveFile ();
210
210
}
211
211
}
@@ -231,6 +231,6 @@ void MainWindow::loadFileInEditor(const QString &filePath)
231
231
}
232
232
file.close ();
233
233
234
- editor ->setCurrentFileName (filePath);
234
+ m_editor ->setCurrentFileName (filePath);
235
235
setWindowTitle (" CodeAstra ~ " + QFileInfo (filePath).fileName ());
236
236
}
You can’t perform that action at this time.
0 commit comments