aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas-Karl Pietrowski <thopiekar@googlemail.com>2016-04-18 12:44:01 +0200
committerThomas-Karl Pietrowski <thopiekar@googlemail.com>2016-04-18 12:44:01 +0200
commit1eb5ccf5208d775e1e70b2332d9a61df00612801 (patch)
tree5864868da3bb6f9124bbc12d427f4c111219a278
parenta6a1675a153e4a246fe9e5e1a14ee59dcad7d605 (diff)
parent6ea57f2f17169babe378d37a5e4753397fb69d5f (diff)
Merge remote-tracking branch 'origin/master'
-rw-r--r--pyrcc/rcc.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/pyrcc/rcc.cpp b/pyrcc/rcc.cpp
index 7d380b0..aa7451e 100644
--- a/pyrcc/rcc.cpp
+++ b/pyrcc/rcc.cpp
@@ -100,6 +100,7 @@ bool RCCFileInfo::writeDataInfo(FILE *out)
//data offset
qt_rcc_write_number(out, dataOffset, 4);
}
+ fprintf(out, "\\\n");
return true;
}
@@ -131,15 +132,19 @@ qint64 RCCFileInfo::writeDataBlob(FILE *out, qint64 offset)
//write the length
qt_rcc_write_number(out, data.size(), 4);
+ fprintf(out, "\\\n");
offset += 4;
//write the payload
for (int i=0; i<data.size(); i++) {
qt_rcc_write_number(out, data.at(i), 1);
+ if(!(i % 16))
+ fprintf(out, "\\\n");
}
offset += data.size();
//done
+ fprintf(out, "\\\n");
return offset;
}
@@ -150,20 +155,25 @@ qint64 RCCFileInfo::writeDataName(FILE *out, qint64 offset)
//write the length
qt_rcc_write_number(out, name.length(), 2);
+ fprintf(out, "\\\n");
offset += 2;
//write the hash
- qt_rcc_write_number(out, qHash(name), 4);
+ qt_rcc_write_number(out, qt_hash(name), 4);
+ fprintf(out, "\\\n");
offset += 4;
//write the name
const QChar *unicode = name.unicode();
for (int i=0; i<name.length(); i++) {
qt_rcc_write_number(out, unicode[i].unicode(), 2);
+ if(!(i % 16))
+ fprintf(out, "\\\n");
}
offset += name.length()*2;
//done
+ fprintf(out, "\\\n");
return offset;
}
@@ -411,7 +421,7 @@ RCCResourceLibrary::writeHeader(FILE *out)
bool
RCCResourceLibrary::writeDataBlobs(FILE *out)
{
- fprintf(out, "qt_resource_data = %s\"", mPrefix);
+ fprintf(out, "qt_resource_data = %s\"\\\n", mPrefix);
QStack<RCCFileInfo*> pending;
if (!root)
@@ -430,14 +440,14 @@ RCCResourceLibrary::writeDataBlobs(FILE *out)
offset = child->writeDataBlob(out, offset);
}
}
- fprintf(out, "\"\n");
+ fprintf(out, "\"\n\n");
return true;
}
bool
RCCResourceLibrary::writeDataNames(FILE *out)
{
- fprintf(out, "qt_resource_name = %s\"", mPrefix);
+ fprintf(out, "qt_resource_name = %s\"\\\n", mPrefix);
QHash<QString, int> names;
QStack<RCCFileInfo*> pending;
@@ -462,19 +472,19 @@ RCCResourceLibrary::writeDataNames(FILE *out)
}
}
}
- fprintf(out, "\"\n");
+ fprintf(out, "\"\n\n");
return true;
}
static bool qt_rcc_compare_hash(const RCCFileInfo *left, const RCCFileInfo *right)
{
- return qHash(left->name) < qHash(right->name);
+ return qt_hash(left->name) < qt_hash(right->name);
}
bool
RCCResourceLibrary::writeDataStructure(FILE *out)
{
- fprintf(out, "qt_resource_struct = %s\"", mPrefix);
+ fprintf(out, "qt_resource_struct = %s\"\\\n", mPrefix);
QStack<RCCFileInfo*> pending;
if (!root)
@@ -518,7 +528,7 @@ RCCResourceLibrary::writeDataStructure(FILE *out)
pending.push(child);
}
}
- fprintf(out, "\"\n");
+ fprintf(out, "\"\n\n");
return true;
}