mirror of
https://github.com/qelectrotech/qelectrotech-source-mirror.git
synced 2026-10-09 21:54:13 +02:00
Merge pull request #1411 from bhangart/fix/settings-tests-windows
Give the toolbar and gesture settings tests their own settings scope
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QComboBox>
|
||||
#include <QCoreApplication>
|
||||
#include <QListWidget>
|
||||
#include <QPushButton>
|
||||
#include <QSettings>
|
||||
@@ -86,6 +87,11 @@ private slots:
|
||||
void initTestCase()
|
||||
{
|
||||
QStandardPaths::setTestModeEnabled(true);
|
||||
//A scope of this test's own. Without an organization name,
|
||||
//QSettings on Windows has no registry key: it drops every
|
||||
//write and reads only defaults.
|
||||
QCoreApplication::setOrganizationName(QStringLiteral("QElectroTech-tst_diagramtoolbarsettings"));
|
||||
QCoreApplication::setApplicationName(QStringLiteral("tst_diagramtoolbarsettings"));
|
||||
clearSettings();
|
||||
//A few of the diagram editor's commands, as it registers them
|
||||
for (const QString &id : {QStringLiteral("diagrameditor.copy"),
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <QAction>
|
||||
#include <QComboBox>
|
||||
#include <QCoreApplication>
|
||||
#include <QDropEvent>
|
||||
#include <QListWidget>
|
||||
#include <QMainWindow>
|
||||
@@ -64,6 +65,11 @@ private slots:
|
||||
void initTestCase()
|
||||
{
|
||||
QStandardPaths::setTestModeEnabled(true);
|
||||
//A scope of this test's own. Without an organization name,
|
||||
//QSettings on Windows has no registry key: it drops every
|
||||
//write and reads only defaults.
|
||||
QCoreApplication::setOrganizationName(QStringLiteral("QElectroTech-tst_gesturesettings"));
|
||||
QCoreApplication::setApplicationName(QStringLiteral("tst_gesturesettings"));
|
||||
QSettings().remove(QStringLiteral("diagrameditor"));
|
||||
addCommand(QStringLiteral("diagrameditor.copy"), QStringLiteral("Copier"));
|
||||
addCommand(QStringLiteral("diagrameditor.cut"), QStringLiteral("Couper"));
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QCoreApplication>
|
||||
#include <QDockWidget>
|
||||
#include <QMainWindow>
|
||||
#include <QSettings>
|
||||
@@ -48,6 +49,11 @@ private slots:
|
||||
void initTestCase()
|
||||
{
|
||||
QStandardPaths::setTestModeEnabled(true);
|
||||
//A scope of this test's own. Without an organization name,
|
||||
//QSettings on Windows has no registry key: it drops every
|
||||
//write and reads only defaults.
|
||||
QCoreApplication::setOrganizationName(QStringLiteral("QElectroTech-tst_toolbarsettings"));
|
||||
QCoreApplication::setApplicationName(QStringLiteral("tst_toolbarsettings"));
|
||||
QSettings().remove(QStringLiteral("toolbars"));
|
||||
|
||||
m_window = new QMainWindow();
|
||||
|
||||
Reference in New Issue
Block a user