mirror of
https://github.com/TES3MP/TES3MP.git
synced 2025-09-28 07:32:00 -04:00
Merge pull request #2924 from akortunov/warnfix
Avoid more deprecated Qt stuff
This commit is contained in:
commit
f8e3e57755
@ -116,7 +116,7 @@ bool CSMWorld::IdTree::setData (const QModelIndex &index, const QVariant &value,
|
|||||||
Qt::ItemFlags CSMWorld::IdTree::flags (const QModelIndex & index) const
|
Qt::ItemFlags CSMWorld::IdTree::flags (const QModelIndex & index) const
|
||||||
{
|
{
|
||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return 0;
|
return Qt::ItemFlags();
|
||||||
|
|
||||||
if (index.internalId() != 0)
|
if (index.internalId() != 0)
|
||||||
{
|
{
|
||||||
|
@ -127,7 +127,12 @@ bool Wizard::IniSettings::writeFile(const QString &path, QTextStream &stream)
|
|||||||
QString key(fullKey.at(1));
|
QString key(fullKey.at(1));
|
||||||
|
|
||||||
int index = buffer.lastIndexOf(section);
|
int index = buffer.lastIndexOf(section);
|
||||||
if (index != -1) {
|
if (index == -1) {
|
||||||
|
// Add the section to the end of the file, because it's not found
|
||||||
|
buffer.append(QString("\n%1\n").arg(section));
|
||||||
|
index = buffer.lastIndexOf(section);
|
||||||
|
}
|
||||||
|
|
||||||
// Look for the next section
|
// Look for the next section
|
||||||
index = buffer.indexOf(QLatin1Char('['), index + 1);
|
index = buffer.indexOf(QLatin1Char('['), index + 1);
|
||||||
|
|
||||||
@ -141,12 +146,6 @@ bool Wizard::IniSettings::writeFile(const QString &path, QTextStream &stream)
|
|||||||
buffer.insert(index - 1, QString("\n%1=%2").arg(key, i.value().toString()));
|
buffer.insert(index - 1, QString("\n%1=%2").arg(key, i.value().toString()));
|
||||||
mSettings.remove(i.key());
|
mSettings.remove(i.key());
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
|
||||||
// Add the section to the end of the file, because it's not found
|
|
||||||
buffer.append(QString("\n%1\n").arg(section));
|
|
||||||
i.previous();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Now we reopen the file, this time we write
|
// Now we reopen the file, this time we write
|
||||||
|
Loading…
x
Reference in New Issue
Block a user