Bug 266068

Summary: kde-runtime doesn't compile because of wrong line endings
Product: kde-windows Reporter: Peter Grasch <me>
Component: generalAssignee: KDE-Windows <kde-windows>
Status: RESOLVED FIXED    
Severity: normal CC: ralf.habacker
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Compiled Sources   
OS: Microsoft Windows   
Latest Commit: Version Fixed In:

Description Peter Grasch 2011-02-11 11:10:44 UTC
Version:           SVN (using Devel) 
OS:                MS Windows

I've tried to compile a kde-runtime on windows 7 (using emerge). During compilation of kde-runtime I receive error messages about unterminated strings in jobviewserveradaptor.h.

The automatically generated DBus interface class had three windows line endings sprinkled in the generated strings.

Removing those (I think lines 37, 38, 39), the compile continued flawlessly.

Reproducible: Didn't try

Steps to Reproduce:
Its a fresh Windows 7 installation (specifically set up to be a KDE on windows developer machine) so the problem should be fairly reproducible.

Actual Results:  
Compile failed

Expected Results:  
Compile goes through
Comment 1 Ralf Habacker 2011-02-11 14:52:25 UTC
The related generated code looks like shown below: 


    Q_CLASSINFO("D-Bus Introspection", ""
"  <interface name=\"org.kde.JobViewServer\">\n"
"    <method name=\"requestView\">\n"
"      <arg direction=\"in\" type=\"s\" name=\"appName\"/>\n"
"      <arg direction=\"in\" type=\"s\" name=\"appIconName\"/>\n"
\n"    <!-- 'capabilities' is used as a bit field:
\n"         0x0001 means that the user should be able to cancel the job
\n"         0x0002 means that the user should be able to suspend/resume the job
"       -->\n"
"      <arg direction=\"in\" type=\"i\" name=\"capabilities\"/>\n"
"      <arg direction=\"out\" type=\"o\" name=\"trackerPath\"/>\n"
"    </method>\n"
"  </interface>\n"
        "")

The related code in <qt-source>/tools/qdbus/dbusxml2cpp.cpp is shown below: 

           << "    Q_CLASSINFO(\"D-Bus Introspection\", \"\"" << endl
           << stringify(interface->introspection)
           << "        \"\")" << endl

The string is converted by stringify, which follows: 

static QString stringify(const QString &data)
{
    QString retval;
    int i;
    for (i = 0; i < data.length(); ++i) {
        retval += QLatin1Char('\"');
        for ( ; i < data.length() && data[i] != QLatin1Char('\n'); ++i)
            if (data[i] == QLatin1Char('\"'))
                retval += QLatin1String("\\\"");
            else
                retval += data[i];
        retval += QLatin1String("\\n\"\n");
    }
    return retval;
}

Maybe this function do not parse the xml file correctly or interface->introspection contains additional \n.
Comment 2 Patrick Spendrin 2012-02-22 22:50:32 UTC
this has been fixed by adding special handling of eols to our gits configuration.