Skip to content

Commit

Permalink
porting: remove deprecated flag init (#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
alexfikl authored Apr 25, 2024
1 parent 8b73c3c commit 8e66dbc
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/editreplacewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ void ReplaceWidget::doFind()
if (ui.comboBoxFind->findText(currentText) < 0)
ui.comboBoxFind->addItem(currentText);

QTextDocument::FindFlags flags = 0;
QTextDocument::FindFlags flags = QTextDocument::FindFlags();
if (ui.checkBoxCaseSensitive->isChecked())
flags |= QTextDocument::FindCaseSensitively;
if (ui.checkBoxWholeWords->isChecked())
Expand All @@ -112,7 +112,7 @@ void ReplaceWidget::doReplace()
if (ui.comboBoxReplace->findText(replacementText) < 0)
ui.comboBoxReplace->addItem(replacementText);

QTextDocument::FindFlags flags = 0;
QTextDocument::FindFlags flags = QTextDocument::FindFlags();
if (ui.checkBoxCaseSensitive->isChecked())
flags |= QTextDocument::FindCaseSensitively;
if (ui.checkBoxWholeWords->isChecked())
Expand Down
2 changes: 1 addition & 1 deletion app/tikzeditor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -505,7 +505,7 @@ void TikzEditor::keyPressEvent(QKeyEvent *event)
else if (event->key() == Qt::Key_Tab || event->key() == Qt::Key_Backtab) {
QTextCursor cursor = textCursor();
QTextBlock block = cursor.block();
QTextDocument::FindFlags flags = 0;
QTextDocument::FindFlags flags = QTextDocument::FindFlags();
if (event->key() == Qt::Key_Backtab)
flags = QTextDocument::FindBackward;
if (cursor.hasSelection() && cursor.selectedText().contains(QChar::ParagraphSeparator)) {
Expand Down
7 changes: 4 additions & 3 deletions app/tikzeditorview.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,13 @@ private Q_SLOTS:
void editReplace();
void tabIndent(bool isUnindenting = false);
void indent(QChar insertChar, int numOfInserts, bool isUnindenting = false);
bool search(const QString &text, QTextDocument::FindFlags flags = 0, bool startAtCursor = true,
bool continueFromBeginning = false);
bool search(const QString &text, QTextDocument::FindFlags flags = QTextDocument::FindFlags(),
bool startAtCursor = true, bool continueFromBeginning = false);
void search();
void replace(const QString &replacement);
void replace(const QString &text, const QString &replacement,
QTextDocument::FindFlags flags = 0, bool startAtCursor = true);
QTextDocument::FindFlags flags = QTextDocument::FindFlags(),
bool startAtCursor = true);
void replace();
void replaceAll();

Expand Down
2 changes: 1 addition & 1 deletion common/utils/file.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ class File : public QObject
File(const QUrl &url, const OpenMode &mode);
~File();

bool open(const QFile::OpenMode &mode = 0);
bool open(const QFile::OpenMode &mode = QFile::OpenMode());
bool close();
QFile *file();
QString errorString() const;
Expand Down

0 comments on commit 8e66dbc

Please sign in to comment.