Don't use deprecated toAscii() method

Summary:
QChar::toAscii() and QString::toAscii() are deprecated in favor of
QChar::toLatin1() and QString::toLatin1() respectively.

Reviewers: #kwin, apol

Reviewed By: apol

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D22374
icc-effect-5.17.5
Vlad Zagorodniy 2019-07-10 16:04:52 +03:00
parent 4f76e5f6c5
commit 28a4337ad5
5 changed files with 27 additions and 27 deletions

View File

@ -207,7 +207,7 @@ bool AbstractClient::tabTo(AbstractClient *other, bool behind, bool activate)
void AbstractClient::syncTabGroupFor(QString property, bool fromThisClient)
{
if (tab_group)
tab_group->sync(property.toAscii().data(), fromThisClient ? this : tab_group->current());
tab_group->sync(property.toLatin1().data(), fromThisClient ? this : tab_group->current());
}
bool AbstractClient::isCurrentTab() const

View File

@ -1345,7 +1345,7 @@ void Client::setOnActivities(QStringList newActivitiesList)
m_client.changeProperty(atoms->activities, XCB_ATOM_STRING, 8, nullUuid.length(), nullUuid.constData());
} else {
QByteArray joined = joinedActivitiesList.toAscii();
QByteArray joined = joinedActivitiesList.toLatin1();
activityList = newActivitiesList;
m_client.changeProperty(atoms->activities, XCB_ATOM_STRING, 8, joined.length(), joined.constData());
}

View File

@ -117,8 +117,8 @@ void createMaxButtonPixmaps()
},
};
QByteArray baseColor(". c " + KColorScheme(QPalette::Active, KColorScheme::View).background().color().name().toAscii());
QByteArray textColor("# c " + KColorScheme(QPalette::Active, KColorScheme::View).foreground().color().name().toAscii());
QByteArray baseColor(". c " + KColorScheme(QPalette::Active, KColorScheme::View).background().color().name().toLatin1());
QByteArray textColor("# c " + KColorScheme(QPalette::Active, KColorScheme::View).foreground().color().name().toLatin1());
for (int t = 0; t < 3; ++t) {
maxButtonXpms[t][0] = "15 13 2 1";
maxButtonXpms[t][1] = baseColor.constData();
@ -390,19 +390,19 @@ void KTitleBarActionsConfig::changeEvent(QEvent *ev)
void KTitleBarActionsConfig::load()
{
KConfigGroup windowsConfig(config, "Windows");
setComboText(m_ui->coTiDbl, windowsConfig.readEntry("TitlebarDoubleClickCommand", "Maximize").toAscii());
setComboText(m_ui->leftClickMaximizeButton, windowsConfig.readEntry(cnf_Max[0], tbl_Max[0]).toAscii());
setComboText(m_ui->middleClickMaximizeButton, windowsConfig.readEntry(cnf_Max[1], tbl_Max[1]).toAscii());
setComboText(m_ui->rightClickMaximizeButton, windowsConfig.readEntry(cnf_Max[2], tbl_Max[2]).toAscii());
setComboText(m_ui->coTiDbl, windowsConfig.readEntry("TitlebarDoubleClickCommand", "Maximize").toLatin1());
setComboText(m_ui->leftClickMaximizeButton, windowsConfig.readEntry(cnf_Max[0], tbl_Max[0]).toLatin1());
setComboText(m_ui->middleClickMaximizeButton, windowsConfig.readEntry(cnf_Max[1], tbl_Max[1]).toLatin1());
setComboText(m_ui->rightClickMaximizeButton, windowsConfig.readEntry(cnf_Max[2], tbl_Max[2]).toLatin1());
KConfigGroup cg(config, "MouseBindings");
setComboText(m_ui->coTiAct1, cg.readEntry("CommandActiveTitlebar1", "Raise").toAscii());
setComboText(m_ui->coTiAct2, cg.readEntry("CommandActiveTitlebar2", "Start Window Tab Drag").toAscii());
setComboText(m_ui->coTiAct3, cg.readEntry("CommandActiveTitlebar3", "Operations menu").toAscii());
setComboText(m_ui->coTiAct4, cg.readEntry("CommandTitlebarWheel", "Switch to Window Tab to the Left/Right").toAscii());
setComboText(m_ui->coTiInAct1, cg.readEntry("CommandInactiveTitlebar1", "Activate and raise").toAscii());
setComboText(m_ui->coTiInAct2, cg.readEntry("CommandInactiveTitlebar2", "Start Window Tab Drag").toAscii());
setComboText(m_ui->coTiInAct3, cg.readEntry("CommandInactiveTitlebar3", "Operations menu").toAscii());
setComboText(m_ui->coTiAct1, cg.readEntry("CommandActiveTitlebar1", "Raise").toLatin1());
setComboText(m_ui->coTiAct2, cg.readEntry("CommandActiveTitlebar2", "Start Window Tab Drag").toLatin1());
setComboText(m_ui->coTiAct3, cg.readEntry("CommandActiveTitlebar3", "Operations menu").toLatin1());
setComboText(m_ui->coTiAct4, cg.readEntry("CommandTitlebarWheel", "Switch to Window Tab to the Left/Right").toLatin1());
setComboText(m_ui->coTiInAct1, cg.readEntry("CommandInactiveTitlebar1", "Activate and raise").toLatin1());
setComboText(m_ui->coTiInAct2, cg.readEntry("CommandInactiveTitlebar2", "Start Window Tab Drag").toLatin1());
setComboText(m_ui->coTiInAct3, cg.readEntry("CommandInactiveTitlebar3", "Operations menu").toLatin1());
}
void KTitleBarActionsConfig::save()
@ -523,15 +523,15 @@ void KWindowActionsConfig::showEvent(QShowEvent *ev)
void KWindowActionsConfig::load()
{
KConfigGroup cg(config, "MouseBindings");
setComboText(m_ui->coWin1, cg.readEntry("CommandWindow1", "Activate, raise and pass click").toAscii());
setComboText(m_ui->coWin2, cg.readEntry("CommandWindow2", "Activate and pass click").toAscii());
setComboText(m_ui->coWin3, cg.readEntry("CommandWindow3", "Activate and pass click").toAscii());
setComboText(m_ui->coWinWheel, cg.readEntry("CommandWindowWheel", "Scroll").toAscii());
setComboText(m_ui->coAllKey, cg.readEntry("CommandAllKey", "Alt").toAscii());
setComboText(m_ui->coAll1, cg.readEntry("CommandAll1", "Move").toAscii());
setComboText(m_ui->coAll2, cg.readEntry("CommandAll2", "Toggle raise and lower").toAscii());
setComboText(m_ui->coAll3, cg.readEntry("CommandAll3", "Resize").toAscii());
setComboText(m_ui->coAllW, cg.readEntry("CommandAllWheel", "Nothing").toAscii());
setComboText(m_ui->coWin1, cg.readEntry("CommandWindow1", "Activate, raise and pass click").toLatin1());
setComboText(m_ui->coWin2, cg.readEntry("CommandWindow2", "Activate and pass click").toLatin1());
setComboText(m_ui->coWin3, cg.readEntry("CommandWindow3", "Activate and pass click").toLatin1());
setComboText(m_ui->coWinWheel, cg.readEntry("CommandWindowWheel", "Scroll").toLatin1());
setComboText(m_ui->coAllKey, cg.readEntry("CommandAllKey", "Alt").toLatin1());
setComboText(m_ui->coAll1, cg.readEntry("CommandAll1", "Move").toLatin1());
setComboText(m_ui->coAll2, cg.readEntry("CommandAll2", "Toggle raise and lower").toLatin1());
setComboText(m_ui->coAll3, cg.readEntry("CommandAll3", "Resize").toLatin1());
setComboText(m_ui->coAllW, cg.readEntry("CommandAllWheel", "Nothing").toLatin1());
}
void KWindowActionsConfig::save()

View File

@ -299,7 +299,7 @@ void ApplicationX11::crashChecking()
}
qCDebug(KWIN_CORE) << "Starting" << cmd << "and exiting";
char buf[1024];
sprintf(buf, "%s &", cmd.toAscii().data());
sprintf(buf, "%s &", cmd.toLatin1().data());
system(buf);
::exit(1);
}
@ -384,7 +384,7 @@ KWIN_EXPORT int kdemain(int argc, char * argv[])
// number. If it had it, it was removed at the "pos" check
envir.sprintf("DISPLAY=%s.%d", display_name.data(), KWin::Application::x11ScreenNumber());
if (putenv(strdup(envir.toAscii().constData()))) {
if (putenv(strdup(envir.toLatin1().constData()))) {
fprintf(stderr, "%s: WARNING: unable to set DISPLAY environment variable\n", argv[0]);
perror("putenv()");
}

View File

@ -948,7 +948,7 @@ void Options::reloadCompositingSettings(bool force)
char c = 0;
const QString s = config.readEntry("GLPreferBufferSwap", QString(Options::defaultGlPreferBufferSwap()));
if (!s.isEmpty())
c = s.at(0).toAscii();
c = s.at(0).toLatin1();
if (c != 'a' && c != 'c' && c != 'p' && c != 'e')
c = 0;
setGlPreferBufferSwap(c);