forked from qt-creator/qt-creator
qttest: Rename private classes to match Creator standard.
Change-Id: I4926d1947216395a18c2e263417d14d08e9487f4 Reviewed-on: http://codereview.qt-project.org/4301 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Bill King <bill.king@nokia.com> Reviewed-by: Eike Ziller <eike.ziller@nokia.com>
This commit is contained in:
48
src/plugins/qttest/testcode.cpp
Normal file → Executable file
48
src/plugins/qttest/testcode.cpp
Normal file → Executable file
@@ -683,7 +683,7 @@ QString TestCode::execFileName()
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
TestCollection_p::TestCollection_p() :
|
||||
TestCollectionPrivate::TestCollectionPrivate() :
|
||||
m_currentEditedTest(0),
|
||||
m_qmlJSModelManager(0),
|
||||
m_cppModelManager(0)
|
||||
@@ -691,12 +691,12 @@ TestCollection_p::TestCollection_p() :
|
||||
QTimer::singleShot(0, this, SLOT(initModelManager()));
|
||||
}
|
||||
|
||||
TestCollection_p::~TestCollection_p()
|
||||
TestCollectionPrivate::~TestCollectionPrivate()
|
||||
{
|
||||
removeAll();
|
||||
}
|
||||
|
||||
void TestCollection_p::initModelManager()
|
||||
void TestCollectionPrivate::initModelManager()
|
||||
{
|
||||
m_qmlJSModelManager =
|
||||
ExtensionSystem::PluginManager::instance()->getObject<QmlJS::ModelManagerInterface>();
|
||||
@@ -712,7 +712,7 @@ void TestCollection_p::initModelManager()
|
||||
}
|
||||
}
|
||||
|
||||
void TestCollection_p::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
||||
void TestCollectionPrivate::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
||||
{
|
||||
TestCode *code;
|
||||
|
||||
@@ -729,7 +729,7 @@ void TestCollection_p::onDocumentUpdated(QmlJS::Document::Ptr doc)
|
||||
code->setDocument(doc);
|
||||
}
|
||||
|
||||
void TestCollection_p::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
|
||||
void TestCollectionPrivate::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
|
||||
{
|
||||
const CPlusPlus::Snapshot snapshot = m_cppModelManager->snapshot();
|
||||
TestCode *code;
|
||||
@@ -750,14 +750,14 @@ void TestCollection_p::onDocumentUpdated(CPlusPlus::Document::Ptr doc)
|
||||
code->setDocument(doc);
|
||||
}
|
||||
|
||||
bool TestCollection_p::isUnitTestCase(const CPlusPlus::Document::Ptr &doc,
|
||||
bool TestCollectionPrivate::isUnitTestCase(const CPlusPlus::Document::Ptr &doc,
|
||||
const CPlusPlus::Snapshot &snapshot)
|
||||
{
|
||||
QStringList visited;
|
||||
return isUnitTestCase(doc, snapshot, visited);
|
||||
}
|
||||
|
||||
bool TestCollection_p::isUnitTestCase(const CPlusPlus::Document::Ptr &doc,
|
||||
bool TestCollectionPrivate::isUnitTestCase(const CPlusPlus::Document::Ptr &doc,
|
||||
const CPlusPlus::Snapshot &snapshot, QStringList &visited)
|
||||
{
|
||||
// If a source file #includes QtTest/QTest, assume it is a testcase
|
||||
@@ -779,7 +779,7 @@ bool TestCollection_p::isUnitTestCase(const CPlusPlus::Document::Ptr &doc,
|
||||
return false;
|
||||
}
|
||||
|
||||
void TestCollection_p::removeAll()
|
||||
void TestCollectionPrivate::removeAll()
|
||||
{
|
||||
while (m_codeList.count() > 0)
|
||||
delete m_codeList.takeFirst();
|
||||
@@ -788,7 +788,7 @@ void TestCollection_p::removeAll()
|
||||
m_cppDocumentMap.clear();
|
||||
}
|
||||
|
||||
void TestCollection_p::removeCode(const QString &fileName)
|
||||
void TestCollectionPrivate::removeCode(const QString &fileName)
|
||||
{
|
||||
TestCode *tmp;
|
||||
for (int i = 0; i < m_codeList.count(); ++i) {
|
||||
@@ -801,7 +801,7 @@ void TestCollection_p::removeCode(const QString &fileName)
|
||||
}
|
||||
}
|
||||
|
||||
void TestCollection_p::removePath(const QString &srcPath)
|
||||
void TestCollectionPrivate::removePath(const QString &srcPath)
|
||||
{
|
||||
if (srcPath.isEmpty() || m_codeList.count() <= 0)
|
||||
return;
|
||||
@@ -816,7 +816,7 @@ void TestCollection_p::removePath(const QString &srcPath)
|
||||
}
|
||||
}
|
||||
|
||||
void TestCollection_p::addPath(const QString &srcPath)
|
||||
void TestCollectionPrivate::addPath(const QString &srcPath)
|
||||
{
|
||||
m_currentScanRoot = srcPath;
|
||||
m_currentExtraBase.clear();
|
||||
@@ -824,14 +824,14 @@ void TestCollection_p::addPath(const QString &srcPath)
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void TestCollection_p::addExtraPath(const QString &srcPath)
|
||||
void TestCollectionPrivate::addExtraPath(const QString &srcPath)
|
||||
{
|
||||
m_currentExtraBase = srcPath;
|
||||
scanTests(srcPath);
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void TestCollection_p::scanTests(const QString &suitePath)
|
||||
void TestCollectionPrivate::scanTests(const QString &suitePath)
|
||||
{
|
||||
if (suitePath.isEmpty())
|
||||
return;
|
||||
@@ -876,17 +876,17 @@ void TestCollection_p::scanTests(const QString &suitePath)
|
||||
}
|
||||
}
|
||||
|
||||
TestCode *TestCollection_p::currentEditedTest()
|
||||
TestCode *TestCollectionPrivate::currentEditedTest()
|
||||
{
|
||||
return m_currentEditedTest;
|
||||
}
|
||||
|
||||
void TestCollection_p::setCurrentEditedTest(TestCode *code)
|
||||
void TestCollectionPrivate::setCurrentEditedTest(TestCode *code)
|
||||
{
|
||||
m_currentEditedTest = code;
|
||||
}
|
||||
|
||||
TestCode *TestCollection_p::findCode(const QString &fileName, const QString &basePath,
|
||||
TestCode *TestCollectionPrivate::findCode(const QString &fileName, const QString &basePath,
|
||||
const QString &extraPath)
|
||||
{
|
||||
TestCode *tmp;
|
||||
@@ -921,7 +921,7 @@ TestCode *TestCollection_p::findCode(const QString &fileName, const QString &bas
|
||||
return 0;
|
||||
}
|
||||
|
||||
TestCode *TestCollection_p::findCodeByVisibleName(const QString &fileName, bool componentMode)
|
||||
TestCode *TestCollectionPrivate::findCodeByVisibleName(const QString &fileName, bool componentMode)
|
||||
{
|
||||
TestCode *tmp;
|
||||
for (int i = 0; i < m_codeList.count(); ++i) {
|
||||
@@ -932,7 +932,7 @@ TestCode *TestCollection_p::findCodeByVisibleName(const QString &fileName, bool
|
||||
return 0;
|
||||
}
|
||||
|
||||
TestCode *TestCollection_p::findCodeByTestCaseName(const QString &testCaseName)
|
||||
TestCode *TestCollectionPrivate::findCodeByTestCaseName(const QString &testCaseName)
|
||||
{
|
||||
TestCode *tmp;
|
||||
for (int i = 0; i < m_codeList.count(); ++i) {
|
||||
@@ -943,19 +943,19 @@ TestCode *TestCollection_p::findCodeByTestCaseName(const QString &testCaseName)
|
||||
return 0;
|
||||
}
|
||||
|
||||
TestCode* TestCollection_p::testCode(int index)
|
||||
TestCode* TestCollectionPrivate::testCode(int index)
|
||||
{
|
||||
if (index < m_codeList.count())
|
||||
return m_codeList.at(index);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int TestCollection_p::count()
|
||||
int TestCollectionPrivate::count()
|
||||
{
|
||||
return m_codeList.count();
|
||||
}
|
||||
|
||||
QStringList TestCollection_p::testFiles()
|
||||
QStringList TestCollectionPrivate::testFiles()
|
||||
{
|
||||
QStringList ret;
|
||||
TestCode *tmp;
|
||||
@@ -967,7 +967,7 @@ QStringList TestCollection_p::testFiles()
|
||||
return ret;
|
||||
}
|
||||
|
||||
QStringList TestCollection_p::manualTests(const QString &startPath, bool componentMode)
|
||||
QStringList TestCollectionPrivate::manualTests(const QString &startPath, bool componentMode)
|
||||
{
|
||||
QStringList ret;
|
||||
TestCode *tmp;
|
||||
@@ -989,13 +989,13 @@ QStringList TestCollection_p::manualTests(const QString &startPath, bool compone
|
||||
|
||||
// ***************************************************************************
|
||||
|
||||
TestCollection_p *TestCollection::d = 0;
|
||||
TestCollectionPrivate *TestCollection::d = 0;
|
||||
int TestCollection::m_refCount = 0;
|
||||
|
||||
TestCollection::TestCollection()
|
||||
{
|
||||
if (m_refCount++ == 0) {
|
||||
d = new TestCollection_p();
|
||||
d = new TestCollectionPrivate();
|
||||
}
|
||||
connect(d, SIGNAL(changed()), this, SIGNAL(changed()));
|
||||
connect(d, SIGNAL(testChanged(TestCode*)), this, SIGNAL(testChanged(TestCode*)));
|
||||
|
10
src/plugins/qttest/testcode.h
Normal file → Executable file
10
src/plugins/qttest/testcode.h
Normal file → Executable file
@@ -44,7 +44,7 @@
|
||||
#include <QTimer>
|
||||
|
||||
class QVConfig;
|
||||
class TestCollection_p;
|
||||
class TestCollectionPrivate;
|
||||
|
||||
namespace Core {
|
||||
class IEditor;
|
||||
@@ -249,17 +249,17 @@ signals:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
static TestCollection_p *d;
|
||||
static TestCollectionPrivate *d;
|
||||
static int m_refCount;
|
||||
};
|
||||
|
||||
|
||||
class TestCollection_p : public QObject
|
||||
class TestCollectionPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestCollection_p();
|
||||
virtual ~TestCollection_p();
|
||||
TestCollectionPrivate();
|
||||
virtual ~TestCollectionPrivate();
|
||||
|
||||
TestCode *currentEditedTest();
|
||||
void setCurrentEditedTest(TestCode *code);
|
||||
|
48
src/plugins/qttest/testconfigurations.cpp
Normal file → Executable file
48
src/plugins/qttest/testconfigurations.cpp
Normal file → Executable file
@@ -65,12 +65,12 @@ using namespace Qt4ProjectManager::Internal;
|
||||
|
||||
TestConfigurations *TestConfigurations::m_instance = 0;
|
||||
|
||||
class TestConfigurations_p : public QObject
|
||||
class TestConfigurationsPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestConfigurations_p();
|
||||
~TestConfigurations_p();
|
||||
TestConfigurationsPrivate();
|
||||
~TestConfigurationsPrivate();
|
||||
|
||||
QList<TestConfig*> m_configList;
|
||||
|
||||
@@ -114,31 +114,31 @@ private:
|
||||
|
||||
#include "testconfigurations.moc"
|
||||
|
||||
TestConfigurations_p::TestConfigurations_p()
|
||||
TestConfigurationsPrivate::TestConfigurationsPrivate()
|
||||
{
|
||||
load();
|
||||
m_delayConfigUpdates = false;
|
||||
}
|
||||
|
||||
TestConfigurations_p::~TestConfigurations_p()
|
||||
TestConfigurationsPrivate::~TestConfigurationsPrivate()
|
||||
{
|
||||
save();
|
||||
clear();
|
||||
}
|
||||
|
||||
void TestConfigurations_p::clear()
|
||||
void TestConfigurationsPrivate::clear()
|
||||
{
|
||||
while (!m_configList.isEmpty())
|
||||
delete m_configList.takeFirst();
|
||||
}
|
||||
|
||||
bool TestConfigurations_p::load()
|
||||
bool TestConfigurationsPrivate::load()
|
||||
{
|
||||
return load(QDir::homePath() + QDir::separator() + QLatin1String(".qttest")
|
||||
+ QDir::separator() + QLatin1String("saved_configurations"));
|
||||
}
|
||||
|
||||
bool TestConfigurations_p::load(const QString &fileName)
|
||||
bool TestConfigurationsPrivate::load(const QString &fileName)
|
||||
{
|
||||
clear();
|
||||
int version = 0;
|
||||
@@ -176,14 +176,14 @@ bool TestConfigurations_p::load(const QString &fileName)
|
||||
}
|
||||
|
||||
|
||||
bool TestConfigurations_p::save()
|
||||
bool TestConfigurationsPrivate::save()
|
||||
{
|
||||
QDir().mkpath(QDir::homePath() + QDir::separator() + QLatin1String(".qttest"));
|
||||
return save(QDir::homePath() + QDir::separator() + QLatin1String(".qttest")
|
||||
+ QDir::separator() + QLatin1String("saved_configurations"));
|
||||
}
|
||||
|
||||
bool TestConfigurations_p::save(const QString &fileName)
|
||||
bool TestConfigurationsPrivate::save(const QString &fileName)
|
||||
{
|
||||
uint curVersion = 9;
|
||||
QFile f(fileName);
|
||||
@@ -201,7 +201,7 @@ bool TestConfigurations_p::save(const QString &fileName)
|
||||
return false;
|
||||
}
|
||||
|
||||
TestConfig *TestConfigurations_p::activeConfiguration()
|
||||
TestConfig *TestConfigurationsPrivate::activeConfiguration()
|
||||
{
|
||||
TestConfig *cfg = 0;
|
||||
for (int i = 0; i < m_configList.count(); ++i) {
|
||||
@@ -212,7 +212,7 @@ TestConfig *TestConfigurations_p::activeConfiguration()
|
||||
return 0;
|
||||
}
|
||||
|
||||
void TestConfigurations_p::setActiveConfiguration(ProjectExplorer::Project *project)
|
||||
void TestConfigurationsPrivate::setActiveConfiguration(ProjectExplorer::Project *project)
|
||||
{
|
||||
TestCollection tc;
|
||||
tc.removeAll();
|
||||
@@ -237,7 +237,7 @@ void TestConfigurations_p::setActiveConfiguration(ProjectExplorer::Project *proj
|
||||
emit activeConfigurationChanged();
|
||||
}
|
||||
|
||||
TestConfig *TestConfigurations_p::config(const QString &cfgName)
|
||||
TestConfig *TestConfigurationsPrivate::config(const QString &cfgName)
|
||||
{
|
||||
TestConfig *cfg = 0;
|
||||
for (int i = 0; i < m_configList.count(); ++i) {
|
||||
@@ -256,7 +256,7 @@ TestConfig *TestConfigurations_p::config(const QString &cfgName)
|
||||
return cfg;
|
||||
}
|
||||
|
||||
TestConfig *TestConfigurations_p::findConfig(const QString &srcPath)
|
||||
TestConfig *TestConfigurationsPrivate::findConfig(const QString &srcPath)
|
||||
{
|
||||
for (int i = 0; i < m_configList.count(); ++i) {
|
||||
TestConfig *tmp = m_configList.at(i);
|
||||
@@ -281,7 +281,7 @@ TestConfig *TestConfigurations_p::findConfig(const QString &srcPath)
|
||||
return 0;
|
||||
}
|
||||
|
||||
QStringList TestConfigurations_p::selectedTests()
|
||||
QStringList TestConfigurationsPrivate::selectedTests()
|
||||
{
|
||||
QStringList ret;
|
||||
for (int i = 0; i < m_configList.count(); ++i) {
|
||||
@@ -292,7 +292,7 @@ QStringList TestConfigurations_p::selectedTests()
|
||||
return ret;
|
||||
}
|
||||
|
||||
void TestConfigurations_p::setSelectedTests(const QStringList &list)
|
||||
void TestConfigurationsPrivate::setSelectedTests(const QStringList &list)
|
||||
{
|
||||
// split up the list into lists *per* test configuration
|
||||
// then save each smaller list into it's specific configuration
|
||||
@@ -324,14 +324,14 @@ void TestConfigurations_p::setSelectedTests(const QStringList &list)
|
||||
save();
|
||||
}
|
||||
|
||||
void TestConfigurations_p::setCurrentTest(const QString &testCase, const QString &testFunction)
|
||||
void TestConfigurationsPrivate::setCurrentTest(const QString &testCase, const QString &testFunction)
|
||||
{
|
||||
TestConfig *tmp = activeConfiguration();
|
||||
if (tmp)
|
||||
tmp->setCurrentTest(testCase, testFunction);
|
||||
}
|
||||
|
||||
QString TestConfigurations_p::currentTestCase()
|
||||
QString TestConfigurationsPrivate::currentTestCase()
|
||||
{
|
||||
TestConfig *tmp = activeConfiguration();
|
||||
if (tmp)
|
||||
@@ -339,7 +339,7 @@ QString TestConfigurations_p::currentTestCase()
|
||||
return QString();
|
||||
}
|
||||
|
||||
QString TestConfigurations_p::currentTestFunction()
|
||||
QString TestConfigurationsPrivate::currentTestFunction()
|
||||
{
|
||||
for (int i = 0; i < m_configList.count(); ++i) {
|
||||
TestConfig *tmp = m_configList.at(i);
|
||||
@@ -349,7 +349,7 @@ QString TestConfigurations_p::currentTestFunction()
|
||||
return QString();
|
||||
}
|
||||
|
||||
void TestConfigurations_p::rescan()
|
||||
void TestConfigurationsPrivate::rescan()
|
||||
{
|
||||
m_testCollection.removeAll();
|
||||
|
||||
@@ -360,17 +360,17 @@ void TestConfigurations_p::rescan()
|
||||
}
|
||||
}
|
||||
|
||||
void TestConfigurations_p::delayConfigUpdates(bool delay)
|
||||
void TestConfigurationsPrivate::delayConfigUpdates(bool delay)
|
||||
{
|
||||
m_delayConfigUpdates = delay;
|
||||
}
|
||||
|
||||
void TestConfigurations_p::onActiveConfigurationChanged()
|
||||
void TestConfigurationsPrivate::onActiveConfigurationChanged()
|
||||
{
|
||||
emit activeConfigurationChanged();
|
||||
}
|
||||
|
||||
void TestConfigurations_p::onTestSelectionChanged(const QStringList& selection, QObject *originator)
|
||||
void TestConfigurationsPrivate::onTestSelectionChanged(const QStringList& selection, QObject *originator)
|
||||
{
|
||||
setSelectedTests(selection);
|
||||
emit testSelectionChanged(selection, originator);
|
||||
@@ -1044,7 +1044,7 @@ TestConfigurations::TestConfigurations()
|
||||
|
||||
m_instance = this;
|
||||
|
||||
d = new TestConfigurations_p;
|
||||
d = new TestConfigurationsPrivate;
|
||||
connect(d, SIGNAL(activeConfigurationChanged()), this, SIGNAL(activeConfigurationChanged()));
|
||||
connect(d, SIGNAL(testSelectionChanged(QStringList, QObject*)),
|
||||
this, SIGNAL(testSelectionChanged(QStringList, QObject*)));
|
||||
|
6
src/plugins/qttest/testconfigurations.h
Normal file → Executable file
6
src/plugins/qttest/testconfigurations.h
Normal file → Executable file
@@ -48,7 +48,7 @@ QT_BEGIN_NAMESPACE
|
||||
class QTextStream;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class TestConfigurations_p;
|
||||
class TestConfigurationsPrivate;
|
||||
|
||||
class TestConfig : public QObject
|
||||
{
|
||||
@@ -172,7 +172,7 @@ private:
|
||||
QString m_qmakeCommand;
|
||||
|
||||
private:
|
||||
friend class TestConfigurations_p;
|
||||
friend class TestConfigurationsPrivate;
|
||||
|
||||
void loadLine(QTextStream *s, const QString &id, QString &value);
|
||||
void loadLine(QTextStream *s, const QString &id, int &value);
|
||||
@@ -217,7 +217,7 @@ signals:
|
||||
private:
|
||||
static TestConfigurations *m_instance;
|
||||
|
||||
TestConfigurations_p *d;
|
||||
TestConfigurationsPrivate *d;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
28
src/plugins/qttest/testcontextmenu.cpp
Normal file → Executable file
28
src/plugins/qttest/testcontextmenu.cpp
Normal file → Executable file
@@ -45,13 +45,13 @@
|
||||
#include <coreplugin/editormanager/ieditor.h>
|
||||
#include <coreplugin/editormanager/editormanager.h>
|
||||
|
||||
TestContextMenu_p *TestContextMenu::m_instance = 0;
|
||||
TestContextMenuPrivate *TestContextMenu::m_instance = 0;
|
||||
int TestContextMenu::m_refCount = 0;
|
||||
|
||||
TestContextMenu::TestContextMenu(QObject *widget)
|
||||
{
|
||||
if (m_refCount++ == 0)
|
||||
m_instance = new TestContextMenu_p(widget);
|
||||
m_instance = new TestContextMenuPrivate(widget);
|
||||
|
||||
connect(m_instance->m_testToggleCurrentSelectAction, SIGNAL(triggered()),
|
||||
this, SIGNAL(toggleSelection()));
|
||||
@@ -100,7 +100,7 @@ void TestContextMenu::updateSingleTestAction(const QString &testName)
|
||||
m_instance->updateSingleTestAction(testName);
|
||||
}
|
||||
|
||||
TestContextMenu_p::TestContextMenu_p(QObject *widget)
|
||||
TestContextMenuPrivate::TestContextMenuPrivate(QObject *widget)
|
||||
{
|
||||
m_testInsertUnitOrSystemTestAction = new QAction(widget);
|
||||
m_testInsertUnitOrSystemTestAction->setEnabled(false);
|
||||
@@ -149,11 +149,11 @@ TestContextMenu_p::TestContextMenu_p(QObject *widget)
|
||||
this, SLOT(editorChanged(Core::IEditor*)), Qt::DirectConnection);
|
||||
}
|
||||
|
||||
TestContextMenu_p::~TestContextMenu_p()
|
||||
TestContextMenuPrivate::~TestContextMenuPrivate()
|
||||
{
|
||||
}
|
||||
|
||||
void TestContextMenu_p::init(QMenu *testMenu, int mode, QObject *widget)
|
||||
void TestContextMenuPrivate::init(QMenu *testMenu, int mode, QObject *widget)
|
||||
{
|
||||
if (mode == 0) {
|
||||
// menu bar at the top
|
||||
@@ -219,24 +219,24 @@ void TestContextMenu_p::init(QMenu *testMenu, int mode, QObject *widget)
|
||||
}
|
||||
}
|
||||
|
||||
void TestContextMenu_p::onOpenIncludeFile()
|
||||
void TestContextMenuPrivate::onOpenIncludeFile()
|
||||
{
|
||||
emit openIncludeFile(m_includeFile);
|
||||
}
|
||||
|
||||
void TestContextMenu_p::updateToggleAction(const QString &testName)
|
||||
void TestContextMenuPrivate::updateToggleAction(const QString &testName)
|
||||
{
|
||||
m_testToggleCurrentSelectAction->setVisible(!testName.isEmpty());
|
||||
m_testToggleCurrentSelectAction->setText(testName);
|
||||
}
|
||||
|
||||
void TestContextMenu_p::updateSingleTestAction(const QString &testName)
|
||||
void TestContextMenuPrivate::updateSingleTestAction(const QString &testName)
|
||||
{
|
||||
m_editorRunSingleTestAction->setVisible(!testName.isEmpty());
|
||||
m_editorRunSingleTestAction->setText(tr("Run: '%1'").arg(testName));
|
||||
}
|
||||
|
||||
void TestContextMenu_p::updateActions(bool testVisible, bool testBusy, bool testStopped)
|
||||
void TestContextMenuPrivate::updateActions(bool testVisible, bool testBusy, bool testStopped)
|
||||
{
|
||||
m_testInsertUnitOrSystemTestAction->setEnabled(testVisible);
|
||||
m_editorInsertTestFunctionAction->setEnabled(testVisible);
|
||||
@@ -248,14 +248,14 @@ void TestContextMenu_p::updateActions(bool testVisible, bool testBusy, bool test
|
||||
m_editorStopTestingAction->setEnabled(testBusy && !testStopped);
|
||||
}
|
||||
|
||||
void TestContextMenu_p::enableIncludeFile(const QString &fileName)
|
||||
void TestContextMenuPrivate::enableIncludeFile(const QString &fileName)
|
||||
{
|
||||
m_includeFile = fileName;
|
||||
m_testOpenIncludeFileAction->setText(tr("Open: '%1'").arg(fileName));
|
||||
m_testOpenIncludeFileAction->setVisible(!fileName.isEmpty());
|
||||
}
|
||||
|
||||
void TestContextMenu_p::languageChange()
|
||||
void TestContextMenuPrivate::languageChange()
|
||||
{
|
||||
m_testInsertUnitOrSystemTestAction->setText(tr("New Test..."));
|
||||
m_testInsertUnitOrSystemTestAction->setStatusTip(
|
||||
@@ -310,7 +310,7 @@ void TestContextMenu_p::languageChange()
|
||||
m_testOpenIncludeFileAction->setStatusTip(tr("Open the specified include file."));
|
||||
}
|
||||
|
||||
void TestContextMenu_p::editorChanged(Core::IEditor *iface)
|
||||
void TestContextMenuPrivate::editorChanged(Core::IEditor *iface)
|
||||
{
|
||||
bool isTestcase = false;
|
||||
|
||||
@@ -339,7 +339,7 @@ void TestContextMenu_p::editorChanged(Core::IEditor *iface)
|
||||
}
|
||||
|
||||
|
||||
void TestContextMenu_p::onLearnChanged()
|
||||
void TestContextMenuPrivate::onLearnChanged()
|
||||
{
|
||||
if (m_testLearnAction->isChecked()) {
|
||||
if (m_testLearnAllAction->isChecked())
|
||||
@@ -350,7 +350,7 @@ void TestContextMenu_p::onLearnChanged()
|
||||
}
|
||||
}
|
||||
|
||||
void TestContextMenu_p::onLearnAllChanged()
|
||||
void TestContextMenuPrivate::onLearnAllChanged()
|
||||
{
|
||||
if (m_testLearnAllAction->isChecked()) {
|
||||
if (m_testLearnAction->isChecked())
|
||||
|
10
src/plugins/qttest/testcontextmenu.h
Normal file → Executable file
10
src/plugins/qttest/testcontextmenu.h
Normal file → Executable file
@@ -49,7 +49,7 @@ class QAction;
|
||||
class QMenu;
|
||||
QT_END_NAMESPACE
|
||||
|
||||
class TestContextMenu_p;
|
||||
class TestContextMenuPrivate;
|
||||
|
||||
class TestContextMenu : public QObject
|
||||
{
|
||||
@@ -70,16 +70,16 @@ signals:
|
||||
void toggleSelection();
|
||||
|
||||
private:
|
||||
static TestContextMenu_p *m_instance;
|
||||
static TestContextMenuPrivate *m_instance;
|
||||
static int m_refCount;
|
||||
};
|
||||
|
||||
class TestContextMenu_p : public QObject
|
||||
class TestContextMenuPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
TestContextMenu_p(QObject *widget);
|
||||
~TestContextMenu_p();
|
||||
TestContextMenuPrivate(QObject *widget);
|
||||
~TestContextMenuPrivate();
|
||||
|
||||
void init(QMenu *testMenu, int mode, QObject *widget);
|
||||
void languageChange();
|
||||
|
14
src/plugins/qttest/testsettings.cpp
Normal file → Executable file
14
src/plugins/qttest/testsettings.cpp
Normal file → Executable file
@@ -224,9 +224,9 @@ bool TestIniFile::write(const QString &comment, const QString &key, QDateTime va
|
||||
}
|
||||
|
||||
int TestSettings::m_refCount = 0;
|
||||
TestSettings_p *TestSettings::d = 0;
|
||||
TestSettingsPrivate *TestSettings::d = 0;
|
||||
|
||||
TestSettings_p::TestSettings_p()
|
||||
TestSettingsPrivate::TestSettingsPrivate()
|
||||
{
|
||||
// Clear out the settings first incase there is no ini file or it's missing values
|
||||
m_showPassedResults = true;
|
||||
@@ -237,17 +237,17 @@ TestSettings_p::TestSettings_p()
|
||||
load();
|
||||
}
|
||||
|
||||
TestSettings_p::~TestSettings_p()
|
||||
TestSettingsPrivate::~TestSettingsPrivate()
|
||||
{
|
||||
save();
|
||||
}
|
||||
|
||||
void TestSettings_p::emitChanged()
|
||||
void TestSettingsPrivate::emitChanged()
|
||||
{
|
||||
emit changed();
|
||||
}
|
||||
|
||||
void TestSettings_p::load()
|
||||
void TestSettingsPrivate::load()
|
||||
{
|
||||
TestIniFile ini(QDir ::homePath() + QDir::separator() + ".qttest"
|
||||
+ QDir::separator() + "saved_settings");
|
||||
@@ -271,7 +271,7 @@ void TestSettings_p::load()
|
||||
m_showSkippedResults = showSkippedResults;
|
||||
}
|
||||
|
||||
void TestSettings_p::save()
|
||||
void TestSettingsPrivate::save()
|
||||
{
|
||||
QDir().mkpath(QDir::homePath() + QDir::separator() + ".qttest");
|
||||
TestIniFile ini(QDir::homePath() + QDir::separator() + ".qttest" + QDir::separator() + "saved_settings");
|
||||
@@ -291,7 +291,7 @@ void TestSettings_p::save()
|
||||
TestSettings::TestSettings()
|
||||
{
|
||||
if (m_refCount++ == 0) {
|
||||
d = new TestSettings_p();
|
||||
d = new TestSettingsPrivate();
|
||||
Q_ASSERT(d);
|
||||
d->load();
|
||||
}
|
||||
|
10
src/plugins/qttest/testsettings.h
Normal file → Executable file
10
src/plugins/qttest/testsettings.h
Normal file → Executable file
@@ -36,14 +36,14 @@
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
// class TestSettings_p;
|
||||
class TestSettings_p : public QObject
|
||||
// class TestSettingsPrivate;
|
||||
class TestSettingsPrivate : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
TestSettings_p();
|
||||
~TestSettings_p();
|
||||
TestSettingsPrivate();
|
||||
~TestSettingsPrivate();
|
||||
|
||||
void load();
|
||||
void save();
|
||||
@@ -106,7 +106,7 @@ signals:
|
||||
void changed();
|
||||
|
||||
private:
|
||||
static TestSettings_p *d;
|
||||
static TestSettingsPrivate *d;
|
||||
static int m_refCount;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user