Skip to content

Commit

Permalink
improve const correctness and make elide detection more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer authored Sep 20, 2024
1 parent 7f5711c commit dd55dae
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/library/dlgtagfetcher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -537,14 +537,14 @@ void DlgTagFetcher::slotNetworkResult(
const QString& app,
const QString& message,
int code) {
QString cantConnect = tr("Can't connect to %1: %2").arg(app, message);
QFontMetrics metrics(loadingProgressBar->font());
QString elidedCantConnect = metrics.elidedText(
const QString cantConnect = tr("Can't connect to %1: %2").arg(app, message);
const QFontMetrics metrics(loadingProgressBar->font());
const QString elidedCantConnect = metrics.elidedText(
cantConnect,
Qt::ElideRight,
loadingProgressBar->width() - 4);
loadingProgressBar->setFormat(elidedCantConnect);
if (cantConnect.size() != elidedCantConnect.size()) {
if (cantConnect != elidedCantConnect) {
loadingProgressBar->setToolTip(cantConnect);
}
qWarning() << "Error while fetching track metadata!"
Expand Down

0 comments on commit dd55dae

Please sign in to comment.