PIValueTreeEdit arrays fix, support for array comment (only from source now)
This commit is contained in:
@@ -43,6 +43,7 @@ MainWindow::~MainWindow() {
|
||||
void MainWindow::reset(bool) {
|
||||
widget->setValue(PIValueTree());
|
||||
setWindowTitle(tr("PIValueTree Editor"));
|
||||
file_name.clear();
|
||||
}
|
||||
|
||||
|
||||
@@ -50,6 +51,7 @@ bool MainWindow::load(const QString & path) {
|
||||
PIFile f(Q2PIString(path), PIIODevice::ReadOnly);
|
||||
if (!f.isOpened()) return false;
|
||||
PIString ext = PIFile::FileInfo(f.path()).extension().toLowerCase();
|
||||
file_name = path;
|
||||
PIValueTree v;
|
||||
if (ext == "conf" || ext == "ini")
|
||||
v = PIValueTreeConversions::fromText(&f);
|
||||
@@ -67,6 +69,7 @@ bool MainWindow::save(const QString & path) {
|
||||
PIFile f(Q2PIString(path), PIIODevice::ReadWrite);
|
||||
if (!f.isOpened()) return false;
|
||||
f.clear();
|
||||
file_name = path;
|
||||
PIString ext = PIFile::FileInfo(f.path()).extension().toLowerCase();
|
||||
auto v = widget->value();
|
||||
if (ext == "conf" || ext == "ini")
|
||||
|
||||
Reference in New Issue
Block a user