| 55 | } |
| 56 | |
| 57 | void BufferFormatList::setFormat(QString name, QString format) |
| 58 | { |
| 59 | bool newFmt = !formats.contains(name); |
| 60 | if(format.isEmpty()) |
| 61 | formats.remove(name); |
| 62 | else |
| 63 | formats[name] = format; |
| 64 | if(newFmt || (!newFmt && format.isEmpty())) |
| 65 | emit formatListUpdated(); |
| 66 | |
| 67 | QStringList keys = formats.keys(); |
| 68 | keys.sort(Qt::CaseInsensitive); |
| 69 | rdcarray<rdcstr> saved; |
| 70 | for(QString k : keys) |
| 71 | saved.push_back(k + lit("\n") + formats[k]); |
| 72 | m_Ctx.Config().BufferFormatter_SavedFormats = saved; |
| 73 | m_Ctx.Config().Save(); |
| 74 | } |
| 75 | |
| 76 | BufferFormatSpecifier::BufferFormatSpecifier(QWidget *parent) |
| 77 | : QWidget(parent), ui(new Ui::BufferFormatSpecifier) |
no test coverage detected