~l3on/ubuntu/precise/rkward/rebuild1

« back to all changes in this revision

Viewing changes to rkward/core/rcontainerobject.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Thomas Friedrichsmeier
  • Date: 2008-04-20 21:30:00 UTC
  • mfrom: (1.2.2 upstream) (3.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080420213000-fs4i8efmfc793bnn
new upstream release
closes: #475175
closes: #463348
closes: #475982

Show diffs side-by-side

added added

removed removed

Lines of Context:
353
353
        return false;
354
354
}
355
355
 
356
 
QString RContainerObject::validizeName (const QString &child_name) {
 
356
QString RContainerObject::validizeName (const QString &child_name, bool unique) {
357
357
        RK_TRACE (OBJECTS);
358
358
        QString ret = child_name;
359
359
        ret = ret.replace (QRegExp ("[^a-zA-Z0-9]"), ".");
360
360
        ret = ret.replace (QRegExp ("^\\.*[0-9]+"), ".");
361
361
        if (ret.isEmpty ()) ret = "var";
362
362
        int i=-1;
 
363
 
 
364
        if (!unique) return ret;
363
365
        QString postfix;
364
366
        while (childmap.contains (ret + postfix)) {
365
367
                postfix.setNum (++i);
366
368
        }
367
 
        return (ret +postfix);
 
369
        return (ret + postfix);
368
370
}