Removed unused local vars. Slightly refactored code.

This commit is contained in:
23rd 2019-05-04 20:39:58 +03:00 committed by pajlada
parent 2d21bb0695
commit efec76df5b
10 changed files with 4 additions and 36 deletions

View file

@ -188,7 +188,7 @@ public:
assert(row >= 0 && row < this->rows_.size() && column >= 0 &&
column < this->columnCount_);
return this->rows_[index.row()].items[index.column()]->flags();
return this->rows_[row].items[column]->flags();
}
QStandardItem *getItem(int row, int column)

View file

@ -291,7 +291,6 @@ void TimestampElement::addToContainer(MessageLayoutContainer &container,
{
if (flags.hasAny(this->getFlags()))
{
auto app = getApp();
if (getSettings()->timestampFormat != this->format_)
{
this->format_ = getSettings()->timestampFormat.getValue();

View file

@ -240,8 +240,6 @@ void Emojis::sortEmojis()
void Emojis::loadEmojiSet()
{
auto app = getApp();
getSettings()->emojiSet.connect([=](const auto &emojiSet) {
this->emojis.each([=](const auto &name,
std::shared_ptr<EmojiData> &emoji) {

View file

@ -172,8 +172,6 @@ bool TwitchAccountManager::isLoggedIn() const
bool TwitchAccountManager::removeUser(TwitchAccount *account)
{
const auto &accs = this->accounts.getVector();
auto userID(account->getUserId());
if (!userID.isEmpty())
{

View file

@ -387,10 +387,7 @@ void WindowManager::initialize(Settings &settings, Paths &paths)
void WindowManager::save()
{
log("[WindowManager] Saving");
assertInGuiThread();
auto app = getApp();
QJsonDocument document;
// "serialize"

View file

@ -33,20 +33,10 @@ LoggingChannel::LoggingChannel(const QString &_channelName)
// FOURTF: change this when adding more providers
this->subDirectory = "Twitch/" + this->subDirectory;
auto app = getApp();
getSettings()->logPath.connect([this](const QString &logPath, auto) {
auto app = getApp();
if (logPath.isEmpty())
{
this->baseDirectory = getPaths()->messageLogDirectory;
}
else
{
this->baseDirectory = logPath;
}
this->baseDirectory = logPath.isEmpty()
? getPaths()->messageLogDirectory
: logPath;
this->openLogFile();
});
}

View file

@ -36,8 +36,6 @@ namespace {
QString getStreamlinkProgram()
{
auto app = getApp();
if (getSettings()->streamlinkUseCustomPath)
{
return getSettings()->streamlinkPath + "/" + getBinaryName();
@ -66,7 +64,6 @@ namespace {
{
static QErrorMessage *msg = new QErrorMessage;
auto app = getApp();
if (getSettings()->streamlinkUseCustomPath)
{
msg->showMessage(
@ -172,8 +169,6 @@ void getStreamQualities(const QString &channelURL,
void openStreamlink(const QString &channelURL, const QString &quality,
QStringList extraArguments)
{
auto app = getApp();
QStringList arguments;
QString additionalOptions = getSettings()->streamlinkOpts.getValue();
@ -202,8 +197,6 @@ void openStreamlink(const QString &channelURL, const QString &quality,
void openStreamlinkForChannel(const QString &channel)
{
auto app = getApp();
QString channelURL = "twitch.tv/" + channel;
QString preferredQuality = getSettings()->preferredQuality;

View file

@ -29,8 +29,6 @@ NotebookTab::NotebookTab(Notebook *notebook)
, notebook_(notebook)
, menu_(this)
{
auto app = getApp();
this->setAcceptDrops(true);
this->positionChangedAnimation_.setEasingCurve(
@ -527,8 +525,6 @@ void NotebookTab::dragEnterEvent(QDragEnterEvent *event)
void NotebookTab::mouseMoveEvent(QMouseEvent *event)
{
auto app = getApp();
if (getSettings()->showTabCloseButton &&
this->notebook_->getAllowUserTabManagement()) //
{

View file

@ -26,7 +26,6 @@ namespace chatterino {
AdvancedPage::AdvancedPage()
: SettingsPage("Advanced", ":/settings/advanced.svg")
{
auto app = getApp();
LayoutCreator<AdvancedPage> layoutCreator(this);
auto tabs = layoutCreator.emplace<QTabWidget>();

View file

@ -14,8 +14,6 @@ namespace chatterino {
ExternalToolsPage::ExternalToolsPage()
: SettingsPage("External tools", ":/settings/externaltools.svg")
{
auto app = getApp();
LayoutCreator<ExternalToolsPage> layoutCreator(this);
auto layout = layoutCreator.setLayoutType<QVBoxLayout>();