From d6a40efdb9d81d39972a1304bd62ac60bb45e996 Mon Sep 17 00:00:00 2001 From: zecke Date: Mon, 21 Oct 2002 22:35:37 +0000 Subject: Fix scriptiong Open the file before reading from it Add text/all to the mimetypes this makes recording, saving and running work --- diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index afac542..7ffeca7 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -296,6 +296,7 @@ void MainWindow::slotSaveScript() { MimeTypes types; QStringList script; script << "text/plain"; + script << "text/all"; types.insert("Script", script); QString filename = OFileDialog::getSaveFileName(2, "/", QString::null, types); if (!filename.isEmpty()) { @@ -310,6 +311,7 @@ void MainWindow::slotRunScript() { MimeTypes types; QStringList script; script << "text/plain"; + script << "text/all"; types.insert("Script", script); QString filename = OFileDialog::getOpenFileName(2, "/", QString::null, types); if (!filename.isEmpty()) { diff --git a/noncore/apps/opie-console/script.cpp b/noncore/apps/opie-console/script.cpp index 9cb1cd3..e6e9d6d 100644 --- a/noncore/apps/opie-console/script.cpp +++ b/noncore/apps/opie-console/script.cpp @@ -7,6 +7,7 @@ Script::Script() { Script::Script(const QString fileName) { QFile file(fileName); + file.open(IO_ReadOnly ); m_script = file.readAll(); } -- cgit v0.9.0.2