Remove unused code for Tagged Users (#3208)

Co-authored-by: Paweł <zneix@zneix.eu>
Co-authored-by: pajlada <rasmus.karlsson@pajlada.com>
This commit is contained in:
Mm2PL 2021-09-04 13:11:20 +02:00 committed by GitHub
parent 5cd20bbb5a
commit d99fafaa99
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
9 changed files with 0 additions and 193 deletions

View file

@ -167,8 +167,6 @@ SOURCES += \
src/controllers/notifications/NotificationController.cpp \
src/controllers/notifications/NotificationModel.cpp \
src/controllers/pings/MutedChannelModel.cpp \
src/controllers/taggedusers/TaggedUser.cpp \
src/controllers/taggedusers/TaggedUsersModel.cpp \
src/debug/Benchmark.cpp \
src/main.cpp \
src/messages/Emote.cpp \
@ -400,8 +398,6 @@ HEADERS += \
src/controllers/notifications/NotificationController.hpp \
src/controllers/notifications/NotificationModel.hpp \
src/controllers/pings/MutedChannelModel.hpp \
src/controllers/taggedusers/TaggedUser.hpp \
src/controllers/taggedusers/TaggedUsersModel.hpp \
src/debug/AssertInGuiThread.hpp \
src/debug/Benchmark.hpp \
src/ForwardDecl.hpp \

View file

@ -110,11 +110,6 @@ set(SOURCE_FILES
controllers/pings/MutedChannelModel.cpp
controllers/pings/MutedChannelModel.hpp
controllers/taggedusers/TaggedUser.cpp
controllers/taggedusers/TaggedUser.hpp
controllers/taggedusers/TaggedUsersModel.cpp
controllers/taggedusers/TaggedUsersModel.hpp
debug/Benchmark.cpp
debug/Benchmark.hpp

View file

@ -1,36 +0,0 @@
#include "TaggedUser.hpp"
#include <tuple>
namespace chatterino {
TaggedUser::TaggedUser(ProviderId provider, const QString &name,
const QString &id)
: providerId_(provider)
, name_(name)
, id_(id)
{
}
bool TaggedUser::operator<(const TaggedUser &other) const
{
return std::tie(this->providerId_, this->name_, this->id_) <
std::tie(other.providerId_, other.name_, other.id_);
}
ProviderId TaggedUser::getProviderId() const
{
return this->providerId_;
}
QString TaggedUser::getName() const
{
return this->name_;
}
QString TaggedUser::getId() const
{
return this->id_;
}
} // namespace chatterino

View file

@ -1,26 +0,0 @@
#pragma once
#include "common/ProviderId.hpp"
#include <QString>
namespace chatterino {
class TaggedUser
{
public:
TaggedUser(ProviderId providerId, const QString &name, const QString &id);
bool operator<(const TaggedUser &other) const;
ProviderId getProviderId() const;
QString getName() const;
QString getId() const;
private:
ProviderId providerId_;
QString name_;
QString id_;
};
} // namespace chatterino

View file

@ -1,67 +0,0 @@
#include "TaggedUsersModel.hpp"
#include "Application.hpp"
#include "util/StandardItemHelper.hpp"
namespace chatterino {
// commandmodel
TaggedUsersModel::TaggedUsersModel(QObject *parent)
: SignalVectorModel<TaggedUser>(1, parent)
{
}
// turn a vector item into a model row
TaggedUser TaggedUsersModel::getItemFromRow(std::vector<QStandardItem *> &row,
const TaggedUser &original)
{
return original;
}
// turns a row in the model into a vector item
void TaggedUsersModel::getRowFromItem(const TaggedUser &item,
std::vector<QStandardItem *> &row)
{
setStringItem(row[0], item.getName());
}
void TaggedUsersModel::afterInit()
{
// std::vector<QStandardItem *> row = this->createRow();
// setBoolItem(row[0],
// getSettings()->enableHighlightsSelf.getValue(), true, false);
// row[0]->setData("Your username (automatic)", Qt::DisplayRole);
// setBoolItem(row[1],
// getSettings()->enableHighlightTaskbar.getValue(), true, false);
// setBoolItem(row[2],
// getSettings()->enableHighlightSound.getValue(), true, false);
// row[3]->setFlags(0); this->insertCustomRow(row, 0);
}
// void TaggedUserModel::customRowSetData(const std::vector<QStandardItem *>
// &row, int column,
// const QVariant &value, int role)
//{
// switch (column) {
// case 0: {
// if (role == Qt::CheckStateRole) {
// getSettings()->enableHighlightsSelf.setValue(value.toBool());
// }
// } break;
// case 1: {
// if (role == Qt::CheckStateRole) {
// getSettings()->enableHighlightTaskbar.setValue(value.toBool());
// }
// } break;
// case 2: {
// if (role == Qt::CheckStateRole) {
// getSettings()->enableHighlightSound.setValue(value.toBool());
// }
// } break;
// case 3: {
// // empty element
// } break;
// }
//}
} // namespace chatterino

View file

@ -1,33 +0,0 @@
#pragma once
#include "common/SignalVectorModel.hpp"
#include "controllers/taggedusers/TaggedUser.hpp"
namespace chatterino {
class TaggedUsersController;
class TaggedUsersModel : public SignalVectorModel<TaggedUser>
{
explicit TaggedUsersModel(QObject *parent);
protected:
// turn a vector item into a model row
virtual TaggedUser getItemFromRow(std::vector<QStandardItem *> &row,
const TaggedUser &original) override;
// turns a row in the model into a vector item
virtual void getRowFromItem(const TaggedUser &item,
std::vector<QStandardItem *> &row) override;
virtual void afterInit() override;
// virtual void customRowSetData(const std::vector<QStandardItem *> &row,
// int column,
// const QVariant &value, int role)
// override;
friend class TaggedUsersController;
};
} // namespace chatterino

View file

@ -22,7 +22,6 @@ namespace chatterino {
class HighlightPhrase;
class HighlightBlacklistUser;
class IgnorePhrase;
class TaggedUser;
class FilterRecord;
class Nickname;
@ -40,7 +39,6 @@ public:
SignalVector<QString> &mutedChannels;
SignalVector<FilterRecordPtr> &filterRecords;
SignalVector<Nickname> &nicknames;
//SignalVector<TaggedUser> &taggedUsers;
SignalVector<ModerationAction> &moderationActions;
bool isHighlightedUser(const QString &username);

View file

@ -56,11 +56,6 @@ public:
private:
void actuallyUpdate(double hue, double multiplier) override;
void fillLookupTableValues(double (&array)[360], double from, double to,
double fromValue, double toValue);
double middleLookupTable_[360] = {};
double minLookupTable_[360] = {};
pajlada::Signals::NoArgSignal repaintVisibleChatWidgets_;

View file

@ -2,7 +2,6 @@
#include "Application.hpp"
#include "controllers/moderationactions/ModerationActionModel.hpp"
#include "controllers/taggedusers/TaggedUsersModel.hpp"
#include "singletons/Logging.hpp"
#include "singletons/Paths.hpp"
#include "util/Helpers.hpp"
@ -191,20 +190,6 @@ ModerationPage::ModerationPage()
getSettings()->moderationActions.append(
ModerationAction("/timeout {user} 300"));
});
/*auto taggedUsers = tabs.appendTab(new QVBoxLayout, "Tagged users");
{
EditableModelView *view = *taggedUsers.emplace<EditableModelView>(
app->taggedUsers->createModel(nullptr));
view->setTitles({"Name"});
view->getTableView()->horizontalHeader()->setStretchLastSection(true);
view->addButtonPressed.connect([] {
getApp()->taggedUsers->users.appendItem(
TaggedUser(ProviderId::Twitch, "example", "xD"));
});
}*/
}
this->addModerationButtonSettings(tabs);