Skip to content

Commit

Permalink
lint: format code using clang-format
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Feb 2, 2025
1 parent 38037b1 commit a1c7a31
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 7 deletions.
10 changes: 7 additions & 3 deletions src/dialogs/linkdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ LinkDialog::LinkDialog(int page, const QString &dialogTitle, QWidget *parent)
setupFileUrlMenu();
}

LinkDialog::~LinkDialog() { delete ui; delete _markdownTextEdit; }
LinkDialog::~LinkDialog() {
delete ui;
delete _markdownTextEdit;
}

void LinkDialog::on_searchLineEdit_textChanged(const QString &arg1) {
// search notes when at least 2 characters were entered
Expand Down Expand Up @@ -112,7 +115,8 @@ Note LinkDialog::getSelectedNote() const {
}

QString LinkDialog::getSelectedHeading() const {
// Trim the heading text, in case there are trailing carriage return characters leaking in Windows
// Trim the heading text, in case there are trailing carriage return characters leaking in
// Windows
return ui->headingListWidget->selectedItems().isEmpty()
? ""
: ui->headingListWidget->currentItem()->text().trimmed();
Expand Down Expand Up @@ -403,7 +407,7 @@ void LinkDialog::loadNoteHeadings() const {
auto nodes = NavigationWidget::parseDocument(_markdownTextEdit->document());
QStringList headingTexts;
std::transform(nodes.begin(), nodes.end(), std::back_inserter(headingTexts),
[](const Node& node) { return node.text; });
[](const Node &node) { return node.text; });

ui->headingListWidget->clear();
ui->headingListWidget->addItems(headingTexts);
Expand Down
2 changes: 1 addition & 1 deletion src/libraries/qmarkdowntextedit
2 changes: 1 addition & 1 deletion src/utils/misc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2662,7 +2662,7 @@ int Utils::Misc::getMaximumNoteFileSize() {
* @param filePath
* @return
*/
QString Utils::Misc::encodeFilePath(const QString& filePath) {
QString Utils::Misc::encodeFilePath(const QString &filePath) {
// Split the path into segments to preserve the directory separators
QStringList segments = filePath.split('/');

Expand Down
2 changes: 1 addition & 1 deletion src/utils/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ QString getBaseUrlFromUrlString(const QString &urlString, bool withBasePath = fa
QString createAbsolutePathsInHtml(const QString &html, const QString &url);
int getPreviewRefreshDebounceTime();
int getMaximumNoteFileSize();
QString encodeFilePath(const QString& filePath);
QString encodeFilePath(const QString &filePath);
} // namespace Misc
} // namespace Utils

Expand Down
3 changes: 2 additions & 1 deletion src/widgets/navigationwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,8 @@ QVector<Node> NavigationWidget::parseDocument(const QTextDocument *const documen
continue;
}
static const QRegularExpression re(QStringLiteral("^#+\\s+"));
// Trim the heading text, in case there are trailing carriage return characters leaking in Windows
// Trim the heading text, in case there are trailing carriage return characters leaking in
// Windows
QString text = block.text().remove(re).trimmed();

if (text.isEmpty()) {
Expand Down

0 comments on commit a1c7a31

Please sign in to comment.