Skip to content

Commit

Permalink
Silenced Qt6 compilation warnings (#1124)
Browse files Browse the repository at this point in the history
All of them were trivial.

Strangely enough, the file `qxtglobalshortcut.cpp` had the MS-Windows newline character, which was corrected by FeatherPad on saving.
  • Loading branch information
tsujan authored May 16, 2024
1 parent 98f941b commit 313e043
Show file tree
Hide file tree
Showing 3 changed files with 223 additions and 218 deletions.
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

0 comments on commit 313e043

Please sign in to comment.