Compare commits

...

6 commits

Author SHA1 Message Date
pajlada
7f935665f9
refactor: Remove the NullablePtr class (#5091) 2024-01-15 21:30:34 +00:00
pajlada
47a14c9041
clang-tidy: Make protected & private suffix underscore optional (#5090) 2024-01-15 21:31:40 +01:00
pajlada
93e2bc18fa
refactor: move Network files from src/common/ to src/common/network/ (#5089) 2024-01-15 21:28:44 +01:00
dependabot[bot]
ad69755bbb
chore(deps): bump lib/signals from ca452a8 to d067706 (#5084)
Bumps [lib/signals](https://github.com/pajlada/signals) from `ca452a8` to `d067706`.
- [Commits](ca452a811d...d06770649a)

---
updated-dependencies:
- dependency-name: lib/signals
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
2024-01-15 16:53:35 +00:00
dependabot[bot]
547ff372e1
chore(deps): bump lib/serialize from bbf0a34 to 17946d6 (#5086)
Bumps [lib/serialize](https://github.com/pajlada/serialize) from `bbf0a34` to `17946d6`.
- [Commits](bbf0a34260...17946d65a4)

---
updated-dependencies:
- dependency-name: lib/serialize
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
2024-01-15 16:16:02 +00:00
dependabot[bot]
4681fb1117
chore(deps): bump ZedThree/clang-tidy-review from 0.15.0 to 0.15.1 (#5087)
Bumps [ZedThree/clang-tidy-review](https://github.com/zedthree/clang-tidy-review) from 0.15.0 to 0.15.1.
- [Release notes](https://github.com/zedthree/clang-tidy-review/releases)
- [Changelog](https://github.com/ZedThree/clang-tidy-review/blob/master/CHANGELOG.md)
- [Commits](https://github.com/zedthree/clang-tidy-review/compare/v0.15.0...v0.15.1)

---
updated-dependencies:
- dependency-name: ZedThree/clang-tidy-review
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
2024-01-15 15:42:46 +00:00
49 changed files with 84 additions and 159 deletions

View file

@ -45,11 +45,9 @@ CheckOptions:
- key: readability-identifier-naming.MemberCase
value: camelBack
- key: readability-identifier-naming.PrivateMemberIgnoredRegexp
value: .*
- key: readability-identifier-naming.PrivateMemberSuffix
value: _
- key: readability-identifier-naming.ProtectedMemberSuffix
value: _
value: ^.*_$
- key: readability-identifier-naming.ProtectedMemberIgnoredRegexp
value: ^.*_$
- key: readability-identifier-naming.UnionCase
value: CamelCase
- key: readability-identifier-naming.GlobalConstantCase

View file

@ -119,7 +119,7 @@ jobs:
- name: clang-tidy review
timeout-minutes: 20
uses: ZedThree/clang-tidy-review@v0.15.0
uses: ZedThree/clang-tidy-review@v0.15.1
with:
build_dir: build-clang-tidy
config_file: ".clang-tidy"
@ -145,4 +145,4 @@ jobs:
libbenchmark-dev
- name: clang-tidy-review upload
uses: ZedThree/clang-tidy-review/upload@v0.15.0
uses: ZedThree/clang-tidy-review/upload@v0.15.1

View file

@ -14,6 +14,6 @@ jobs:
if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- uses: ZedThree/clang-tidy-review/post@v0.15.0
- uses: ZedThree/clang-tidy-review/post@v0.15.1
with:
lgtm_comment_body: ""

View file

@ -105,10 +105,11 @@
- Dev: Move `clang-tidy` checker to its own CI job. (#4996)
- Dev: Refactored the Image Uploader feature. (#4971)
- Dev: Refactored the SplitOverlay code. (#5082)
- Dev: Moved the Network files to their own folder. (#5089)
- Dev: Fixed deadlock and use-after-free in tests. (#4981)
- Dev: Moved all `.clang-format` files to the root directory. (#5037)
- Dev: Load less message history upon reconnects. (#5001, #5018)
- Dev: Load less message history upon reconnects. (#5001)
- Dev: Removed the `NullablePtr` class. (#5091)
- Dev: BREAKING: Replace custom `import()` with normal Lua `require()`. (#5014)
- Dev: Fixed most compiler warnings. (#5028)
- Dev: Added the ability to show `ChannelView`s without a `Split`. (#4747)

@ -1 +1 @@
Subproject commit bbf0a34260a3e8d6e6c48be57653840ac3fa8c30
Subproject commit 17946d65a41a72b447da37df6e314cded9650c32

@ -1 +1 @@
Subproject commit ca452a811d684db42f93d6352301406754d0c536
Subproject commit d06770649a7e83db780865d09c313a876bf0f4eb

View file

@ -33,16 +33,6 @@ set(SOURCE_FILES
common/Literals.hpp
common/Modes.cpp
common/Modes.hpp
common/NetworkCommon.cpp
common/NetworkCommon.hpp
common/NetworkManager.cpp
common/NetworkManager.hpp
common/NetworkPrivate.cpp
common/NetworkPrivate.hpp
common/NetworkRequest.cpp
common/NetworkRequest.hpp
common/NetworkResult.cpp
common/NetworkResult.hpp
common/QLogging.cpp
common/QLogging.hpp
common/WindowDescriptors.cpp
@ -50,8 +40,18 @@ set(SOURCE_FILES
common/enums/MessageOverflow.hpp
common/network/NetworkTask.hpp
common/network/NetworkCommon.cpp
common/network/NetworkCommon.hpp
common/network/NetworkManager.cpp
common/network/NetworkManager.hpp
common/network/NetworkPrivate.cpp
common/network/NetworkPrivate.hpp
common/network/NetworkRequest.cpp
common/network/NetworkRequest.hpp
common/network/NetworkResult.cpp
common/network/NetworkResult.hpp
common/network/NetworkTask.cpp
common/network/NetworkTask.hpp
controllers/accounts/Account.cpp
controllers/accounts/Account.hpp

View file

@ -3,7 +3,7 @@
#include "Application.hpp"
#include "common/Args.hpp"
#include "common/Modes.hpp"
#include "common/NetworkManager.hpp"
#include "common/network/NetworkManager.hpp"
#include "common/QLogging.hpp"
#include "singletons/CrashHandler.hpp"
#include "singletons/Paths.hpp"

View file

@ -1,73 +0,0 @@
#pragma once
#include <type_traits>
namespace chatterino {
template <typename T>
class NullablePtr
{
public:
NullablePtr()
: element_(nullptr)
{
}
NullablePtr(T *element)
: element_(element)
{
}
T *operator->() const
{
assert(this->hasElement());
return element_;
}
typename std::add_lvalue_reference<T>::type operator*() const
{
assert(this->hasElement());
return *element_;
}
T *get() const
{
assert(this->hasElement());
return this->element_;
}
bool isNull() const
{
return this->element_ == nullptr;
}
bool hasElement() const
{
return this->element_ != nullptr;
}
operator bool() const
{
return this->hasElement();
}
bool operator!() const
{
return !this->hasElement();
}
template <typename X = T,
typename = std::enable_if_t<!std::is_const<X>::value>>
operator NullablePtr<const T>() const
{
return NullablePtr<const T>(this->element_);
}
private:
T *element_;
};
} // namespace chatterino

View file

@ -1,4 +1,4 @@
#include "common/NetworkCommon.hpp"
#include "common/network/NetworkCommon.hpp"
#include <QStringList>

View file

@ -1,4 +1,4 @@
#include "common/NetworkManager.hpp"
#include "common/network/NetworkManager.hpp"
#include <QNetworkAccessManager>

View file

@ -1,8 +1,8 @@
#include "common/NetworkPrivate.hpp"
#include "common/network/NetworkPrivate.hpp"
#include "common/network/NetworkManager.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/network/NetworkTask.hpp"
#include "common/NetworkManager.hpp"
#include "common/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "singletons/Paths.hpp"
#include "util/AbandonObject.hpp"

View file

@ -1,7 +1,7 @@
#pragma once
#include "common/Common.hpp"
#include "common/NetworkCommon.hpp"
#include "common/network/NetworkCommon.hpp"
#include <QHttpMultiPart>
#include <QNetworkRequest>

View file

@ -1,6 +1,6 @@
#include "common/NetworkRequest.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/NetworkPrivate.hpp"
#include "common/network/NetworkPrivate.hpp"
#include "common/QLogging.hpp"
#include "common/Version.hpp"

View file

@ -1,6 +1,6 @@
#pragma once
#include "common/NetworkCommon.hpp"
#include "common/network/NetworkCommon.hpp"
#include <QHttpMultiPart>

View file

@ -1,4 +1,4 @@
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"

View file

@ -1,8 +1,8 @@
#include "common/network/NetworkTask.hpp"
#include "common/NetworkManager.hpp"
#include "common/NetworkPrivate.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkManager.hpp"
#include "common/network/NetworkPrivate.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "singletons/Paths.hpp"
#include "util/AbandonObject.hpp"

View file

@ -2,7 +2,7 @@
#include "Application.hpp"
#include "common/Channel.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandContext.hpp"
#include "messages/Message.hpp"

View file

@ -1,7 +1,7 @@
#include "controllers/commands/builtin/twitch/UpdateChannel.hpp"
#include "common/Channel.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include "controllers/commands/CommandContext.hpp"
#include "messages/MessageBuilder.hpp"
#include "providers/twitch/api/Helix.hpp"

View file

@ -2,8 +2,8 @@
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "debug/AssertInGuiThread.hpp"
#include "debug/Benchmark.hpp"

View file

@ -1,6 +1,6 @@
#include "IvrApi.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include <QUrlQuery>

View file

@ -1,6 +1,6 @@
#pragma once
#include "common/NetworkRequest.hpp"
#include "common/network/NetworkRequest.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include <QJsonArray>

View file

@ -1,8 +1,8 @@
#include "providers/LinkResolver.hpp"
#include "common/Env.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "messages/Image.hpp"
#include "messages/Link.hpp"
#include "singletons/Settings.hpp"

View file

@ -1,7 +1,7 @@
#include "providers/bttv/BttvEmotes.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/Outcome.hpp"
#include "common/QLogging.hpp"
#include "messages/Emote.hpp"

View file

@ -1,7 +1,7 @@
#include "ChatterinoBadges.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "messages/Emote.hpp"
#include <QJsonArray>

View file

@ -1,7 +1,7 @@
#include "FfzBadges.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "messages/Emote.hpp"
#include "providers/ffz/FfzUtil.hpp"

View file

@ -1,7 +1,7 @@
#include "providers/ffz/FfzEmotes.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "messages/Emote.hpp"
#include "messages/Image.hpp"

View file

@ -1,7 +1,7 @@
#include "providers/recentmessages/Api.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "providers/recentmessages/Impl.hpp"
#include "providers/twitch/TwitchMessageBuilder.hpp"

View file

@ -1,8 +1,8 @@
#include "providers/seventv/SeventvAPI.hpp"
#include "common/Literals.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
namespace {

View file

@ -2,7 +2,7 @@
#include "Application.hpp"
#include "common/Literals.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "messages/Emote.hpp"
#include "messages/Image.hpp"

View file

@ -3,7 +3,7 @@
#include "Application.hpp"
#include "common/Channel.hpp"
#include "common/Env.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "debug/AssertInGuiThread.hpp"

View file

@ -1,7 +1,7 @@
#include "TwitchBadges.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "messages/Emote.hpp"
#include "messages/Image.hpp"

View file

@ -3,8 +3,8 @@
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/Env.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/notifications/NotificationController.hpp"

View file

@ -1,8 +1,8 @@
#include "providers/twitch/api/Helix.hpp"
#include "common/Literals.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "util/CancellationToken.hpp"

View file

@ -1,7 +1,7 @@
#pragma once
#include "common/Aliases.hpp"
#include "common/NetworkRequest.hpp"
#include "common/network/NetworkRequest.hpp"
#include "providers/twitch/TwitchEmotes.hpp"
#include "util/Helpers.hpp"
#include "util/QStringHash.hpp"

View file

@ -1,8 +1,8 @@
#include "singletons/ImageUploader.hpp"
#include "common/Env.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "messages/MessageBuilder.hpp"
#include "providers/twitch/TwitchMessageBuilder.hpp"

View file

@ -1,8 +1,8 @@
#include "Updates.hpp"
#include "common/Modes.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "common/Version.hpp"
#include "Settings.hpp"

View file

@ -2,7 +2,7 @@
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "providers/twitch/TwitchAccount.hpp"

View file

@ -2,7 +2,7 @@
#include "Application.hpp"
#include "common/Channel.hpp"
#include "common/NetworkRequest.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandController.hpp"

View file

@ -2,8 +2,8 @@
#include "Application.hpp"
#include "common/Common.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "common/QLogging.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandController.hpp"
@ -911,7 +911,7 @@ void Split::insertTextToInput(const QString &text)
void Split::showChangeChannelPopup(const char *dialogTitle, bool empty,
std::function<void(bool)> callback)
{
if (this->selectChannelDialog_.hasElement())
if (!this->selectChannelDialog_.isNull())
{
this->selectChannelDialog_->raise();
@ -935,7 +935,6 @@ void Split::showChangeChannelPopup(const char *dialogTitle, bool empty,
}
callback(dialog->hasSeletedChannel());
this->selectChannelDialog_ = nullptr;
});
this->selectChannelDialog_ = dialog;
}

View file

@ -2,13 +2,13 @@
#include "common/Aliases.hpp"
#include "common/Channel.hpp"
#include "common/NullablePtr.hpp"
#include "widgets/BaseWidget.hpp"
#include "widgets/splits/SplitCommon.hpp"
#include <boost/signals2.hpp>
#include <pajlada/signals/signalholder.hpp>
#include <QFont>
#include <QPointer>
#include <QShortcut>
#include <QVBoxLayout>
#include <QWidget>
@ -155,7 +155,7 @@ private:
SplitInput *const input_;
SplitOverlay *const overlay_;
NullablePtr<SelectChannelDialog> selectChannelDialog_;
QPointer<SelectChannelDialog> selectChannelDialog_;
pajlada::Signals::Connection channelIDChangedConnection_;
pajlada::Signals::Connection usermodeChangedConnection_;

View file

@ -1,9 +1,9 @@
#include "widgets/splits/SplitHeader.hpp"
#include "Application.hpp"
#include "common/NetworkCommon.hpp"
#include "common/NetworkRequest.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkCommon.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/network/NetworkResult.hpp"
#include "controllers/accounts/AccountController.hpp"
#include "controllers/commands/CommandController.hpp"
#include "controllers/hotkeys/Hotkey.hpp"

View file

@ -1,4 +1,4 @@
#include "common/NetworkCommon.hpp"
#include "common/network/NetworkCommon.hpp"
#include <gtest/gtest.h>

View file

@ -1,7 +1,7 @@
#include "common/NetworkRequest.hpp"
#include "common/network/NetworkRequest.hpp"
#include "common/NetworkManager.hpp"
#include "common/NetworkResult.hpp"
#include "common/network/NetworkManager.hpp"
#include "common/network/NetworkResult.hpp"
#include <gtest/gtest.h>
#include <QCoreApplication>

View file

@ -1,4 +1,4 @@
#include "common/NetworkResult.hpp"
#include "common/network/NetworkResult.hpp"
#include <gtest/gtest.h>

View file

@ -1,4 +1,4 @@
#include "common/NetworkManager.hpp"
#include "common/network/NetworkManager.hpp"
#include "singletons/Resources.hpp"
#include "singletons/Settings.hpp"