Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Silenced Qt6 compilation warnings #1124

Merged
merged 1 commit into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,25 +178,30 @@ int main(int argc, char *argv[])
// install the translations built-into Qt itself
QTranslator qtTranslator;
if (qtTranslator.load(QStringLiteral("qt_") + QLocale::system().name(), QLibraryInfo::path(QLibraryInfo::TranslationsPath)))
{
app->installTranslator(&qtTranslator);
}

QTranslator translator;
bool installTr = false;
QString fname = QString::fromLatin1("qterminal_%1.qm").arg(QLocale::system().name().left(5));
#ifdef TRANSLATIONS_DIR
//qDebug() << "TRANSLATIONS_DIR: Loading translation file" << fname << "from dir" << TRANSLATIONS_DIR;
/*qDebug() << "load success:" <<*/ translator.load(fname, QString::fromUtf8(TRANSLATIONS_DIR), QStringLiteral("_"));
installTr = translator.load(fname, QString::fromUtf8(TRANSLATIONS_DIR), QStringLiteral("_"));
#endif
#ifdef APPLE_BUNDLE
QDir translations_dir = QDir(QApplication::applicationDirPath());
translations_dir.cdUp();
if (translations_dir.cd(QStringLiteral("Resources/translations"))) {
//qDebug() << "APPLE_BUNDLE: Loading translator file" << fname << "from dir" << translations_dir.path();
/*qDebug() << "load success:" <<*/ translator.load(fname, translations_dir.path(), QStringLiteral("_"));
installTr = translator.load(fname, translations_dir.path(), QStringLiteral("_"));
} /*else {
qWarning() << "Unable to find \"Resources/translations\" dir in" << translations_dir.path();
}*/
#endif
app->installTranslator(&translator);
if (installTr)
{
app->installTranslator(&translator);
}

TerminalConfig initConfig = TerminalConfig(workdir, shell_command);
app->newWindow(dropMode, initConfig);
Expand Down
4 changes: 2 additions & 2 deletions src/terminalconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -80,14 +80,14 @@ TerminalConfig TerminalConfig::fromDbus(const QHash<QString,QVariant> &termArgsC

static QString variantToString(const QVariant& variant, QString &defaultVal)
{
if (variant.typeId() == QMetaType::type("QString"))
if (variant.typeId() == QMetaType::QString)
return qvariant_cast<QString>(variant);
return defaultVal;
}

static QStringList variantToStringList(const QVariant& variant, QStringList &defaultVal)
{
if (variant.typeId() == QMetaType::type("QStringList"))
if (variant.typeId() == QMetaType::QStringList)
return qvariant_cast<QStringList>(variant);
return defaultVal;
}
Expand Down
Loading
Loading