Merge branch 'qt_follow_up' into 'master'

Cleanup changes in Qt applications

See merge request OpenMW/openmw!4225
pull/3236/head
psi29a 6 months ago
commit 804b589a68

@ -71,7 +71,7 @@ bool CSVWorld::DataDisplayDelegate::eventFilter(QObject* target, QEvent* event)
QColor themeColor = QApplication::palette().text().color(); QColor themeColor = QApplication::palette().text().color();
if (themeColor != mPixmapsColor) if (themeColor != mPixmapsColor)
{ {
mPixmapsColor = themeColor; mPixmapsColor = std::move(themeColor);
buildPixmaps(); buildPixmaps();
} }

@ -212,7 +212,7 @@ void CSVWorld::ScriptSubView::useHint(const std::string& hint)
if (hint.empty()) if (hint.empty())
return; return;
unsigned line = 0, column = 0; int line = 0, column = 0;
char c; char c;
std::istringstream stream(hint.c_str() + 1); std::istringstream stream(hint.c_str() + 1);
switch (hint[0]) switch (hint[0])
@ -222,8 +222,8 @@ void CSVWorld::ScriptSubView::useHint(const std::string& hint)
{ {
QModelIndex index = mModel->getModelIndex(getUniversalId().getId(), mColumn); QModelIndex index = mModel->getModelIndex(getUniversalId().getId(), mColumn);
QString source = mModel->data(index).toString(); QString source = mModel->data(index).toString();
unsigned stringSize = source.length(); int stringSize = static_cast<int>(source.length());
unsigned pos, dummy; int pos, dummy;
if (!(stream >> c >> dummy >> pos)) if (!(stream >> c >> dummy >> pos))
return; return;
@ -234,7 +234,7 @@ void CSVWorld::ScriptSubView::useHint(const std::string& hint)
pos = stringSize; pos = stringSize;
} }
for (unsigned i = 0; i <= pos; ++i) for (int i = 0; i <= pos; ++i)
{ {
if (source[i] == '\n') if (source[i] == '\n')
{ {

@ -36,7 +36,12 @@ namespace Misc
return QIcon(); return QIcon();
QFile iconFile(fileName); QFile iconFile(fileName);
iconFile.open(QIODevice::ReadOnly); if (!iconFile.open(QIODevice::ReadOnly))
{
qDebug() << "Failed to open icon file:" << fileName;
return QIcon();
}
auto content = iconFile.readAll(); auto content = iconFile.readAll();
if (!content.startsWith("<?xml")) if (!content.startsWith("<?xml"))
return QIcon(fileName); return QIcon(fileName);

@ -43,7 +43,12 @@ namespace Platform
setStyle("windows"); setStyle("windows");
QFile file(getStyleSheetPath()); QFile file(getStyleSheetPath());
file.open(QIODevice::ReadOnly); if (!file.open(QIODevice::ReadOnly))
{
qDebug() << "Failed to open style sheet file:" << getStyleSheetPath();
return;
}
setStyleSheet(file.readAll()); setStyleSheet(file.readAll());
} }
} }
@ -60,7 +65,12 @@ namespace Platform
setStyle("windows"); setStyle("windows");
QFile file(getStyleSheetPath()); QFile file(getStyleSheetPath());
file.open(QIODevice::ReadOnly); if (!file.open(QIODevice::ReadOnly))
{
qDebug() << "Failed to open style sheet file:" << getStyleSheetPath();
return;
}
setStyleSheet(file.readAll()); setStyleSheet(file.readAll());
} }
else else

Loading…
Cancel
Save