removed namespaces

This commit is contained in:
fourtf
2018-06-26 17:06:17 +02:00
parent 2df0566492
commit 54eb07e116
132 changed files with 805 additions and 823 deletions
+9 -9
View File
@@ -56,9 +56,9 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
ChannelPtr emoteChannel(new Channel("", Channel::None));
auto addEmotes = [&](util::EmoteMap &map, const QString &title, const QString &emoteDesc) {
auto addEmotes = [&](EmoteMap &map, const QString &title, const QString &emoteDesc) {
// TITLE
messages::MessageBuilder builder1;
chatterino::MessageBuilder builder1;
builder1.append(new TextElement(title, MessageElement::Text));
@@ -66,11 +66,11 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
emoteChannel->addMessage(builder1.getMessage());
// EMOTES
messages::MessageBuilder builder2;
chatterino::MessageBuilder builder2;
builder2.getMessage()->flags |= Message::Centered;
builder2.getMessage()->flags |= Message::DisableCompactEmotes;
map.each([&](const QString &key, const util::EmoteData &value) {
map.each([&](const QString &key, const EmoteData &value) {
builder2.append((new EmoteElement(value, MessageElement::Flags::AlwaysShow))
->setLink(Link(Link::InsertText, key)));
});
@@ -86,7 +86,7 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
// fix this pile of garbage
for (const auto &set : app->emotes->twitch.emotes[userID].emoteSets) {
// TITLE
messages::MessageBuilder builder1;
chatterino::MessageBuilder builder1;
QString setText;
if (set->text.isEmpty()) {
@@ -105,12 +105,12 @@ void EmotePopup::loadChannel(ChannelPtr _channel)
emoteChannel->addMessage(builder1.getMessage());
// EMOTES
messages::MessageBuilder builder2;
chatterino::MessageBuilder builder2;
builder2.getMessage()->flags |= Message::Centered;
builder2.getMessage()->flags |= Message::DisableCompactEmotes;
for (const auto &emote : set->emotes) {
[&](const QString &key, const util::EmoteData &value) {
[&](const QString &key, const EmoteData &value) {
builder2.append((new EmoteElement(value, MessageElement::Flags::AlwaysShow))
->setLink(Link(Link::InsertText, key)));
}(emote.code, app->emotes->twitch.getEmoteById(emote.id, emote.code));
@@ -137,14 +137,14 @@ void EmotePopup::loadEmojis()
ChannelPtr emojiChannel(new Channel("", Channel::None));
// title
messages::MessageBuilder builder1;
chatterino::MessageBuilder builder1;
builder1.append(new TextElement("emojis", MessageElement::Text));
builder1.getMessage()->flags |= Message::Centered;
emojiChannel->addMessage(builder1.getMessage());
// emojis
messages::MessageBuilder builder;
chatterino::MessageBuilder builder;
builder.getMessage()->flags |= Message::Centered;
builder.getMessage()->flags |= Message::DisableCompactEmotes;
+1 -1
View File
@@ -16,7 +16,7 @@ public:
void loadChannel(ChannelPtr channel);
void loadEmojis();
pajlada::Signals::Signal<messages::Link> linkClicked;
pajlada::Signals::Signal<chatterino::Link> linkClicked;
private:
ChannelView *viewEmotes;
+13 -13
View File
@@ -16,9 +16,9 @@ LastRunCrashDialog::LastRunCrashDialog()
this->setWindowFlag(Qt::WindowContextHelpButtonHint, false);
this->setWindowTitle("Chatterino");
auto &updateManager = singletons::UpdateManager::getInstance();
auto &updateManager = chatterino::UpdateManager::getInstance();
auto layout = util::LayoutCreator<LastRunCrashDialog>(this).setLayoutType<QVBoxLayout>();
auto layout = LayoutCreator<LastRunCrashDialog>(this).setLayoutType<QVBoxLayout>();
layout.emplace<QLabel>(
"The application wasn't terminated properly the last time it was executed.");
@@ -31,7 +31,7 @@ LastRunCrashDialog::LastRunCrashDialog()
// auto *installUpdateButton = buttons->addButton("Install Update",
// QDialogButtonBox::NoRole); installUpdateButton->setEnabled(false);
// QObject::connect(installUpdateButton, &QPushButton::clicked, [this, update]() mutable {
// auto &updateManager = singletons::UpdateManager::getInstance();
// auto &updateManager = chatterino::UpdateManager::getInstance();
// updateManager.installUpdates();
// this->setEnabled(false);
@@ -43,36 +43,36 @@ LastRunCrashDialog::LastRunCrashDialog()
// Updates
// auto updateUpdateLabel = [update]() mutable {
// auto &updateManager = singletons::UpdateManager::getInstance();
// auto &updateManager = chatterino::UpdateManager::getInstance();
// switch (updateManager.getStatus()) {
// case singletons::UpdateManager::None: {
// case chatterino::UpdateManager::None: {
// update->setText("Not checking for updates.");
// } break;
// case singletons::UpdateManager::Searching: {
// case chatterino::UpdateManager::Searching: {
// update->setText("Checking for updates...");
// } break;
// case singletons::UpdateManager::UpdateAvailable: {
// case chatterino::UpdateManager::UpdateAvailable: {
// update->setText("Update available.");
// } break;
// case singletons::UpdateManager::NoUpdateAvailable: {
// case chatterino::UpdateManager::NoUpdateAvailable: {
// update->setText("No update abailable.");
// } break;
// case singletons::UpdateManager::SearchFailed: {
// case chatterino::UpdateManager::SearchFailed: {
// update->setText("Error while searching for update.\nEither the update service
// is "
// "temporarily down or there is an issue with your
// installation.");
// } break;
// case singletons::UpdateManager::Downloading: {
// case chatterino::UpdateManager::Downloading: {
// update->setText(
// "Downloading the update. Chatterino will close once the download is
// done.");
// } break;
// case singletons::UpdateManager::DownloadFailed: {
// case chatterino::UpdateManager::DownloadFailed: {
// update->setText("Download failed.");
// } break;
// case singletons::UpdateManager::WriteFileFailed: {
// case chatterino::UpdateManager::WriteFileFailed: {
// update->setText("Writing the update file to the hard drive failed.");
// } break;
// }
@@ -80,7 +80,7 @@ LastRunCrashDialog::LastRunCrashDialog()
// updateUpdateLabel();
// this->managedConnect(updateManager.statusUpdated, [updateUpdateLabel](auto) mutable {
// util::postToThread([updateUpdateLabel]() mutable { updateUpdateLabel(); });
// postToThread([updateUpdateLabel]() mutable { updateUpdateLabel(); });
// });
}
+1 -1
View File
@@ -172,7 +172,7 @@ AdvancedLoginWidget::AdvancedLoginWidget()
this->ui.buttonLowerRow.layout.addWidget(&this->ui.buttonLowerRow.fillInUserIDButton);
connect(&this->ui.buttonLowerRow.fillInUserIDButton, &QPushButton::clicked, [=]() {
util::twitch::getUserID(this->ui.usernameInput.text(), this, [=](const QString &userID) {
getUserID(this->ui.usernameInput.text(), this, [=](const QString &userID) {
this->ui.userIDInput.setText(userID); //
});
});
+1 -1
View File
@@ -38,7 +38,7 @@ void NotificationPopup::updatePosition()
}
}
void NotificationPopup::addMessage(messages::MessagePtr msg)
void NotificationPopup::addMessage(chatterino::MessagePtr msg)
{
this->channel->addMessage(msg);
+1 -1
View File
@@ -14,7 +14,7 @@ public:
enum Location { TopLeft, TopRight, BottomLeft, BottomRight };
NotificationPopup();
void addMessage(messages::MessagePtr msg);
void addMessage(chatterino::MessagePtr msg);
void updatePosition();
private:
+3 -3
View File
@@ -43,9 +43,9 @@ void QualityPopup::okButtonClicked()
QString channelURL = "twitch.tv/" + this->channelName;
try {
streamlink::OpenStreamlink(channelURL, this->ui_.selector.currentText());
} catch (const streamlink::Exception &ex) {
debug::Log("Exception caught trying to open streamlink: {}", ex.what());
OpenStreamlink(channelURL, this->ui_.selector.currentText());
} catch (const Exception &ex) {
Log("Exception caught trying to open streamlink: {}", ex.what());
}
this->close();
+3 -3
View File
@@ -23,13 +23,13 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
this->tabFilter.dialog = this;
util::LayoutCreator<QWidget> layoutWidget(this->getLayoutContainer());
LayoutCreator<QWidget> layoutWidget(this->getLayoutContainer());
auto layout = layoutWidget.setLayoutType<QVBoxLayout>().withoutMargin();
auto notebook = layout.emplace<Notebook>(this).assign(&this->ui_.notebook);
// twitch
{
util::LayoutCreator<QWidget> obj(new QWidget());
LayoutCreator<QWidget> obj(new QWidget());
auto vbox = obj.setLayoutType<QVBoxLayout>();
// channel_btn
@@ -106,7 +106,7 @@ SelectChannelDialog::SelectChannelDialog(QWidget *parent)
// irc
/*{
util::LayoutCreator<QWidget> obj(new QWidget());
LayoutCreator<QWidget> obj(new QWidget());
auto vbox = obj.setLayoutType<QVBoxLayout>();
auto edit = vbox.emplace<QLabel>("not implemented");
+16 -16
View File
@@ -36,7 +36,7 @@ SettingsDialog::SettingsDialog()
void SettingsDialog::initUi()
{
util::LayoutCreator<SettingsDialog> layoutCreator(this);
LayoutCreator<SettingsDialog> layoutCreator(this);
// tab pages
layoutCreator.emplace<QWidget>()
@@ -76,34 +76,34 @@ void SettingsDialog::addTabs()
{
this->ui_.tabContainer->setSpacing(0);
this->addTab(new settingspages::AccountsPage);
this->addTab(new AccountsPage);
this->ui_.tabContainer->addSpacing(16);
this->addTab(new settingspages::AppearancePage);
this->addTab(new settingspages::BehaviourPage);
this->addTab(new AppearancePage);
this->addTab(new BehaviourPage);
this->ui_.tabContainer->addSpacing(16);
this->addTab(new settingspages::CommandPage);
// this->addTab(new settingspages::EmotesPage);
this->addTab(new settingspages::HighlightingPage);
this->addTab(new settingspages::IgnoreUsersPage);
this->addTab(new CommandPage);
// this->addTab(new EmotesPage);
this->addTab(new HighlightingPage);
this->addTab(new IgnoreUsersPage);
this->ui_.tabContainer->addSpacing(16);
this->addTab(new settingspages::KeyboardSettingsPage);
// this->addTab(new settingspages::LogsPage);
this->addTab(new settingspages::ModerationPage);
// this->addTab(new settingspages::SpecialChannelsPage);
this->addTab(new settingspages::BrowserExtensionPage);
this->addTab(new settingspages::ExternalToolsPage);
this->addTab(new KeyboardSettingsPage);
// this->addTab(new LogsPage);
this->addTab(new ModerationPage);
// this->addTab(new SpecialChannelsPage);
this->addTab(new BrowserExtensionPage);
this->addTab(new ExternalToolsPage);
this->ui_.tabContainer->addStretch(1);
this->addTab(new settingspages::AboutPage, Qt::AlignBottom);
this->addTab(new AboutPage, Qt::AlignBottom);
}
void SettingsDialog::addTab(settingspages::SettingsPage *page, Qt::Alignment alignment)
void SettingsDialog::addTab(SettingsPage *page, Qt::Alignment alignment)
{
auto tab = new SettingsDialogTab(this, page, page->getIconResource());
+1 -1
View File
@@ -47,7 +47,7 @@ private:
void initUi();
void addTabs();
void addTab(settingspages::SettingsPage *page, Qt::Alignment alignment = Qt::AlignTop);
void addTab(SettingsPage *page, Qt::Alignment alignment = Qt::AlignTop);
void select(SettingsDialogTab *tab);
+10 -10
View File
@@ -33,7 +33,7 @@ UserInfoPopup::UserInfoPopup()
auto app = getApp();
auto layout = util::LayoutCreator<UserInfoPopup>(this).setLayoutType<QVBoxLayout>();
auto layout = LayoutCreator<UserInfoPopup>(this).setLayoutType<QVBoxLayout>();
// first line
auto head = layout.emplace<QHBoxLayout>().withoutMargin();
@@ -86,8 +86,8 @@ UserInfoPopup::UserInfoPopup()
// userstate
this->userStateChanged.connect([this, mod, unmod]() mutable {
providers::twitch::TwitchChannel *twitchChannel =
dynamic_cast<providers::twitch::TwitchChannel *>(this->channel_.get());
TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->channel_.get());
if (twitchChannel) {
qDebug() << this->userName_;
@@ -111,8 +111,8 @@ UserInfoPopup::UserInfoPopup()
auto timeout = moderation.emplace<TimeoutWidget>();
this->userStateChanged.connect([this, lineMod, timeout]() mutable {
providers::twitch::TwitchChannel *twitchChannel =
dynamic_cast<providers::twitch::TwitchChannel *>(this->channel_.get());
TwitchChannel *twitchChannel =
dynamic_cast<TwitchChannel *>(this->channel_.get());
if (twitchChannel) {
lineMod->setVisible(twitchChannel->hasModRights());
@@ -171,10 +171,10 @@ void UserInfoPopup::installEvents()
this->ui_.follow->setEnabled(false);
if (this->ui_.follow->isChecked()) {
util::twitch::put(requestUrl,
put(requestUrl,
[this](QJsonObject) { this->ui_.follow->setEnabled(true); });
} else {
util::twitch::sendDelete(requestUrl, [this] { this->ui_.follow->setEnabled(true); });
sendDelete(requestUrl, [this] { this->ui_.follow->setEnabled(true); });
}
});
@@ -234,13 +234,13 @@ void UserInfoPopup::updateUserData()
std::weak_ptr<bool> hack = this->hack_;
// get user info
util::twitch::getUserID(this->userName_, this, [this, hack](QString id) {
getUserID(this->userName_, this, [this, hack](QString id) {
auto currentUser = getApp()->accounts->twitch.getCurrent();
this->userId_ = id;
// get channel info
util::twitch::get(
get(
"https://api.twitch.tv/kraken/channels/" + id, this, [this](const QJsonObject &obj) {
this->ui_.followerCountLabel->setText(
TEXT_FOLLOWERS + QString::number(obj.value("followers").toInt()));
@@ -307,7 +307,7 @@ UserInfoPopup::TimeoutWidget::TimeoutWidget()
: BaseWidget(nullptr)
{
auto layout =
util::LayoutCreator<TimeoutWidget>(this).setLayoutType<QHBoxLayout>().withoutMargin();
LayoutCreator<TimeoutWidget>(this).setLayoutType<QHBoxLayout>().withoutMargin();
QColor color1(255, 255, 255, 80);
QColor color2(255, 255, 255, 0);