forked from qt-creator/qt-creator
Utils: Add PathListEditor to supprted widgets in SavedAction.
Change-Id: I813cf76d2df45daf0c981f3d136caebb96d03cf5 Reviewed-by: hjk <hjk121@nokiamail.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
@@ -31,6 +31,7 @@
|
||||
|
||||
#include <utils/qtcassert.h>
|
||||
#include <utils/pathchooser.h>
|
||||
#include <utils/pathlisteditor.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QSettings>
|
||||
@@ -313,6 +314,8 @@ void SavedAction::connectWidget(QWidget *widget, ApplyMode applyMode)
|
||||
} else if (QTextEdit *textEdit = qobject_cast<QTextEdit *>(widget)) {
|
||||
textEdit->setPlainText(m_value.toString());
|
||||
connect(textEdit, SIGNAL(textChanged()), this, SLOT(textEditTextChanged()));
|
||||
} else if (PathListEditor *editor = qobject_cast<PathListEditor *>(widget)) {
|
||||
editor->setPathList(m_value.toStringList());
|
||||
} else {
|
||||
qDebug() << "Cannot connect widget " << widget << toString();
|
||||
}
|
||||
@@ -342,6 +345,8 @@ void SavedAction::apply(QSettings *s)
|
||||
setValue(groupBox->isChecked());
|
||||
else if (const QTextEdit *textEdit = qobject_cast<QTextEdit *>(m_widget))
|
||||
setValue(textEdit->toPlainText());
|
||||
else if (const PathListEditor *editor = qobject_cast<PathListEditor *>(m_widget))
|
||||
setValue(editor->pathList());
|
||||
if (s)
|
||||
writeSettings(s);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user