Files
chatterino2/src/widgets/dialogs/switcher/NewTabItem.hpp
Vilgot Fredenberg de04ff82a7 Clean up compiler warnings (#2027)
Fix the following compiler warning
../src/common/NetworkResult.hpp: In constructor ‘chatterino::NetworkResult::NetworkResult(const QByteArray&, int)’:
../src/common/NetworkResult.hpp:28:16: warning: ‘chatterino::NetworkResult::data_’ will be initialized after [-Wreorder]
   28 |     QByteArray data_;
      |                ^~~~~
../src/common/NetworkResult.hpp:27:9: warning:   ‘int chatterino::NetworkResult::status_’ [-Wreorder]
   27 |     int status_;
      |         ^~~~~~~
../src/common/NetworkResult.cpp:9:1: warning:   when initialized here [-Wreorder]
    9 | NetworkResult::NetworkResult(const QByteArray &data, int status)

* Clang compiler warnings

Fixes every instance of the following error:

In file included from ../src/widgets/settingspages/CommandPage.cpp:12:
In file included from ../src/controllers/commands/CommandModel.hpp:5:
../src/common/SignalVectorModel.hpp:242:10: warning: 'moveRows' overrides a member function but is not marked 'override' [-Winconsistent-missing-override]
    bool moveRows(const QModelIndex &sourceParent, int sourceRow, int count,
         ^
../src/controllers/commands/CommandModel.hpp:12:29: note: in instantiation of template class 'chatterino::SignalVectorModel<chatterino::Command>' requested here
class CommandModel : public SignalVectorModel<Command>
2020-10-04 12:47:23 +02:00

33 lines
810 B
C++

#pragma once
#include "widgets/dialogs/switcher/AbstractSwitcherItem.hpp"
namespace chatterino {
class NewTabItem : public AbstractSwitcherItem
{
public:
/**
* @brief Construct a new NewTabItem that opens a passed channel in a new
* tab.
*
* @param channelName name of channel to open
*/
NewTabItem(const QString &channelName);
/**
* @brief Open the channel passed in the constructor in a new tab.
*/
virtual void action() override;
virtual void paint(QPainter *painter, const QRect &rect) const override;
virtual QSize sizeHint(const QRect &rect) const override;
private:
static constexpr const char *TEXT_FORMAT = "Open channel \"%1\" in new tab";
QString channelName_;
QString text_;
};
} // namespace chatterino