A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd

themeeditor: Make it compile with current Qt5.

- Replace use of obsolete members with their replacements.
- Fix type issue that requires explicitly creating the right object now.
- Update project file to work with Qt5.

Change-Id: I3af2b1520796e977e58c0a01e165c77c469a23b9

+35 -35
+4 -4
utils/themeeditor/graphics/rbscreen.cpp
··· 227 227 228 228 void RBScreen::endSbsRender() 229 229 { 230 - sbsChildren = children(); 230 + sbsChildren = childItems(); 231 231 232 232 QList<int> keys = fonts.keys(); 233 233 for(QList<int>::iterator i = keys.begin(); i != keys.end(); i++) ··· 259 259 { 260 260 for(int i = 0; i < 6; i++) 261 261 { 262 - char c = str[i].toAscii(); 262 + char c = str[i].toLatin1(); 263 263 if(!((c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F') || 264 264 isdigit(c))) 265 265 { ··· 274 274 } 275 275 else if(str.length() == 1) 276 276 { 277 - if(isdigit(str[0].toAscii()) && str[0].toAscii() <= '3') 277 + if(isdigit(str[0].toLatin1()) && str[0].toLatin1() <= '3') 278 278 { 279 - int shade = 255 * (str[0].toAscii() - '0') / 3; 279 + int shade = 255 * (str[0].toLatin1() - '0') / 3; 280 280 retval = QColor(shade, shade, shade); 281 281 } 282 282 else
+5 -5
utils/themeeditor/gui/configdocument.cpp
··· 143 143 } 144 144 145 145 fout.open(QFile::WriteOnly); 146 - fout.write(toPlainText().toAscii()); 146 + fout.write(toPlainText().toLatin1()); 147 147 fout.close(); 148 148 149 149 saved = toPlainText(); ··· 174 174 175 175 QFile fout(filePath); 176 176 fout.open(QFile::WriteOnly); 177 - fout.write(toPlainText().toAscii()); 177 + fout.write(toPlainText().toLatin1()); 178 178 fout.close(); 179 179 180 180 saved = toPlainText(); ··· 415 415 QSettings settings; 416 416 settings.beginGroup("SkinDocument"); 417 417 418 - QColor fg = settings.value("fgColor", Qt::black).value<QColor>(); 419 - QColor bg = settings.value("bgColor", Qt::white).value<QColor>(); 418 + QColor fg = settings.value("fgColor", QColor(Qt::black)).value<QColor>(); 419 + QColor bg = settings.value("bgColor", QColor(Qt::white)).value<QColor>(); 420 420 QPalette palette; 421 421 palette.setColor(QPalette::All, QPalette::Base, bg); 422 422 palette.setColor(QPalette::All, QPalette::Text, fg); 423 423 editor->setPalette(palette); 424 424 425 - QColor highlight = settings.value("errorColor", Qt::red).value<QColor>(); 425 + QColor highlight = settings.value("errorColor", QColor(Qt::red)).value<QColor>(); 426 426 editor->setErrorColor(highlight); 427 427 428 428 /* Setting the font */
+1 -1
utils/themeeditor/gui/editorwindow.cpp
··· 874 874 QFile fout(filename); 875 875 fout.open(QFile::WriteOnly); 876 876 877 - fout.write(contents.toAscii()); 877 + fout.write(contents.toLatin1()); 878 878 879 879 fout.close(); 880 880 }
+3 -3
utils/themeeditor/gui/preferencesdialog.cpp
··· 85 85 /* Buttons from the editor group */ 86 86 settings.beginGroup("SkinDocument"); 87 87 88 - fgColor = settings.value("fgColor", Qt::black).value<QColor>(); 88 + fgColor = settings.value("fgColor", QColor(Qt::black)).value<QColor>(); 89 89 setButtonColor(ui->fgButton, fgColor); 90 90 91 - bgColor = settings.value("bgColor", Qt::white).value<QColor>(); 91 + bgColor = settings.value("bgColor", QColor(Qt::white)).value<QColor>(); 92 92 setButtonColor(ui->bgButton, bgColor); 93 93 94 - errorColor = settings.value("errorColor", Qt::red).value<QColor>(); 94 + errorColor = settings.value("errorColor", QColor(Qt::red)).value<QColor>(); 95 95 setButtonColor(ui->errorButton, errorColor); 96 96 97 97 settings.endGroup();
+1 -1
utils/themeeditor/gui/projectexporter.cpp
··· 204 204 fin.close(); 205 205 206 206 skin_element* root; 207 - root = skin_parse(contents.toAscii()); 207 + root = skin_parse(contents.toLatin1()); 208 208 if(!root) 209 209 { 210 210 addWarning(tr("Couldn't parse ") + file.split("/").last());
+8 -8
utils/themeeditor/gui/skindocument.cpp
··· 197 197 QSettings settings; 198 198 settings.beginGroup("SkinDocument"); 199 199 200 - QColor fg = settings.value("fgColor", Qt::black).value<QColor>(); 201 - QColor bg = settings.value("bgColor", Qt::white).value<QColor>(); 200 + QColor fg = settings.value("fgColor", QColor(Qt::black)).value<QColor>(); 201 + QColor bg = settings.value("bgColor", QColor(Qt::white)).value<QColor>(); 202 202 QPalette palette; 203 203 palette.setColor(QPalette::All, QPalette::Base, bg); 204 204 palette.setColor(QPalette::All, QPalette::Text, fg); 205 205 editor->setPalette(palette); 206 206 207 - QColor highlight = settings.value("errorColor", Qt::red).value<QColor>(); 207 + QColor highlight = settings.value("errorColor", QColor(Qt::red)).value<QColor>(); 208 208 editor->setErrorColor(highlight); 209 209 210 210 /* Setting the font */ ··· 227 227 QTextCursor line = editor->textCursor(); 228 228 line.movePosition(QTextCursor::StartOfLine); 229 229 line.movePosition(QTextCursor::EndOfLine, QTextCursor::KeepAnchor); 230 - skin_parse(line.selectedText().toAscii()); 230 + skin_parse(line.selectedText().toLatin1()); 231 231 if(skin_error_line() > 0) 232 232 parseStatus = tr("Error on line ") + 233 233 QString::number(line.blockNumber() + 1) ··· 263 263 264 264 editor->clearErrors(); 265 265 parseStatus = model->changeTree(editor->document()-> 266 - toPlainText().toAscii()); 266 + toPlainText().toLatin1()); 267 267 268 268 treeInSync = true; 269 269 emit antiSync(false); ··· 294 294 rest.removeSelectedText(); 295 295 base += skin_error_line(); 296 296 297 - skin_parse(doc.toPlainText().toAscii()); 297 + skin_parse(doc.toPlainText().toLatin1()); 298 298 299 299 if(skin_error_line() > 0) 300 300 editor->addError(base + skin_error_line()); ··· 338 338 } 339 339 340 340 fout.open(QFile::WriteOnly); 341 - fout.write(editor->document()->toPlainText().toAscii()); 341 + fout.write(editor->document()->toPlainText().toLatin1()); 342 342 fout.close(); 343 343 344 344 saved = editor->document()->toPlainText(); ··· 372 372 373 373 QFile fout(fileName); 374 374 fout.open(QFile::WriteOnly); 375 - fout.write(editor->document()->toPlainText().toAscii()); 375 + fout.write(editor->document()->toPlainText().toLatin1()); 376 376 fout.close(); 377 377 378 378 saved = editor->document()->toPlainText();
+7 -7
utils/themeeditor/gui/skinhighlighter.cpp
··· 63 63 if(text.length() - i < 2) 64 64 return; 65 65 66 - if(find_escape_character(text[i + 1].toAscii())) 66 + if(find_escape_character(text[i + 1].toLatin1())) 67 67 { 68 68 /* Checking for escaped characters */ 69 69 ··· 82 82 83 83 if(text.length() - i >= 3) 84 84 { 85 - lookup[0] = text[i + 1].toAscii(); 86 - lookup[1] = text[i + 2].toAscii(); 85 + lookup[0] = text[i + 1].toLatin1(); 86 + lookup[1] = text[i + 2].toLatin1(); 87 87 88 88 found = find_tag(lookup); 89 89 } ··· 96 96 else 97 97 { 98 98 lookup[1] = '\0'; 99 - lookup[0] = text[i + 1].toAscii(); 99 + lookup[0] = text[i + 1].toLatin1(); 100 100 found = find_tag(lookup); 101 101 102 102 if(found) ··· 121 121 122 122 if(text.length() - i >= 4) 123 123 { 124 - lookup[0] = text[i + 2].toAscii(); 125 - lookup[1] = text[i + 3].toAscii(); 124 + lookup[0] = text[i + 2].toLatin1(); 125 + lookup[1] = text[i + 3].toLatin1(); 126 126 127 127 found = find_tag(lookup); 128 128 } ··· 135 135 else 136 136 { 137 137 lookup[1] = '\0'; 138 - lookup[0] = text[i + 2].toAscii(); 138 + lookup[0] = text[i + 2].toLatin1(); 139 139 140 140 found = find_tag(lookup); 141 141
+1 -1
utils/themeeditor/main.cpp
··· 21 21 22 22 #include "editorwindow.h" 23 23 24 - #include <QtGui/QApplication> 24 + #include <QApplication> 25 25 26 26 int main(int argc, char* argv[]) 27 27 {
+4 -4
utils/themeeditor/models/parsetreemodel.cpp
··· 242 242 free(param->data.text); 243 243 244 244 param->type = skin_tag_parameter::STRING; 245 - param->data.text = strdup(value.toString().trimmed().toAscii()); 245 + param->data.text = strdup(value.toString().trimmed().toLatin1()); 246 246 } 247 247 else if(tolower(param->type_code) == 'i') 248 248 { ··· 265 265 return false; 266 266 267 267 free(element->data); 268 - element->data = strdup(value.toString().trimmed().toAscii()); 268 + element->data = strdup(value.toString().trimmed().toLatin1()); 269 269 } 270 270 271 271 emit dataChanged(index, index); ··· 330 330 331 331 if(sbsModel) 332 332 sbsModel->deleteLater(); 333 - sbsModel = new ParseTreeModel(QString(sbs.readAll()).toAscii()); 333 + sbsModel = new ParseTreeModel(QString(sbs.readAll()).toLatin1()); 334 334 335 335 if(sbsModel->root != 0) 336 336 { ··· 391 391 root->setFlag(QGraphicsItem::ItemIsSelectable, false); 392 392 root->setFlag(QGraphicsItem::ItemIsMovable, false); 393 393 394 - QList<QGraphicsItem*> children = root->children(); 394 + QList<QGraphicsItem*> children = root->childItems(); 395 395 for(QList<QGraphicsItem*>::iterator i = children.begin() 396 396 ; i != children.end(); i++) 397 397 setChildrenUnselectable(*i);
+1 -1
utils/themeeditor/themeeditor.pro
··· 8 8 } 9 9 10 10 # Adding network support 11 - QT += network 11 + QT += network widgets 12 12 13 13 # Enabling profiling 14 14 QMAKE_CXXFLAGS_DEBUG += -pg