...
 
Commits (3)
......@@ -102,7 +102,12 @@ void tryInitDrMingw()
QString logFile = QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation).replace(L'/', L'\\') + QStringLiteral("\\kritacrash.log");
myExcHndlSetLogFileNameA(logFile.toLocal8Bit());
}
} // namespace
#endif
#ifdef Q_OS_WIN
namespace
{
typedef enum ORIENTATION_PREFERENCE {
ORIENTATION_PREFERENCE_NONE = 0x0,
ORIENTATION_PREFERENCE_LANDSCAPE = 0x1,
......@@ -131,6 +136,7 @@ void resetRotation()
}
} // namespace
#endif
extern "C" int main(int argc, char **argv)
{
......
......@@ -45,7 +45,7 @@ QTextDocument *NodeToolTip::createDocument(const QModelIndex &index)
QString name = index.data(Qt::DisplayRole).toString();
KisBaseNode::PropertyList properties = index.data(KisNodeModel::PropertiesRole).value<KisBaseNode::PropertyList>();
QString rows;
const QString row = QString("<tr><td align=\"right\">%1:</td><td align=\"left\">%2</td></tr>");
const QString row = QString("<tr><td align=\"right\"><nobr>%1:</nobr></td><td align=\"left\">%2</td></tr>");
QString value;
for(int i = 0, n = properties.count(); i < n; ++i) {
if (properties[i].isMutable)
......
......@@ -120,8 +120,18 @@ static bool loadTGA(QDataStream & s, const TgaHeader & tga, QImage &img)
TgaHeaderInfo info(tga);
// However alpha exists only in the 32 bit format.
if ((tga.pixel_size == 32) && (tga.flags & 0xf)) {
/**
* Theoretically, we should check alpha presence via the bits
* in flags, but there are a lot of files in the wild that
* have this flag unset. It contradicts TGA specification,
* but we cannot do anything about it.
*/
const bool hasAlpha = tga.flags & 0xf;
if (tga.pixel_size == 32 && !hasAlpha) {
qWarning() << "WARNING: TGA image with 32-bit pixel size reports absence of alpha channel. It is not possible, fixing...";
}
if (tga.pixel_size == 32 || tga.pixel_size == 16) {
img = QImage(tga.width, tga.height, QImage::Format_ARGB32);
}
......