From bf5e619818c74d010c7b9779f6415555a323c050 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Sat, 16 Dec 2017 16:33:46 +0100 Subject: [PATCH] Remove message-spawning tests --- src/ircmanager.hpp | 3 -- src/widgets/split.cpp | 76 +++---------------------------------------- src/widgets/split.hpp | 3 -- 3 files changed, 4 insertions(+), 78 deletions(-) diff --git a/src/ircmanager.hpp b/src/ircmanager.hpp index 87b8de5da..f0f099d0e 100644 --- a/src/ircmanager.hpp +++ b/src/ircmanager.hpp @@ -58,11 +58,8 @@ private: std::shared_ptr account = nullptr; std::shared_ptr writeConnection = nullptr; - -public: std::shared_ptr readConnection = nullptr; -private: std::mutex connectionMutex; uint32_t connectionGeneration = 0; diff --git a/src/widgets/split.cpp b/src/widgets/split.cpp index 627079653..252c00e80 100644 --- a/src/widgets/split.cpp +++ b/src/widgets/split.cpp @@ -79,15 +79,10 @@ Split::Split(ChannelManager &_channelManager, SplitContainer *parent) ezShortcut(this, "CTRL+R", &Split::doChangeChannel); // xd - //ezShortcut(this, "ALT+SHIFT+RIGHT", &Split::doIncFlexX); - //ezShortcut(this, "ALT+SHIFT+LEFT", &Split::doDecFlexX); - //ezShortcut(this, "ALT+SHIFT+UP", &Split::doIncFlexY); - //ezShortcut(this, "ALT+SHIFT+DOWN", &Split::doDecFlexY); - -#ifndef NDEBUG - // F12: Toggle message spawning - ezShortcut(this, "ALT+Q", &Split::doToggleMessageSpawning); -#endif + // ezShortcut(this, "ALT+SHIFT+RIGHT", &Split::doIncFlexX); + // ezShortcut(this, "ALT+SHIFT+LEFT", &Split::doDecFlexX); + // ezShortcut(this, "ALT+SHIFT+UP", &Split::doIncFlexY); + // ezShortcut(this, "ALT+SHIFT+DOWN", &Split::doDecFlexY); this->channelName.getValueChangedSignal().connect( std::bind(&Split::channelNameUpdated, this, std::placeholders::_1)); @@ -102,10 +97,6 @@ Split::Split(ChannelManager &_channelManager, SplitContainer *parent) this->input.clearSelection(); } }); - - QTimer *timer = new QTimer(this); - connect(timer, &QTimer::timeout, this, &Split::test); - timer->start(1000); } Split::~Split() @@ -462,30 +453,6 @@ void Split::doCopy() QApplication::clipboard()->setText(this->view.getSelectedText()); } -static std::vector usernameVariants = { - "pajlada", // - "trump", // - "Chancu", // - "pajaWoman", // - "fourtf", // - "weneedmoreautisticbots", // - "fourtfbot", // - "pajbot", // - "snusbot", // -}; - -static std::vector messageVariants = { - "hehe", // - "lol pajlada", // - "hehe BANNEDWORD", // - "someone ordered pizza", // - "for ice poseidon", // - "and delivery guy said it is for enza denino", // - "!gn", // - "for my laptop", // - "should I buy a Herschel backpack?", // -}; - template static Iter select_randomly(Iter start, Iter end, RandomGenerator &g) { @@ -502,41 +469,6 @@ static Iter select_randomly(Iter start, Iter end) return select_randomly(start, end, gen); } -void Split::test() -{ - if (this->testEnabled) { - messages::MessageParseArgs args; - - auto message = - new Communi::IrcPrivateMessage(this->channelManager.ircManager.readConnection.get()); - - std::string text = *(select_randomly(messageVariants.begin(), messageVariants.end())); - std::string username = *(select_randomly(usernameVariants.begin(), usernameVariants.end())); - std::string usernameString = username + "!" + username + "@" + username; - - QStringList params{"#pajlada", text.c_str()}; - - qDebug() << params; - - message->setParameters(params); - - message->setPrefix(usernameString.c_str()); - - auto twitchChannel = std::dynamic_pointer_cast(this->channel); - - twitch::TwitchMessageBuilder builder( - twitchChannel.get(), this->channelManager.ircManager.resources, - this->channelManager.emoteManager, this->channelManager.windowManager, message, args); - - twitchChannel->addMessage(builder.parse()); - } -} - -void Split::doToggleMessageSpawning() -{ - this->testEnabled = !this->testEnabled; -} - void Split::doIncFlexX() { this->setFlexSizeX(this->getFlexSizeX() * 1.2); diff --git a/src/widgets/split.hpp b/src/widgets/split.hpp index 8987ce54d..31b0eef35 100644 --- a/src/widgets/split.hpp +++ b/src/widgets/split.hpp @@ -52,7 +52,6 @@ public: CompletionManager &completionManager; pajlada::Settings::Setting channelName; boost::signals2::signal channelChanged; - bool testEnabled = false; std::shared_ptr getChannel() const; std::shared_ptr &getChannelRef(); @@ -122,8 +121,6 @@ public slots: // Open viewer list of the channel void doOpenViewerList(); - void doToggleMessageSpawning(); - void test(); void doIncFlexX(); void doDecFlexX(); void doIncFlexY();