Commit 3c76ec10 authored by NICLAUSSE Nicolas's avatar NICLAUSSE Nicolas

use dtkCoreParameters alias + update test (wip)

parent 233086de
...@@ -38,7 +38,7 @@ public: ...@@ -38,7 +38,7 @@ public:
QJsonArray menu; QJsonArray menu;
public: public:
QHash<QString, dtkCoreParameter *> parameters; dtkCoreParameters parameters;
}; };
// /////////////////////////////////////////////////////////////////// // ///////////////////////////////////////////////////////////////////
...@@ -146,7 +146,7 @@ void dtkWidgetsParameterMenuBarGenerator::populate(dtkWidgetsMenuBar *menubar) ...@@ -146,7 +146,7 @@ void dtkWidgetsParameterMenuBarGenerator::populate(dtkWidgetsMenuBar *menubar)
} }
} }
QHash<QString, dtkCoreParameter *> dtkWidgetsParameterMenuBarGenerator::parameters(void) const dtkCoreParameters dtkWidgetsParameterMenuBarGenerator::parameters(void) const
{ {
return d->parameters; return d->parameters;
} }
......
...@@ -16,11 +16,12 @@ ...@@ -16,11 +16,12 @@
#include <dtkWidgetsExport> #include <dtkWidgetsExport>
#include <dtkCore/dtkCoreParameters>
#include <QtCore> #include <QtCore>
class dtkWidgetsMenuBar; class dtkWidgetsMenuBar;
class dtkCoreParameter; class dtkCoreParameter;
class dtkWidgetsParameter;
// /////////////////////////////////////////////////////////////////// // ///////////////////////////////////////////////////////////////////
// dtkWidgetsParameterMenuBarGenerator declaration // dtkWidgetsParameterMenuBarGenerator declaration
...@@ -36,7 +37,7 @@ public: ...@@ -36,7 +37,7 @@ public:
void populate(dtkWidgetsMenuBar *menubar); void populate(dtkWidgetsMenuBar *menubar);
public: public:
QHash<QString, dtkCoreParameter *> parameters(void) const; dtkCoreParameters parameters(void) const;
protected: protected:
class dtkWidgetsParameterMenuBarGeneratorPrivate *d; class dtkWidgetsParameterMenuBarGeneratorPrivate *d;
......
...@@ -69,11 +69,14 @@ void dtkWidgetsParameterMenuBarGeneratorTestCase::init(void) ...@@ -69,11 +69,14 @@ void dtkWidgetsParameterMenuBarGeneratorTestCase::init(void)
void dtkWidgetsParameterMenuBarGeneratorTestCase::testBasic(void) void dtkWidgetsParameterMenuBarGeneratorTestCase::testBasic(void)
{ {
QString nature_file_path = QFINDTESTDATA("../resources/parameters_nature.json"); QString nature_file_path = QFINDTESTDATA("../resources/new_menu.json");
QString definition_file_path = QFINDTESTDATA("../resources/parameters_definition.json"); QString definition_file_path = QFINDTESTDATA("../resources/new_definition.json");
dtkWidgetsParameterMenuBarGenerator menu_bar_generator(nature_file_path, definition_file_path); dtkWidgetsParameterMenuBarGenerator menu_bar_generator(nature_file_path, definition_file_path);
dtkCoreParameters params = menu_bar_generator.parameters();
QCOMPARE(params.count() , 79);
} }
void dtkWidgetsParameterMenuBarGeneratorTestCase::cleanup(void) void dtkWidgetsParameterMenuBarGeneratorTestCase::cleanup(void)
......
This diff is collapsed.
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment