[Kde-bindings] [Bug 279931] Qyoto has severely broken QFile class

roland at logikalsolutions.com roland at logikalsolutions.com
Fri Aug 12 18:39:07 UTC 2011


https://bugs.kde.org/show_bug.cgi?id=279931





--- Comment #3 from  <roland logikalsolutions com>  2011-08-12 18:39:07 ---
I hate it when I forget to log in first!

That's what I love!  Speak with great authority directly out rectal sphincter
on a Friday without testing the actual case presented.  It's always
entertaining!

Add one line to your "proof" and QFile is horribly busted.

using System;
using Qyoto;

class MainClass {
    public static void Main(string[] args) {
        new QCoreApplication(args);  // just for Qyoto initialization


        QFile file = new QFile("hello.txt");
        file.SetTextModeEnabled( true);    // ****notice this one line
        file.Open((uint) QIODevice.OpenModeFlag.WriteOnly);

        QTextStream stream = new QTextStream(file);
        stream.Write("Hello World!");

        file.Close();
    }

}


mcs test_snippet_1.cs  -r:/usr/lib/mono/qyoto/qt-dotnet.dll


roland at linux-c345:~/mega_mono_qt> mono test_snippet_1.exe
QFile::open: File (hello.txt) already open
QIODevice::write: ReadOnly device
roland at linux-c345:~/mega_mono_qt> dir *.txt
ls: cannot access *.txt: No such file or directory
roland at linux-c345:~/mega_mono_qt> 

As to my using:

Qyoto.Qyoto.GetCPPEnumValue("Qt.QIODevice","WriteOnly"));

I did that because that is what the UI compiler generates in its code and that
is what you find in examples.  I agree your method is cleaner, but I could not
find it documented, hence, one of the main reasons I'm writing this book.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the Kde-bindings mailing list