Bug 266068 - kde-runtime doesn't compile because of wrong line endings
Summary: kde-runtime doesn't compile because of wrong line endings
Status: RESOLVED FIXED
Alias: None
Product: kde-windows
Classification: Unmaintained
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Microsoft Windows
: NOR normal
Target Milestone: ---
Assignee: KDE-Windows
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-11 11:10 UTC by Peter Grasch
Modified: 2012-02-22 22:50 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.