Skip to content
This repository was archived by the owner on Oct 5, 2025. It is now read-only.

Commit 6edeb0a

Browse files
authored
Merge pull request #139 from Nighty3098/InDev
Now the automatic update information window will not open if there are no updates available
2 parents 5a2dc6a + 469e05c commit 6edeb0a

5 files changed

Lines changed: 13 additions & 12 deletions

File tree

src/CodeKeeper/keeperFunc/functional.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,8 @@ void MainWindow::getSettingsData()
8888
isAutoCheckUpdates = globalSettings->value("isAutoCheckUpdates").value<bool>();
8989

9090
qDebug() << " " << dir << selectedFont << font_size << theme << isCustomTitlebar << sortNotesRole << isAutoSyncing << isVisibleNotesList
91-
<< isVisibleFolders << isVisiblePreview << isViewMode << git_repo << git_user << git_token << isAutoSyncB << isCustomTheme << isAutoCheckUpdates;
91+
<< isVisibleFolders << isVisiblePreview << isViewMode << git_repo << git_user << git_token << isAutoSyncB << isCustomTheme
92+
<< isAutoCheckUpdates;
9293
}
9394

9495
void MainWindow::setConnectionStatus()

src/CodeKeeper/mainwindow.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,13 +72,10 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
7272
if (currentAppVersion == newAppVersion) {
7373

7474
} else {
75-
settingsWindow->checkUpdates();
75+
settingsWindow->checkUpdates(false);
7676
}
77+
} else {
7778
}
78-
else {
79-
80-
}
81-
8279
});
8380
updatesThread->start();
8481

src/CodeKeeper/settingsFunc/functional.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ void SettingsWindow::closeEvent(QCloseEvent* event)
5252
saveData();
5353
}
5454

55-
void SettingsWindow::checkUpdates()
55+
void SettingsWindow::checkUpdates(bool isShow)
5656
{
5757
QString secondLastRelease = fetchSecondLastRelease();
5858

@@ -134,8 +134,11 @@ void SettingsWindow::checkUpdates()
134134
connect(whatsNewButton, &QPushButton::clicked, [&]() {
135135
QDesktopServices::openUrl(QUrl("https://github.com/Nighty3098/CodeKeeper/compare/" + secondLastRelease + "..." + currentAppVersion + ""));
136136
});
137-
138-
dialog.exec();
137+
138+
if (!isShow && newAppVersion == currentAppVersion) { }
139+
else {
140+
dialog.exec();
141+
}
139142
}
140143

141144
void SettingsWindow::checkRepo()

src/CodeKeeper/settingswindow.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QMainWindow { parent }
9292
urlToRepo->setAlignment(Qt::AlignHCenter | Qt::AlignTop);
9393

9494
versionInfo = new QLabel();
95-
versionInfo->setText("0.1.8");
95+
versionInfo->setText("0.1.9");
9696
versionInfo->setAlignment(Qt::AlignCenter);
9797

9898
checkUpdatesBtn = new QPushButton(
@@ -365,7 +365,7 @@ SettingsWindow::SettingsWindow(QWidget* parent) : QMainWindow { parent }
365365
// connects
366366
connect(saveBtn, SIGNAL(clicked()), this, SLOT(saveData()));
367367
connect(quitBtn, SIGNAL(clicked()), this, SLOT(QuitW()));
368-
connect(checkUpdatesBtn, SIGNAL(clicked()), this, SLOT(checkUpdates()));
368+
connect(checkUpdatesBtn, SIGNAL(clicked()), this, SLOT(checkUpdates(true)));
369369
connect(openFolder, SIGNAL(clicked()), this, SLOT(fopenFolder()));
370370

371371
QTimer* repoTimer = new QTimer(this);

src/CodeKeeper/settingswindow.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class SettingsWindow : public QMainWindow
1313
~SettingsWindow();
1414
QSettings *globalSettings;
1515

16-
void checkUpdates();
16+
void checkUpdates(bool isShow);
1717
QString getNewAppVersion();
1818

1919
QLabel *versionInfo;

0 commit comments

Comments
 (0)