-rw-r--r-- | noncore/tools/opie-sh/inputdialog.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/noncore/tools/opie-sh/inputdialog.cpp b/noncore/tools/opie-sh/inputdialog.cpp index 8046795..1dd8bf7 100644 --- a/noncore/tools/opie-sh/inputdialog.cpp +++ b/noncore/tools/opie-sh/inputdialog.cpp @@ -41,5 +41,6 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString { QFile file(filename); - file.open(IO_ReadOnly); + if (file.open(IO_ReadOnly)) + { QTextStream stream(&file); QString string = stream.read(); @@ -47,4 +48,5 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString comboBox->insertStringList(QStringList::split('\n', string)); } + } else { @@ -64,5 +66,6 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString { QFile file(filename); - file.open(IO_ReadOnly); + if (file.open(IO_ReadOnly)) + { QTextStream stream(&file); QString string = stream.read(); @@ -70,4 +73,5 @@ InputDialog::InputDialog(int w, int h, int newtype, QString labelString, QString listBox->insertStringList(QStringList::split('\n', string)); } + } else { |