Skip to content

Commit

Permalink
fix: linting
Browse files Browse the repository at this point in the history
Signed-off-by: Patrizio Bekerle <[email protected]>
  • Loading branch information
pbek committed Jul 31, 2024
1 parent e5f697f commit b74bb35
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 12 deletions.
15 changes: 9 additions & 6 deletions src/dialogs/settingsdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ SettingsDialog::SettingsDialog(int page, QWidget *parent)
ui->openAiScriptingLabel->setText(ui->openAiScriptingLabel->text().arg(
"https://www.qownnotes.org/scripting/hooks.html#openaibackendshook"));
ui->openAiScriptingLabel3->setText(ui->openAiScriptingLabel3->text().arg(
"https://www.qownnotes.org/scripting/methods-and-objects.html#use-a-completion-prompt-on-the-currently-selected-ai-model"));
"https://www.qownnotes.org/scripting/"
"methods-and-objects.html#use-a-completion-prompt-on-the-currently-selected-ai-model"));

#ifndef Q_OS_LINUX
ui->systemIconThemeCheckBox->setHidden(true);
Expand Down Expand Up @@ -4376,11 +4377,13 @@ void SettingsDialog::on_showStatusBarNotePathCheckBox_toggled(bool checked) {
}

void SettingsDialog::on_groqApiTestButton_clicked() {
runAiApiTest(QStringLiteral("groq"), QStringLiteral("llama3-8b-8192"), ui->groqApiKeyLineEdit->text());
runAiApiTest(QStringLiteral("groq"), QStringLiteral("llama3-8b-8192"),
ui->groqApiKeyLineEdit->text());
}

void SettingsDialog::on_openAiApiTestButton_clicked() {
runAiApiTest(QStringLiteral("openai"), QStringLiteral("gpt-4o"), ui->openAiApiKeyLineEdit->text());
runAiApiTest(QStringLiteral("openai"), QStringLiteral("gpt-4o"),
ui->openAiApiKeyLineEdit->text());
}

void SettingsDialog::on_groqApiKeyLineEdit_textChanged(const QString &arg1) {
Expand Down Expand Up @@ -4440,8 +4443,9 @@ void SettingsDialog::buildAiScriptingTreeWidget() {
auto testButton = new QPushButton();
testButton->setText(tr("Test"));
testButton->setToolTip(tr("Test connection to %1 (%2)").arg(name, model));
testButton->setIcon(QIcon::fromTheme(QStringLiteral("network-connect"),
QIcon(":/icons/breeze-qownnotes/16x16/network-connect.svg")));
testButton->setIcon(
QIcon::fromTheme(QStringLiteral("network-connect"),
QIcon(":/icons/breeze-qownnotes/16x16/network-connect.svg")));
testButton->setProperty("backend", key);
testButton->setProperty("model", model);
connect(testButton, &QPushButton::clicked, this, [this, testButton]() {
Expand All @@ -4452,7 +4456,6 @@ void SettingsDialog::buildAiScriptingTreeWidget() {

ui->aiScriptingTreeWidget->setItemWidget(modelItem, 1, testButton);
}

}

ui->aiScriptingTreeWidget->setRootIsDecorated(false);
Expand Down
12 changes: 6 additions & 6 deletions src/mainwindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10817,16 +10817,16 @@ void MainWindow::noteEditCursorPositionChanged() {
this->noteHistory.updateCursorPositionOfNote(currentNote, textEdit);

QString text = tr("Ln %1, Col %2", "Line / Column")
.arg(QString::number(cursor.block().blockNumber() + 1),
QString::number(cursor.positionInBlock() + 1));
.arg(QString::number(cursor.block().blockNumber() + 1),
QString::number(cursor.positionInBlock() + 1));
QString toolTip = tr("Line %1, Column %2")
.arg(QString::number(cursor.block().blockNumber() + 1),
QString::number(cursor.positionInBlock() + 1));
.arg(QString::number(cursor.block().blockNumber() + 1),
QString::number(cursor.positionInBlock() + 1));

if (!selectedText.isEmpty()) {
const QString textAdd = QStringLiteral(" (") +
tr("%n selected", "Characters selected", selectedText.count()) +
QStringLiteral(")");
tr("%n selected", "Characters selected", selectedText.count()) +
QStringLiteral(")");
text += textAdd;
toolTip += textAdd;
}
Expand Down

0 comments on commit b74bb35

Please sign in to comment.