forked from len0rd/rockbox
qeditor: backends can now report validity status
Change-Id: Iefedc9cee10a8c7457d972e5a60d151a6cb38aa8 Reviewed-on: http://gerrit.rockbox.org/995 Reviewed-by: Amaury Pouly <amaury.pouly@gmail.com>
This commit is contained in:
parent
b08620dd30
commit
99ed6d2bea
2 changed files with 9 additions and 0 deletions
|
@ -114,6 +114,7 @@ FileIoBackend::FileIoBackend(const QString& filename, const QString& soc_name)
|
|||
{
|
||||
m_filename = filename;
|
||||
m_soc = soc_name;
|
||||
m_valid = false;
|
||||
Reload();
|
||||
}
|
||||
|
||||
|
@ -132,6 +133,7 @@ bool FileIoBackend::ReadRegister(const QString& name, soc_word_t& value)
|
|||
|
||||
bool FileIoBackend::Reload()
|
||||
{
|
||||
m_valid = false;
|
||||
QFile file(m_filename);
|
||||
if(!file.open(QIODevice::ReadOnly | QIODevice::Text))
|
||||
return false;
|
||||
|
@ -155,6 +157,7 @@ bool FileIoBackend::Reload()
|
|||
|
||||
m_readonly = !QFileInfo(file).isWritable();
|
||||
m_dirty = false;
|
||||
m_valid = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue