Fixed #85.
This commit is contained in:
parent
f8945e1da0
commit
07b7d1d6ee
@ -3,7 +3,7 @@
|
||||
|
||||
Fixed:
|
||||
<ul>
|
||||
<li>Fixed #76, #75, #82, #79.</li>
|
||||
<li>Fixed #76, #75, #82, #79, #85.</li>
|
||||
</ul>
|
||||
|
||||
Added:
|
||||
|
@ -607,6 +607,11 @@ void FormSettings::loadGeneral() {
|
||||
tr(" (not supported on this platform)"));
|
||||
break;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
m_ui->m_checkRemoveTrolltechJunk->setEnabled(true);
|
||||
m_ui->m_checkRemoveTrolltechJunk->setChecked(qApp->settings()->value(APP_CFG_GEN, "remove_trolltech_junk", false).toBool());
|
||||
#endif
|
||||
}
|
||||
|
||||
void FormSettings::saveGeneral() {
|
||||
@ -619,6 +624,7 @@ void FormSettings::saveGeneral() {
|
||||
}
|
||||
|
||||
qApp->settings()->setValue(APP_CFG_GEN, "update_on_start", m_ui->m_checkForUpdatesOnStart->isChecked());
|
||||
qApp->settings()->setValue(APP_CFG_GEN, "remove_trolltech_junk", m_ui->m_checkRemoveTrolltechJunk->isChecked());
|
||||
}
|
||||
|
||||
void FormSettings::loadInterface() {
|
||||
|
@ -123,6 +123,16 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0">
|
||||
<widget class="QCheckBox" name="m_checkRemoveTrolltechJunk">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Remove junk Trolltech registry key (HKCUSoftwareTrolltech) whn application quits (Use at your own risk!)</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<widget class="QWidget" name="m_pageDataStorage">
|
||||
|
@ -142,6 +142,7 @@ void Application::onAboutToQuit() {
|
||||
|
||||
qDebug("Cleaning up resources and saving application state.");
|
||||
|
||||
system()->removeTrolltechJunkRegistryKeys();
|
||||
mainForm()->tabWidget()->feedMessageViewer()->quit();
|
||||
database()->saveDatabase();
|
||||
mainForm()->saveSize();
|
||||
|
@ -123,13 +123,11 @@ bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) {
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
QSettings registry_key("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run",
|
||||
QSettings::NativeFormat);
|
||||
QSettings registry_key("HKEY_CURRENT_USER\\Software\\Microsoft\\Windows\\CurrentVersion\\Run", QSettings::NativeFormat);
|
||||
switch (new_status) {
|
||||
case SystemFactory::Enabled:
|
||||
registry_key.setValue(APP_LOW_NAME,
|
||||
Application::applicationFilePath().replace('/',
|
||||
'\\'));
|
||||
Application::applicationFilePath().replace('/', '\\'));
|
||||
return true;
|
||||
case SystemFactory::Disabled:
|
||||
registry_key.remove(APP_LOW_NAME);
|
||||
@ -156,6 +154,22 @@ bool SystemFactory::setAutoStartStatus(const AutoStartStatus &new_status) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
bool SystemFactory::removeTrolltechJunkRegistryKeys() {
|
||||
if (qApp->settings()->value(APP_CFG_GEN, "remove_trolltech_junk", false).toBool()) {
|
||||
QSettings registry_key("HKEY_CURRENT_USER\\Software\\TrollTech", QSettings::NativeFormat);
|
||||
|
||||
registry_key.remove("");
|
||||
registry_key.sync();
|
||||
|
||||
return registry_key.status() == QSettings::NoError;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
QPair<UpdateInfo, QNetworkReply::NetworkError> SystemFactory::checkForUpdates() {
|
||||
QPair<UpdateInfo, QNetworkReply::NetworkError> result;
|
||||
QByteArray releases_xml;
|
||||
@ -223,11 +237,11 @@ void SystemFactory::handleBackgroundUpdatesCheck() {
|
||||
|
||||
if (updates.second == QNetworkReply::NoError && updates.first.m_availableVersion != APP_VERSION) {
|
||||
if (SystemTrayIcon::isSystemTrayActivated()) {
|
||||
qApp->trayIcon()->showMessage(tr("New version available"),
|
||||
tr("Click the bubble for more information."),
|
||||
QSystemTrayIcon::Information,
|
||||
TRAY_ICON_BUBBLE_TIMEOUT,
|
||||
qApp->mainForm(), SLOT(showUpdates()));
|
||||
qApp->trayIcon()->showMessage(tr("New version available"),
|
||||
tr("Click the bubble for more information."),
|
||||
QSystemTrayIcon::Information,
|
||||
TRAY_ICON_BUBBLE_TIMEOUT,
|
||||
qApp->mainForm(), SLOT(showUpdates()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -79,6 +79,10 @@ class SystemFactory : public QObject {
|
||||
// new status failed.
|
||||
bool setAutoStartStatus(const SystemFactory::AutoStartStatus &new_status);
|
||||
|
||||
#if defined(Q_OS_WIN)
|
||||
bool removeTrolltechJunkRegistryKeys();
|
||||
#endif
|
||||
|
||||
#if defined(Q_OS_LINUX)
|
||||
// Returns standard location where auto-start .desktop files
|
||||
// should be placed.
|
||||
@ -89,6 +93,7 @@ class SystemFactory : public QObject {
|
||||
QPair<UpdateInfo, QNetworkReply::NetworkError> checkForUpdates();
|
||||
|
||||
public slots:
|
||||
// Performs asynchronous check for updates, result is emitted via updateCheckedAsynchronously(...) signal.
|
||||
void checkForUpdatesAsynchronously();
|
||||
|
||||
private slots:
|
||||
|
Loading…
x
Reference in New Issue
Block a user