mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-29 01:46:38 +00:00
Enable QT_NO_CAST_FROM_ASCII & QT_NO_CAST_TO_ASCII
* Added a couple of utility macros to help with the conversion. lit() is paired with tr() for untranslated text. * QFormatStr is more explicitly for non-textual formatting strings. * Both are just #define'd to QStringLiteral()
This commit is contained in:
@@ -56,20 +56,20 @@ int main(int argc, char *argv[])
|
||||
|
||||
qInfo() << "QRenderDoc initialising.";
|
||||
|
||||
QString filename = "";
|
||||
QString filename;
|
||||
bool temp = false;
|
||||
|
||||
for(int i = 0; i < argc; i++)
|
||||
{
|
||||
if(!QString::compare(argv[i], "--tempfile", Qt::CaseInsensitive))
|
||||
if(!QString::compare(QString::fromUtf8(argv[i]), lit("--tempfile"), Qt::CaseInsensitive))
|
||||
temp = true;
|
||||
}
|
||||
|
||||
for(int i = 0; i < argc; i++)
|
||||
{
|
||||
if(!QString::compare(argv[i], "--install_vulkan_layer") && i + 1 < argc)
|
||||
if(!QString::compare(QString::fromUtf8(argv[i]), lit("--install_vulkan_layer")) && i + 1 < argc)
|
||||
{
|
||||
if(!QString::compare(argv[i + 1], "root"))
|
||||
if(!QString::compare(QString::fromUtf8(argv[i + 1]), lit("root")))
|
||||
RENDERDOC_UpdateVulkanLayerRegistration(true);
|
||||
else
|
||||
RENDERDOC_UpdateVulkanLayerRegistration(false);
|
||||
@@ -77,22 +77,22 @@ int main(int argc, char *argv[])
|
||||
}
|
||||
}
|
||||
|
||||
QString remoteHost = "";
|
||||
QString remoteHost;
|
||||
uint remoteIdent = 0;
|
||||
|
||||
for(int i = 0; i + 1 < argc; i++)
|
||||
{
|
||||
if(!QString::compare(argv[i], "--remoteaccess", Qt::CaseInsensitive))
|
||||
if(!QString::compare(QString::fromUtf8(argv[i]), lit("--remoteaccess"), Qt::CaseInsensitive))
|
||||
{
|
||||
QRegularExpression regexp("^([a-zA-Z0-9_-]+:)?([0-9]+)$");
|
||||
QRegularExpression regexp(lit("^([a-zA-Z0-9_-]+:)?([0-9]+)$"));
|
||||
|
||||
QRegularExpressionMatch match = regexp.match(argv[i + 1]);
|
||||
QRegularExpressionMatch match = regexp.match(QString::fromUtf8(argv[i + 1]));
|
||||
|
||||
if(match.hasMatch())
|
||||
{
|
||||
QString host = match.captured(1);
|
||||
|
||||
if(host.length() > 0 && host[host.length() - 1] == ':')
|
||||
if(host.length() > 0 && host[host.length() - 1] == QLatin1Char(':'))
|
||||
host.chop(1);
|
||||
|
||||
bool ok = false;
|
||||
@@ -111,24 +111,26 @@ int main(int argc, char *argv[])
|
||||
|
||||
for(int i = 0; i + 1 < argc; i++)
|
||||
{
|
||||
if(!QString::compare(argv[i], "--python", Qt::CaseInsensitive) ||
|
||||
!QString::compare(argv[i], "--py", Qt::CaseInsensitive) ||
|
||||
!QString::compare(argv[i], "--script", Qt::CaseInsensitive))
|
||||
QString a = QString::fromUtf8(argv[i]);
|
||||
if(!QString::compare(a, lit("--python"), Qt::CaseInsensitive) ||
|
||||
!QString::compare(a, lit("--py"), Qt::CaseInsensitive) ||
|
||||
!QString::compare(a, lit("--script"), Qt::CaseInsensitive))
|
||||
{
|
||||
QFileInfo checkFile(argv[i + 1]);
|
||||
QString f = QString::fromUtf8(argv[i + 1]);
|
||||
QFileInfo checkFile(f);
|
||||
if(checkFile.exists() && checkFile.isFile())
|
||||
{
|
||||
pyscripts.push_back(argv[i + 1]);
|
||||
pyscripts.push_back(f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(argc > 1)
|
||||
{
|
||||
filename = argv[argc - 1];
|
||||
filename = QString::fromUtf8(argv[argc - 1]);
|
||||
QFileInfo checkFile(filename);
|
||||
if(!checkFile.exists() || !checkFile.isFile() || checkFile.suffix().toLower() == "py")
|
||||
filename = "";
|
||||
if(!checkFile.exists() || !checkFile.isFile() || checkFile.suffix().toLower() == lit("py"))
|
||||
filename = QString();
|
||||
}
|
||||
|
||||
argc += 2;
|
||||
@@ -139,7 +141,7 @@ int main(int argc, char *argv[])
|
||||
argv_mod[i] = argv[i];
|
||||
|
||||
char arg[] = "-platformpluginpath";
|
||||
QString path = QFileInfo(argv[0]).absolutePath();
|
||||
QString path = QFileInfo(QString::fromUtf8(argv[0])).absolutePath();
|
||||
QByteArray pathChars = path.toUtf8();
|
||||
|
||||
argv_mod[argc - 2] = arg;
|
||||
@@ -158,13 +160,13 @@ int main(int argc, char *argv[])
|
||||
dir.mkpath(configPath);
|
||||
}
|
||||
|
||||
QString configFilename = ConfigFilePath("UI.config");
|
||||
QString configFilename = ConfigFilePath(lit("UI.config"));
|
||||
|
||||
if(!config.Load(configFilename))
|
||||
{
|
||||
RDDialog::critical(
|
||||
NULL, "Error loading config",
|
||||
QString(
|
||||
NULL, CaptureContext::tr("Error loading config"),
|
||||
CaptureContext::tr(
|
||||
"Error loading config file\n%1\nA default config is loaded and will be saved out.")
|
||||
.arg(configFilename));
|
||||
}
|
||||
@@ -192,12 +194,13 @@ int main(int argc, char *argv[])
|
||||
|
||||
if(!frames.isEmpty())
|
||||
{
|
||||
exString += "Traceback (most recent call last):\n";
|
||||
exString += QApplication::translate(
|
||||
"qrenderdoc", "Traceback (most recent call last):\n");
|
||||
for(const QString &f : frames)
|
||||
exString += QString(" %1\n").arg(f);
|
||||
exString += QFormatStr(" %1\n").arg(f);
|
||||
}
|
||||
|
||||
exString += QString("%1: %2\n").arg(type).arg(value);
|
||||
exString += QFormatStr("%1: %2\n").arg(type).arg(value);
|
||||
|
||||
fprintf(stderr, "%s", exString.toUtf8().data());
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user