Skip to content

Commit

Permalink
more qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Mar 14, 2024
1 parent 07beb9b commit 50da149
Show file tree
Hide file tree
Showing 91 changed files with 210 additions and 219 deletions.
2 changes: 1 addition & 1 deletion iris
Submodule iris updated 188 files
1 change: 0 additions & 1 deletion plugins/include/accountinfoaccessinghost.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#include <QtPlugin>

class QString;
class QStringList;

class AccountInfoAccessingHost {
public:
Expand Down
1 change: 0 additions & 1 deletion plugins/include/contactinfoaccessinghost.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
#include <QtPlugin>

class QString;
class QStringList;

class ContactInfoAccessingHost {
public:
Expand Down
2 changes: 1 addition & 1 deletion src/Certificates/CertificateHelpers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ CertificateCollection CertificateHelpers::allCertificates(const QStringList &sto
// Read in old XML format certificates (DEPRECATED)
store.setNameFilters(QStringList("*.xml"));
cert_files = store.entryList();
for (const auto &cf : qAsConst(cert_files)) {
for (const auto &cf : std::as_const(cert_files)) {
qWarning() << "Loading certificate in obsolete XML format: " << store.filePath(cf);
QFile f(store.filePath(cf));
if (!f.open(QIODevice::ReadOnly))
Expand Down
1 change: 0 additions & 1 deletion src/accountregdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ class ProxyManager;
class PsiCon;
class QByteArray;
class QScrollArea;
class QStringList;
class QWidget;
class ServerListQuerier;
class XDataWidget;
Expand Down
8 changes: 4 additions & 4 deletions src/actionlist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ MetaActionList::~MetaActionList()

ActionList *MetaActionList::actionList(const QString &name) const
{
for (ActionList *a : qAsConst(d->lists)) {
for (ActionList *a : std::as_const(d->lists)) {
if (a->name() == name)
return a;
}
Expand All @@ -167,7 +167,7 @@ QList<ActionList *> MetaActionList::actionLists(const unsigned int id) const
if (!(id & (1u << i)))
continue;

for (ActionList *a : qAsConst(d->lists)) {
for (ActionList *a : std::as_const(d->lists)) {
if (uint(a->id()) & (1u << i))
list.append(a);
}
Expand Down Expand Up @@ -195,7 +195,7 @@ QStringList MetaActionList::actionLists() const
{
QStringList names;

for (ActionList *l : qAsConst(d->lists))
for (ActionList *l : std::as_const(d->lists))
names << l->name();

return names;
Expand All @@ -209,7 +209,7 @@ void MetaActionList::addList(ActionList *list)

void MetaActionList::clear()
{
for (ActionList *l : qAsConst(d->lists)) {
for (ActionList *l : std::as_const(d->lists)) {
l->clear();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/activeprofiles_dbus.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ bool ActiveProfiles::setThisProfile(const QString &profile)
void ActiveProfiles::unsetThisProfile()
{
QDBusConnectionInterface *dbusIface = QDBusConnection::sessionBus().interface();
for (const QString &name : qAsConst(d->busNames)) {
for (const QString &name : std::as_const(d->busNames)) {
dbusIface->unregisterService(name);
}
d->busNames.clear();
Expand Down
2 changes: 1 addition & 1 deletion src/activitydlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ void ActivityDlg::setActivity()
QString generalActivityStr = ui_.cb_general_type->currentText();
QString specificActivityStr = ui_.cb_specific_type->currentText();

for (PsiAccount *pa : qAsConst(pa_)) {
for (PsiAccount *pa : std::as_const(pa_)) {
if (generalActivityStr == tr("<unset>")) {
pa->pepManager()->disable(PEP_ACTIVITY_TN, PEP_ACTIVITY_NS, "current");
} else {
Expand Down
1 change: 0 additions & 1 deletion src/adduserdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

class PsiAccount;
class QString;
class QStringList;

namespace XMPP {
class Jid;
Expand Down
2 changes: 1 addition & 1 deletion src/alertmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void AlertManager::dialogUnregister(QWidget *w)
return;
}

for (Item *i : qAsConst(list_)) {
for (Item *i : std::as_const(list_)) {
if (i->widget == w) {
list_.removeAll(i);
delete i;
Expand Down
1 change: 0 additions & 1 deletion src/applicationinfo.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

class QLatin1String;
class QString;
class QStringList;

class ApplicationInfo {
public:
Expand Down
6 changes: 3 additions & 3 deletions src/avcall/jinglertp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,7 @@ class IceStopper : public QObject {
}
left = iceList;

for (XMPP::Ice176 *ice : qAsConst(left)) {
for (XMPP::Ice176 *ice : std::as_const(left)) {
ice->setParent(this);
if (ice->isStopped()) {
ice_stopped(ice);
Expand Down Expand Up @@ -713,7 +713,7 @@ class JingleRtpPrivate : public QObject {
QList<XMPP::Ice176::LocalAddress> localAddrs;
QStringList strList;

for (const auto &h : qAsConst(listenAddrs)) {
for (const auto &h : std::as_const(listenAddrs)) {
localAddrs += XMPP::Ice176::LocalAddress { h };
strList += h.toString();
}
Expand All @@ -726,7 +726,7 @@ class JingleRtpPrivate : public QObject {

if (!strList.isEmpty()) {
printf("Host addresses:\n");
for (const QString &s : qAsConst(strList))
for (const QString &s : std::as_const(strList))
printf(" %s\n", qPrintable(s));
}

Expand Down
4 changes: 2 additions & 2 deletions src/bookmarkmanagedlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void BookmarkManageDlg::closeEditor(QWidget *editor, QAbstractItemDelegate::EndE
if (hint == QAbstractItemDelegate::SubmitModelCache) {
QList<QLineEdit *> lineEdits;
lineEdits << ui_.host << ui_.room << ui_.nickname;
for (QLineEdit *lineEdit : qAsConst(lineEdits)) {
for (QLineEdit *lineEdit : std::as_const(lineEdits)) {
if (lineEdit->text().isEmpty()) {
lineEdit->setFocus();
break;
Expand Down Expand Up @@ -175,7 +175,7 @@ void BookmarkManageDlg::selectionChanged(const QItemSelection &selected, const Q
ui_.autoJoin->setCurrentIndex(current.data(AutoJoinRole).toInt());
QList<QWidget *> editors;
editors << ui_.host << ui_.room << ui_.nickname << ui_.password << ui_.autoJoin;
for (QWidget *w : qAsConst(editors)) {
for (QWidget *w : std::as_const(editors)) {
w->setEnabled(current.isValid());
}

Expand Down
4 changes: 2 additions & 2 deletions src/bookmarkmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ void BookmarkManager::removeConference(const XMPP::Jid &j)
{
if (isAvailable_) {
QList<ConferenceBookmark> confs;
for (const ConferenceBookmark &c : qAsConst(conferences_)) {
for (const ConferenceBookmark &c : std::as_const(conferences_)) {
if (!c.jid().compare(j, false)) {
confs.push_back(c);
}
Expand Down Expand Up @@ -264,7 +264,7 @@ void BookmarkManager::setBookmarks_finished()
QStringList localMucs;
QStringList ignoreMucs;

for (const ConferenceBookmark &cb : qAsConst(conferences_)) {
for (const ConferenceBookmark &cb : std::as_const(conferences_)) {
if (cb.autoJoin() == ConferenceBookmark::OnlyThisComputer) {
localMucs.append(cb.jid().withResource(cb.nick()).full());
}
Expand Down
2 changes: 1 addition & 1 deletion src/bosskey.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ void BossKey::doHide()

void BossKey::doShow()
{
for (QPointer<QWidget> p : qAsConst(hiddenWidgets_)) {
for (QPointer<QWidget> p : std::as_const(hiddenWidgets_)) {
if (p) {
p->show();
}
Expand Down
4 changes: 2 additions & 2 deletions src/chatdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -924,11 +924,11 @@ void ChatDlg::holdMessages(bool hold)
if (!delayedMessages)
delayedMessages = new QList<MessageView>();
} else if (delayedMessages) {
for (const MessageView &mv : qAsConst(*delayedMessages)) {
for (const MessageView &mv : std::as_const(*delayedMessages)) {
if (mv.isSpooled())
displayMessage(mv);
}
for (const MessageView &mv : qAsConst(*delayedMessages)) {
for (const MessageView &mv : std::as_const(*delayedMessages)) {
if (!mv.isSpooled())
displayMessage(mv);
}
Expand Down
4 changes: 2 additions & 2 deletions src/chatsplitter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ void ChatSplitter::setSplitterEnabled(bool enable)
*/
void ChatSplitter::updateLayout()
{
for (QWidget *child : qAsConst(children_))
for (QWidget *child : std::as_const(children_))
child->setParent(this);

delete splitter_;
Expand All @@ -132,7 +132,7 @@ void ChatSplitter::updateLayout()
splitter_->setOrientation(Qt::Vertical);
splitter_->setVisible(splitterEnabled());

for (QWidget *child : qAsConst(children_))
for (QWidget *child : std::as_const(children_))
updateChildLayout(child);

connect(splitter_, SIGNAL(splitterMoved(int, int)), SIGNAL(splitterMoved(int, int)));
Expand Down
2 changes: 1 addition & 1 deletion src/chatviewthemeprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const QStringList ChatViewThemeProvider::themeIds() const
dirs << ApplicationInfo::resourcesDir();

QSet<QString> ret;
for (const QString &dir : qAsConst(dirs)) {
for (const QString &dir : std::as_const(dirs)) {
foreach (QFileInfo tDirInfo,
QDir(dir + "/themes/chatview/").entryInfoList(QDir::AllDirs | QDir::NoDotAndDotDot)) {
QString typeName = tDirInfo.fileName();
Expand Down
2 changes: 1 addition & 1 deletion src/contactlistdragmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ void ContactListModelOperationList::removeAccidentalContactMoveOperations()
QList<PsiContact *> contacts = operations_.keys();
for (PsiContact *psiContact : contacts) {
bool remove = false;
for (const Operation &op : qAsConst(operations_[psiContact])) {
for (const Operation &op : std::as_const(operations_[psiContact])) {
if (psiContact->groups().contains(op.groupTo)) {
remove = true;
break;
Expand Down
4 changes: 2 additions & 2 deletions src/contactlistdragview.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -642,7 +642,7 @@ void ContactListDragView::removeSelection()
return;

// Ask for deleting only some contacts. Exclude private contacts and not in list contacts
for (PsiContact *contact : qAsConst(contacts)) {
for (PsiContact *contact : std::as_const(contacts)) {
QString name = contact->name();
if (name != contact->jid().full()) {
name = QString("%1 (%2)").arg(name, TextUtil::escape(contact->jid().full()));
Expand All @@ -668,7 +668,7 @@ void ContactListDragView::removeSelection()
}

if (doRemove) {
for (PsiContact *contact : qAsConst(contacts)) {
for (PsiContact *contact : std::as_const(contacts)) {
contact->remove();
}
}
Expand Down
6 changes: 3 additions & 3 deletions src/contactlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ void ContactListModel::Private::updateContacts(const QList<PsiContact *> &contac
QModelIndexList indexes2 = q->indexesFor(contact);
indexes += indexes2;

for (const QModelIndex &index : qAsConst(indexes2)) {
for (const QModelIndex &index : std::as_const(indexes2)) {
QModelIndex parent = index.parent();
int row = index.row();
if (ranges.contains(parent)) {
Expand Down Expand Up @@ -372,7 +372,7 @@ void ContactListModel::Private::contactUpdated()
ContactListItem::SpecialGroupType specialGroupType = specialGroupFor(contact);
if (specialGroupType == ContactListItem::SpecialGroupType::NoneSpecialGroupType) {
QStringList groups1;
for (ContactListItem *item : qAsConst(groupItems)) {
for (ContactListItem *item : std::as_const(groupItems)) {
groups1 << item->name();
}
groups1.sort();
Expand Down Expand Up @@ -617,7 +617,7 @@ bool ContactListModel::setData(const QModelIndex &index, const QVariant &data, i
contacts << item->child(i)->contact();
}

for (PsiContact *contact : qAsConst(contacts)) {
for (PsiContact *contact : std::as_const(contacts)) {
QStringList groups = contact->groups();
groups.removeOne(oldName);
groups << name;
Expand Down
2 changes: 1 addition & 1 deletion src/contactmanager/contactmanagerdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ void ContactManagerDlg::executeCurrent()
changeDomain(users);
break;
case 6: // resolve nicks
for (UserListItem *u : qAsConst(users)) {
for (UserListItem *u : std::as_const(users)) {
pa_->resolveContactName(u->jid());
}
break;
Expand Down
6 changes: 3 additions & 3 deletions src/contactmanager/contactmanagermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ bool ContactManagerModel::sortLessThan(UserListItem *u1, UserListItem *u2)
QList<UserListItem *> ContactManagerModel::checkedUsers()
{
QList<UserListItem *> users;
for (UserListItem *u : qAsConst(_userList)) {
for (UserListItem *u : std::as_const(_userList)) {
if (checks.contains(u->jid().full())) {
users.append(u);
}
Expand All @@ -248,7 +248,7 @@ void ContactManagerModel::invertByMatch(int columnIndex, int matchType, const QS
if (matchType == ContactManagerModel::RegexpMatch) {
reg = QRegularExpression(str);
}
for (UserListItem *u : qAsConst(_userList)) {
for (UserListItem *u : std::as_const(_userList)) {
data = userFieldString(u, columnRole);
if ((matchType == ContactManagerModel::SimpleMatch && str == data)
|| (matchType == ContactManagerModel::RegexpMatch && reg.indexIn(data) != -1)) {
Expand All @@ -270,7 +270,7 @@ void ContactManagerModel::client_rosterItemUpdated(const RosterItem &item) { con
void ContactManagerModel::contactUpdated(const Jid &jid)
{
int i = 0;
for (UserListItem *lu : qAsConst(_userList)) {
for (UserListItem *lu : std::as_const(_userList)) {
if (lu->jid() == jid) {
emit dataChanged(index(i, 1), index(i, columnNames.count() - 1));
}
Expand Down
2 changes: 1 addition & 1 deletion src/edbflatfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ quint64 EDBFlatFile::eventsCount(const QString &accId, const XMPP::Jid &jid)

EDBFlatFile::File *EDBFlatFile::findFile(const Jid &j) const
{
for (File *i : qAsConst(d->flist)) {
for (File *i : std::as_const(d->flist)) {
if (i->j.compare(j, false))
return i;
}
Expand Down
4 changes: 2 additions & 2 deletions src/eventdb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ int EDB::op_erase(const QString &accId, const Jid &j) { return erase(accId, j);
void EDB::resultReady(int req, EDBResult r, int begin_row)
{
// deliver
for (EDBHandle *h : qAsConst(d->list)) {
for (EDBHandle *h : std::as_const(d->list)) {
if (h->listeningFor() == req) {
h->d->beginRow_ = begin_row;
h->edb_resultReady(r);
Expand All @@ -203,7 +203,7 @@ void EDB::resultReady(int req, EDBResult r, int begin_row)
void EDB::writeFinished(int req, bool b)
{
// deliver
for (EDBHandle *h : qAsConst(d->list)) {
for (EDBHandle *h : std::as_const(d->list)) {
if (h->listeningFor() == req) {
h->edb_writeFinished(b);
return;
Expand Down
4 changes: 2 additions & 2 deletions src/eventdlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -707,7 +707,7 @@ void EventDlg::init()
QList<IconToolButton *> toolButtons;
toolButtons << d->tb_url << d->tb_info << d->tb_history;
toolButtons << d->tb_icon;
for (IconToolButton *toolButton : qAsConst(toolButtons))
for (IconToolButton *toolButton : std::as_const(toolButtons))
if (toolButton)
toolButton->setFocusPolicy(Qt::NoFocus);

Expand Down Expand Up @@ -1107,7 +1107,7 @@ void EventDlg::to_tryComplete()
if (s.length() < 1 || x != p2)
return;

for (auto name : qAsConst(d->completionList)) {
for (auto name : std::as_const(d->completionList)) {
if (s.length() > name.length())
continue;

Expand Down
1 change: 0 additions & 1 deletion src/eventdlg.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ class PsiCon;
class PsiHttpAuthRequest;
class PsiIcon;
class QDateTime;
class QStringList;

namespace XMPP {
class Jid;
Expand Down
2 changes: 1 addition & 1 deletion src/filesharedlg.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ void FileShareDlg::finish()
QString desc = ui->lineEdit->text();

// append reference main links to description and setup their range
for (auto const &i : qAsConst(readyPublishers)) {
for (auto const &i : std::as_const(readyPublishers)) {
auto r = i->toReference(myJid);
if (r.isValid()) {
auto uri = i->simpleSource();
Expand Down
4 changes: 2 additions & 2 deletions src/filesharingitem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ bool FileSharingItem::initFromCache(FileCacheItem *cache)

QString httpScheme(QString::fromLatin1("http"));
QString xmppScheme(QString::fromLatin1("xmpp")); // jingle ?
for (const auto &u : qAsConst(_uris)) {
for (const auto &u : std::as_const(_uris)) {
QUrl url(u);
auto scheme = url.scheme();
if (scheme.startsWith(httpScheme)) {
Expand Down Expand Up @@ -384,7 +384,7 @@ FileShareDownloader *FileSharingItem::download(bool isRanged, qint64 start, quin
file.setName(_fileName);
if (_flags & SizeKnown)
file.setSize(_fileSize);
for (auto const &h : qAsConst(_sums)) {
for (auto const &h : std::as_const(_sums)) {
file.addHash(h);
}

Expand Down
Loading

0 comments on commit 50da149

Please sign in to comment.