remove some unused stuff
This commit is contained in:
parent
d9fb5cd115
commit
a0215dcbf0
@ -9,9 +9,9 @@ SettingsGeneral::SettingsGeneral(Settings* settings, QWidget* parent)
|
|||||||
: SettingsPanel(settings, parent), m_ui(new Ui::SettingsGeneral) {
|
: SettingsPanel(settings, parent), m_ui(new Ui::SettingsGeneral) {
|
||||||
m_ui->setupUi(this);
|
m_ui->setupUi(this);
|
||||||
m_ui->m_checkAutostart->setText(m_ui->m_checkAutostart->text().arg(APP_NAME));
|
m_ui->m_checkAutostart->setText(m_ui->m_checkAutostart->text().arg(APP_NAME));
|
||||||
|
|
||||||
connect(m_ui->m_checkAutostart, &QCheckBox::stateChanged, this, &SettingsGeneral::dirtifySettings);
|
connect(m_ui->m_checkAutostart, &QCheckBox::stateChanged, this, &SettingsGeneral::dirtifySettings);
|
||||||
connect(m_ui->m_checkForUpdatesOnStart, &QCheckBox::stateChanged, this, &SettingsGeneral::dirtifySettings);
|
connect(m_ui->m_checkForUpdatesOnStart, &QCheckBox::stateChanged, this, &SettingsGeneral::dirtifySettings);
|
||||||
connect(m_ui->m_checkRemoveTrolltechJunk, &QCheckBox::stateChanged, this, &SettingsGeneral::dirtifySettings);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
SettingsGeneral::~SettingsGeneral() {
|
SettingsGeneral::~SettingsGeneral() {
|
||||||
@ -40,12 +40,6 @@ void SettingsGeneral::loadSettings() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
m_ui->m_checkRemoveTrolltechJunk->setVisible(true);
|
|
||||||
m_ui->m_checkRemoveTrolltechJunk->setChecked(settings()->value(GROUP(General), SETTING(General::RemoveTrolltechJunk)).toBool());
|
|
||||||
#else
|
|
||||||
m_ui->m_checkRemoveTrolltechJunk->setVisible(false);
|
|
||||||
#endif
|
|
||||||
onEndLoadSettings();
|
onEndLoadSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -61,6 +55,5 @@ void SettingsGeneral::saveSettings() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
settings()->setValue(GROUP(General), General::UpdateOnStartup, m_ui->m_checkForUpdatesOnStart->isChecked());
|
settings()->setValue(GROUP(General), General::UpdateOnStartup, m_ui->m_checkForUpdatesOnStart->isChecked());
|
||||||
settings()->setValue(GROUP(General), General::RemoveTrolltechJunk, m_ui->m_checkRemoveTrolltechJunk->isChecked());
|
|
||||||
onEndSaveSettings();
|
onEndSaveSettings();
|
||||||
}
|
}
|
||||||
|
@ -37,14 +37,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="2" column="0">
|
<item row="2" column="0" colspan="2">
|
||||||
<widget class="QCheckBox" name="m_checkRemoveTrolltechJunk">
|
|
||||||
<property name="text">
|
|
||||||
<string>Remove junk Trolltech registry key (HKCU\Software\Trolltech) when application quits (Use at your own risk!)</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="2">
|
|
||||||
<spacer name="verticalSpacer">
|
<spacer name="verticalSpacer">
|
||||||
<property name="orientation">
|
<property name="orientation">
|
||||||
<enum>Qt::Vertical</enum>
|
<enum>Qt::Vertical</enum>
|
||||||
|
@ -518,10 +518,6 @@ void Application::onAboutToQuit() {
|
|||||||
processEvents();
|
processEvents();
|
||||||
qDebugNN << LOGSEC_CORE << "Cleaning up resources and saving application state.";
|
qDebugNN << LOGSEC_CORE << "Cleaning up resources and saving application state.";
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
system()->removeTrolltechJunkRegistryKeys();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (locked_safely) {
|
if (locked_safely) {
|
||||||
// Application obtained permission to close in a safe way.
|
// Application obtained permission to close in a safe way.
|
||||||
qDebugNN << LOGSEC_CORE << "Close lock was obtained safely.";
|
qDebugNN << LOGSEC_CORE << "Close lock was obtained safely.";
|
||||||
|
@ -235,9 +235,6 @@ DKEY General::ID = "main";
|
|||||||
DKEY General::UpdateOnStartup = "update_on_start";
|
DKEY General::UpdateOnStartup = "update_on_start";
|
||||||
DVALUE(bool) General::UpdateOnStartupDef = true;
|
DVALUE(bool) General::UpdateOnStartupDef = true;
|
||||||
|
|
||||||
DKEY General::RemoveTrolltechJunk = "remove_trolltech_junk";
|
|
||||||
DVALUE(bool) General::RemoveTrolltechJunkDef = false;
|
|
||||||
|
|
||||||
DKEY General::FirstRun = "first_run";
|
DKEY General::FirstRun = "first_run";
|
||||||
DVALUE(bool) General::FirstRunDef = true;
|
DVALUE(bool) General::FirstRunDef = true;
|
||||||
|
|
||||||
|
@ -250,20 +250,14 @@ namespace GUI {
|
|||||||
// General.
|
// General.
|
||||||
namespace General {
|
namespace General {
|
||||||
KEY ID;
|
KEY ID;
|
||||||
KEY UpdateOnStartup;
|
|
||||||
|
|
||||||
|
KEY UpdateOnStartup;
|
||||||
VALUE(bool) UpdateOnStartupDef;
|
VALUE(bool) UpdateOnStartupDef;
|
||||||
|
|
||||||
KEY RemoveTrolltechJunk;
|
|
||||||
|
|
||||||
VALUE(bool) RemoveTrolltechJunkDef;
|
|
||||||
|
|
||||||
KEY FirstRun;
|
KEY FirstRun;
|
||||||
|
|
||||||
VALUE(bool) FirstRunDef;
|
VALUE(bool) FirstRunDef;
|
||||||
|
|
||||||
KEY Language;
|
KEY Language;
|
||||||
|
|
||||||
VALUE(QString) LanguageDef;
|
VALUE(QString) LanguageDef;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -170,22 +170,6 @@ bool SystemFactory::setAutoStartStatus(AutoStartStatus new_status) {
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
bool SystemFactory::removeTrolltechJunkRegistryKeys() {
|
|
||||||
if (qApp->settings()->value(GROUP(General), SETTING(General::RemoveTrolltechJunk)).toBool()) {
|
|
||||||
QSettings registry_key(QSL("HKEY_CURRENT_USER\\Software\\TrollTech"), QSettings::NativeFormat);
|
|
||||||
|
|
||||||
registry_key.remove(QString());
|
|
||||||
registry_key.sync();
|
|
||||||
return registry_key.status() == QSettings::Status::NoError;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
QString SystemFactory::loggedInUser() const {
|
QString SystemFactory::loggedInUser() const {
|
||||||
QString name = qgetenv("USER");
|
QString name = qgetenv("USER");
|
||||||
|
|
||||||
|
@ -55,10 +55,6 @@ class SystemFactory : public QObject {
|
|||||||
// new status failed.
|
// new status failed.
|
||||||
bool setAutoStartStatus(AutoStartStatus new_status);
|
bool setAutoStartStatus(AutoStartStatus new_status);
|
||||||
|
|
||||||
#if defined(Q_OS_WIN)
|
|
||||||
bool removeTrolltechJunkRegistryKeys();
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(Q_OS_LINUX)
|
#if defined(Q_OS_LINUX)
|
||||||
// Returns standard location where auto-start .desktop files
|
// Returns standard location where auto-start .desktop files
|
||||||
// should be placed.
|
// should be placed.
|
||||||
|
@ -50,7 +50,7 @@ QNetworkReply* BaseNetworkAccessManager::createRequest(QNetworkAccessManager::Op
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
new_request.setRawHeader(HTTP_HEADERS_COOKIE, QSL("JSESSIONID= ").toLocal8Bit());
|
new_request.setRawHeader(HTTP_HEADERS_COOKIE, QSL("JSESSIONID= ").toLocal8Bit());
|
||||||
new_request.setRawHeader(HTTP_HEADERS_USER_AGENT, QString(APP_USERAGENT).toLocal8Bit());
|
new_request.setRawHeader(HTTP_HEADERS_USER_AGENT, QSL(APP_USERAGENT).toLocal8Bit());
|
||||||
|
|
||||||
auto reply = QNetworkAccessManager::createRequest(op, new_request, outgoingData);
|
auto reply = QNetworkAccessManager::createRequest(op, new_request, outgoingData);
|
||||||
return reply;
|
return reply;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user