mirror of
https://github.com/ElvishArtisan/rivendell.git
synced 2025-11-30 17:20:32 +01:00
2023-08-04 Fred Gleason <fredg@paravelsystems.com>
* Added copyright and license notices to the standard '--version' output. Signed-off-by: Fred Gleason <fredg@paravelsystems.com>
This commit is contained in:
@@ -1179,3 +1179,25 @@ QString RDMimeType(const QByteArray &data,bool *ok)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
QString RDWrapText(const QString &str,int width)
|
||||
{
|
||||
QString line;
|
||||
QString ret;
|
||||
QStringList f0=str.split(" ",QString::KeepEmptyParts);
|
||||
int fn=0;
|
||||
|
||||
while(fn<f0.size()) {
|
||||
if((line.length()+1+f0.at(fn).length())<width) {
|
||||
line+=" "+f0.at(fn++);
|
||||
}
|
||||
else {
|
||||
ret+=line.trimmed()+"\n";
|
||||
line="";
|
||||
}
|
||||
}
|
||||
ret+=line.trimmed()+"\n";
|
||||
|
||||
return ret.trimmed();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user