all: fix failing lints

This commit is contained in:
outfoxxed 2024-06-18 20:46:58 -07:00
parent 8ec245ac66
commit 3033cba52d
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
4 changed files with 83 additions and 89 deletions

View file

@ -4,10 +4,8 @@
#include <qdebug.h>
#include <qdir.h>
#include <qfileinfo.h>
#include <qfilesystemwatcher.h>
#include <qhash.h>
#include <qlist.h>
#include <qlocale.h>
#include <qlogging.h>
#include <qloggingcategory.h>
#include <qnamespace.h>
@ -94,7 +92,7 @@ void DesktopEntry::parseEntry(const QString& text) {
auto groupName = QString();
auto entries = QHash<QString, QPair<Locale, QString>>();
auto finishCategory = [&]() {
auto finishCategory = [this, &groupName, &entries]() {
if (groupName == "Desktop Entry") {
if (entries["Type"].second != "Application") return;
if (entries.contains("Hidden") && entries["Hidden"].second == "true") return;
@ -334,13 +332,13 @@ void DesktopEntryManager::scanPath(const QDir& dir, const QString& prefix) {
qCDebug(logDesktopEntry) << "Found desktop entry" << id << "at" << path;
if (desktopEntries.contains(id)) {
if (this->desktopEntries.contains(id)) {
qCDebug(logDesktopEntry) << "Replacing old entry for" << id;
delete desktopEntries.value(id);
desktopEntries.remove(id);
delete this->desktopEntries.value(id);
this->desktopEntries.remove(id);
}
desktopEntries.insert(id, dentry);
this->desktopEntries.insert(id, dentry);
}
}
}

View file

@ -10,7 +10,9 @@
#include <qguiapplication.h>
#include <qhash.h>
#include <qicon.h>
#include <qlist.h>
#include <qlogging.h>
#include <qnamespace.h>
#include <qqmldebug.h>
#include <qquickwindow.h>
#include <qstandardpaths.h>

View file

@ -7,6 +7,7 @@
#include <qobject.h>
#include <qquickitem.h>
#include <qquickwindow.h>
#include <qtmetamacros.h>
void TransformWatcher::resolveChains(QQuickItem* a, QQuickItem* b, QQuickItem* commonParent) {
if (a == nullptr || b == nullptr) return;

View file

@ -377,9 +377,7 @@ void HyprlandIpc::refreshWorkspaces(bool canCreate) {
if (this->requestingWorkspaces) return;
this->requestingWorkspaces = true;
this->makeRequest(
"j/workspaces",
[this, canCreate](bool success, const QByteArray& resp) {
this->makeRequest("j/workspaces", [this, canCreate](bool success, const QByteArray& resp) {
this->requestingWorkspaces = false;
if (!success) return;
@ -427,8 +425,7 @@ void HyprlandIpc::refreshWorkspaces(bool canCreate) {
this->mWorkspaces.removeObject(workspace);
delete workspace;
}
}
);
});
}
HyprlandMonitor*
@ -489,9 +486,7 @@ void HyprlandIpc::refreshMonitors(bool canCreate) {
if (this->requestingMonitors) return;
this->requestingMonitors = true;
this->makeRequest(
"j/monitors",
[this, canCreate](bool success, const QByteArray& resp) {
this->makeRequest("j/monitors", [this, canCreate](bool success, const QByteArray& resp) {
this->requestingMonitors = false;
if (!success) return;
@ -507,8 +502,7 @@ void HyprlandIpc::refreshMonitors(bool canCreate) {
auto object = entry.toObject().toVariantMap();
auto name = object.value("name").toString();
auto monitorIter =
std::find_if(mList.begin(), mList.end(), [name](const HyprlandMonitor* m) {
auto monitorIter = std::find_if(mList.begin(), mList.end(), [name](const HyprlandMonitor* m) {
return m->name() == name;
});
@ -542,8 +536,7 @@ void HyprlandIpc::refreshMonitors(bool canCreate) {
// see comment in onEvent
monitor->deleteLater();
}
}
);
});
}
} // namespace qs::hyprland::ipc