2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-09-01 15:15:13 +00:00

Replaced some qsl with u""_q literal.

This commit is contained in:
23rd
2022-11-30 00:46:36 +03:00
parent ad3f8e72a0
commit 4fabb3f2a2
109 changed files with 762 additions and 757 deletions

View File

@@ -464,7 +464,7 @@ bool GenerateDesktopFile(
QStringList exec;
exec.append(cExeDir() + cExeName());
if (Core::Sandbox::Instance().customWorkingDir()) {
exec.append(qsl("-workdir"));
exec.append(u"-workdir"_q);
exec.append(cWorkingDir());
}
exec.append(args);
@@ -485,7 +485,7 @@ bool GenerateDesktopFile(
if (!exec.isEmpty()) {
exec[0] = cExeDir() + cExeName();
if (Core::Sandbox::Instance().customWorkingDir()) {
exec.insert(1, qsl("-workdir"));
exec.insert(1, u"-workdir"_q);
exec.insert(2, cWorkingDir());
}
target->set_string(
@@ -509,10 +509,10 @@ bool GenerateDesktopFile(
if (!Core::UpdaterDisabled()) {
DEBUG_LOG(("App Info: removing old .desktop files"));
QFile::remove(qsl("%1telegram.desktop").arg(targetPath));
QFile::remove(qsl("%1telegramdesktop.desktop").arg(targetPath));
QFile::remove(u"%1telegram.desktop"_q.arg(targetPath));
QFile::remove(u"%1telegramdesktop.desktop"_q.arg(targetPath));
const auto appimagePath = qsl("file://%1%2").arg(
const auto appimagePath = u"file://%1%2"_q.arg(
cExeDir(),
cExeName()).toUtf8();
@@ -522,7 +522,7 @@ bool GenerateDesktopFile(
appimagePath.size(),
md5Hash);
QFile::remove(qsl("%1appimagekit_%2-%3.desktop").arg(
QFile::remove(u"%1appimagekit_%2-%3.desktop"_q.arg(
targetPath,
md5Hash,
AppName.utf16().replace(' ', '_')));
@@ -536,7 +536,7 @@ bool GenerateDesktopFile(
hashMd5Hex(exePath.constData(), exePath.size(), md5Hash);
}
QFile::remove(qsl("%1org.telegram.desktop.%2.desktop").arg(
QFile::remove(u"%1org.telegram.desktop.%2.desktop"_q.arg(
targetPath,
md5Hash));
}
@@ -622,10 +622,10 @@ void AutostartToggle(bool enabled, Fn<void(bool)> done) {
} else {
const auto autostart = QStandardPaths::writableLocation(
QStandardPaths::GenericConfigLocation)
+ qsl("/autostart/");
+ u"/autostart/"_q;
if (enabled) {
GenerateDesktopFile(autostart, { qsl("-autostart") }, silent);
GenerateDesktopFile(autostart, { u"-autostart"_q }, silent);
} else {
QFile::remove(autostart + QGuiApplication::desktopFileName());
}
@@ -668,8 +668,8 @@ QString psAppDataPath() {
// If we find data there, we should still use it.
auto home = QDir::homePath();
if (!home.isEmpty()) {
auto oldPath = home + qsl("/.TelegramDesktop/");
auto oldSettingsBase = oldPath + qsl("tdata/settings");
auto oldPath = home + u"/.TelegramDesktop/"_q;
auto oldSettingsBase = oldPath + u"tdata/settings"_q;
if (QFile::exists(oldSettingsBase + '0')
|| QFile::exists(oldSettingsBase + '1')
|| QFile::exists(oldSettingsBase + 's')) {
@@ -710,14 +710,14 @@ void start() {
QGuiApplication::setDesktopFileName([&] {
if (KSandbox::isFlatpak()) {
return qEnvironmentVariable("FLATPAK_ID") + qsl(".desktop");
return qEnvironmentVariable("FLATPAK_ID") + u".desktop"_q;
}
if (KSandbox::isSnap()) {
return qEnvironmentVariable("SNAP_INSTANCE_NAME")
+ '_'
+ cExeName()
+ qsl(".desktop");
+ u".desktop"_q;
}
if (!Core::UpdaterDisabled()) {
@@ -732,10 +732,10 @@ void start() {
md5Hash.data());
}
return qsl("org.telegram.desktop._%1.desktop").arg(md5Hash);
return u"org.telegram.desktop._%1.desktop"_q.arg(md5Hash);
}
return qsl("org.telegram.desktop.desktop");
return u"org.telegram.desktop.desktop"_q;
}());
LOG(("Launcher filename: %1").arg(QGuiApplication::desktopFileName()));
@@ -768,11 +768,11 @@ void start() {
#endif // DESKTOP_APP_USE_PACKAGED_FONTS
#endif // !DESKTOP_APP_DISABLE_DBUS_INTEGRATION
Webview::WebKit2Gtk::SetSocketPath(qsl("%1/%2-%3-webview-%4").arg(
Webview::WebKit2Gtk::SetSocketPath(u"%1/%2-%3-webview-%4"_q.arg(
QDir::tempPath(),
h,
cGUIDStr(),
qsl("%1")).toStdString());
u"%1"_q).toStdString());
}
void finish() {
@@ -795,11 +795,11 @@ void InstallLauncher(bool force) {
GenerateDesktopFile(applicationsPath);
const auto icons = QStandardPaths::writableLocation(
QStandardPaths::GenericDataLocation) + qsl("/icons/");
QStandardPaths::GenericDataLocation) + u"/icons/"_q;
if (!QDir(icons).exists()) QDir().mkpath(icons);
const auto icon = icons + base::IconName() + qsl(".png");
const auto icon = icons + base::IconName() + u".png"_q;
auto iconExists = QFile::exists(icon);
if (Local::oldSettingsVersion() < 2008012 && iconExists) {
// Icon was changed.
@@ -808,7 +808,7 @@ void InstallLauncher(bool force) {
}
}
if (!iconExists) {
if (QFile::copy(qsl(":/gui/art/logo_256.png"), icon)) {
if (QFile::copy(u":/gui/art/logo_256.png"_q, icon)) {
DEBUG_LOG(("App Info: Icon copied to '%1'").arg(icon));
}
}
@@ -876,8 +876,8 @@ void NewVersionLaunched(int oldVersion) {
&& oldVersion <= 4000002
&& qEnvironmentVariableIsSet("WAYLAND_DISPLAY")
&& DesktopEnvironment::IsGnome()
&& !QFile::exists(cWorkingDir() + qsl("tdata/nowayland"))) {
QFile f(cWorkingDir() + qsl("tdata/nowayland"));
&& !QFile::exists(cWorkingDir() + u"tdata/nowayland"_q)) {
QFile f(cWorkingDir() + u"tdata/nowayland"_q);
if (f.open(QIODevice::WriteOnly)) {
f.write("1");
f.close();