Bitmaps were limited to 8 chars instead of 10 chars
This commit is contained in:
@@ -355,14 +355,13 @@ Setup::Setup(QWidget *parent, ModelData & model):
|
|||||||
QString path = g.profile[g.id()].sdPath();
|
QString path = g.profile[g.id()].sdPath();
|
||||||
path.append("/BMP/");
|
path.append("/BMP/");
|
||||||
QDir qd(path);
|
QDir qd(path);
|
||||||
int vml = GetEepromInterface()->getCapability(VoicesMaxLength)+4;
|
|
||||||
if (qd.exists()) {
|
if (qd.exists()) {
|
||||||
QStringList filters;
|
QStringList filters;
|
||||||
filters << "*.bmp" << "*.bmp";
|
filters << "*.bmp" << "*.bmp";
|
||||||
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
|
foreach ( QString file, qd.entryList(filters, QDir::Files) ) {
|
||||||
QFileInfo fi(file);
|
QFileInfo fi(file);
|
||||||
QString temp = fi.completeBaseName();
|
QString temp = fi.completeBaseName();
|
||||||
if (!items.contains(temp) && temp.length() <= vml) {
|
if (!items.contains(temp) && temp.length() <= 10+4) {
|
||||||
items.append(temp);
|
items.append(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -520,8 +519,8 @@ void Setup::on_name_editingFinished()
|
|||||||
void Setup::on_image_currentIndexChanged(int index)
|
void Setup::on_image_currentIndexChanged(int index)
|
||||||
{
|
{
|
||||||
if (!lock) {
|
if (!lock) {
|
||||||
strncpy(model.bitmap, ui->image->currentText().toAscii(), GetEepromInterface()->getCapability(VoicesMaxLength));
|
strncpy(model.bitmap, ui->image->currentText().toAscii(), 10);
|
||||||
QString path=g.profile[g.id()].sdPath();
|
QString path = g.profile[g.id()].sdPath();
|
||||||
path.append("/BMP/");
|
path.append("/BMP/");
|
||||||
QDir qd(path);
|
QDir qd(path);
|
||||||
if (qd.exists()) {
|
if (qd.exists()) {
|
||||||
@@ -536,7 +535,7 @@ void Setup::on_image_currentIndexChanged(int index)
|
|||||||
image.load(fileName);
|
image.load(fileName);
|
||||||
}
|
}
|
||||||
if (!image.isNull()) {
|
if (!image.isNull()) {
|
||||||
ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled( 64,32)));;
|
ui->imagePreview->setPixmap(QPixmap::fromImage(image.scaled(64, 32)));;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
ui->imagePreview->clear();
|
ui->imagePreview->clear();
|
||||||
|
|||||||
Reference in New Issue
Block a user