Commit a9878b1
committed
Qt: prefer libretro-common file APIs and drop Qt5/Qt6 ladders
Reduces Qt-specific surface and silences three pre-existing
-Wdeprecated-declarations warnings. All changes preserve behaviour
on Qt 5.2 and up (RetroArch's minimum, per qb/config.libs.sh).
* MainWindow::MainWindow:
Drop dead 'QDir playlistDir(path_dir_playlist)' and the
path_dir_playlist local that only existed to construct it. Both
unused since the constructor split. -Wunused-variable did not
flag the QDir because of its non-trivial constructor.
* MainWindow::setCustomThemeFile:
Replace QFile open / readAll / close with filestream_read_file
plus filestream_exists. Same five error paths preserved
(blank path, missing file, open failure, empty file, success).
* MainWindow::onFileBrowserTreeContextMenuRequested:
Replace the QDir / dir.exists() existence check with
path_is_directory(). Removes a Qt5/Qt6 ifdef ladder ('dir =
string' on Qt5 vs 'dir.setPath(string)' on Qt6) and silences
the QDir::operator=(QString) deprecation warning. The
QDir::toNativeSeparators(...) display path stays - that side is
fine on both Qt 5 and Qt 6.
* LoadCoreWindow::onCoreEnterPressed:
Replace 'QByteArray::append(QString)' (Qt 5) /
'QByteArray::append(QString::toStdString())' (Qt 6) ladder with
'path.toUtf8().constData()' inline. The temporary QByteArray's
lifetime extends through the loadCore() call so this is safe.
Silences the QByteArray::append(QString) deprecation warning.
* MainWindow::onPlaylistWidgetContextMenuRequested:
Replace 'm_listWidget->isItemHidden(item)' (deprecated since
Qt 4.8) with 'item->isHidden()' (available since Qt 4.x).
Removes a Qt5/Qt6 ifdef ladder. Silences the
QListWidget::isItemHidden() deprecation warning.
Tested under Qt 5.15 with -Wdeprecated-declarations enabled; all
four object files (ui_qt, ui_qt_widgets, moc_ui_qt,
moc_ui_qt_widgets) now build with zero warnings.
No behaviour change.1 parent 334f787 commit a9878b1
2 files changed
Lines changed: 33 additions & 59 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1540 | 1540 | | |
1541 | 1541 | | |
1542 | 1542 | | |
1543 | | - | |
1544 | 1543 | | |
1545 | | - | |
1546 | 1544 | | |
1547 | 1545 | | |
1548 | 1546 | | |
| |||
2202 | 2200 | | |
2203 | 2201 | | |
2204 | 2202 | | |
| 2203 | + | |
| 2204 | + | |
| 2205 | + | |
| 2206 | + | |
| 2207 | + | |
2205 | 2208 | | |
2206 | 2209 | | |
2207 | 2210 | | |
| |||
2210 | 2213 | | |
2211 | 2214 | | |
2212 | 2215 | | |
2213 | | - | |
| 2216 | + | |
| 2217 | + | |
2214 | 2218 | | |
2215 | | - | |
| 2219 | + | |
2216 | 2220 | | |
2217 | | - | |
2218 | | - | |
2219 | | - | |
2220 | | - | |
2221 | | - | |
2222 | | - | |
2223 | | - | |
2224 | | - | |
2225 | | - | |
2226 | | - | |
2227 | | - | |
2228 | | - | |
2229 | | - | |
2230 | | - | |
2231 | | - | |
2232 | | - | |
2233 | | - | |
2234 | | - | |
2235 | | - | |
2236 | | - | |
2237 | | - | |
2238 | | - | |
2239 | | - | |
| 2221 | + | |
| 2222 | + | |
| 2223 | + | |
| 2224 | + | |
| 2225 | + | |
2240 | 2226 | | |
2241 | | - | |
2242 | | - | |
| 2227 | + | |
| 2228 | + | |
| 2229 | + | |
| 2230 | + | |
| 2231 | + | |
| 2232 | + | |
2243 | 2233 | | |
2244 | | - | |
| 2234 | + | |
| 2235 | + | |
2245 | 2236 | | |
| 2237 | + | |
2246 | 2238 | | |
2247 | 2239 | | |
2248 | | - | |
| 2240 | + | |
2249 | 2241 | | |
2250 | 2242 | | |
2251 | 2243 | | |
| 2244 | + | |
| 2245 | + | |
| 2246 | + | |
2252 | 2247 | | |
2253 | 2248 | | |
2254 | 2249 | | |
| |||
2327 | 2322 | | |
2328 | 2323 | | |
2329 | 2324 | | |
2330 | | - | |
2331 | | - | |
2332 | 2325 | | |
2333 | 2326 | | |
2334 | 2327 | | |
2335 | 2328 | | |
2336 | 2329 | | |
2337 | 2330 | | |
2338 | | - | |
2339 | 2331 | | |
2340 | 2332 | | |
| 2333 | + | |
| 2334 | + | |
2341 | 2335 | | |
2342 | 2336 | | |
2343 | 2337 | | |
2344 | 2338 | | |
2345 | | - | |
2346 | | - | |
2347 | | - | |
2348 | | - | |
2349 | | - | |
| 2339 | + | |
| 2340 | + | |
2350 | 2341 | | |
2351 | | - | |
| 2342 | + | |
2352 | 2343 | | |
2353 | 2344 | | |
2354 | 2345 | | |
| |||
2360 | 2351 | | |
2361 | 2352 | | |
2362 | 2353 | | |
2363 | | - | |
2364 | | - | |
2365 | | - | |
2366 | 2354 | | |
2367 | 2355 | | |
2368 | 2356 | | |
| |||
5426 | 5414 | | |
5427 | 5415 | | |
5428 | 5416 | | |
5429 | | - | |
5430 | | - | |
5431 | 5417 | | |
5432 | 5418 | | |
5433 | 5419 | | |
5434 | 5420 | | |
5435 | 5421 | | |
5436 | 5422 | | |
5437 | | - | |
5438 | | - | |
5439 | | - | |
5440 | | - | |
5441 | | - | |
5442 | | - | |
5443 | | - | |
5444 | | - | |
| 5423 | + | |
5445 | 5424 | | |
5446 | 5425 | | |
5447 | 5426 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8024 | 8024 | | |
8025 | 8025 | | |
8026 | 8026 | | |
8027 | | - | |
8028 | | - | |
8029 | | - | |
8030 | | - | |
8031 | | - | |
8032 | 8027 | | |
8033 | | - | |
| 8028 | + | |
8034 | 8029 | | |
8035 | 8030 | | |
8036 | 8031 | | |
| |||
0 commit comments